[Pkg-ofed-commits] [infiniband-diags] 04/07: Imported Upstream version 1.6.1

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Tue Jul 1 07:17:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to branch master
in repository infiniband-diags.

commit bcea6f94cbcc7e2354394e096b77a5835e647148
Author: Ana Guerrero López <ana at ekaia.org>
Date:   Mon Jun 30 22:15:41 2014 +0200

    Imported Upstream version 1.6.1
---
 AUTHORS                                            |    4 +
 COPYING                                            |   12 +-
 ChangeLog                                          | 7219 ++++++++++++++++-
 Makefile.am                                        |  196 +-
 Makefile.in                                        | 1669 ++--
 README                                             |  568 +-
 aclocal.m4                                         | 8252 +-------------------
 autogen.sh                                         |    6 +
 config.h.in                                        |   19 +-
 config/compile                                     |  142 +
 config/config.guess                                |  753 +-
 config/config.sub                                  |  329 +-
 config/depcomp                                     |   93 +-
 config/install-sh                                  |  514 +-
 aclocal.m4 => config/libtool.m4                    | 1530 +---
 config/ltmain.sh                                   |   75 +-
 config/ltoptions.m4                                |  368 +
 config/ltsugar.m4                                  |  123 +
 config/ltversion.m4                                |   23 +
 config/lt~obsolete.m4                              |   92 +
 config/missing                                     |   61 +-
 configure                                          | 1142 ++-
 configure.in                                       |  171 +-
 doc/README.rst                                     |  105 +
 doc/generate                                       |   30 +
 doc/man/check_lft_balance.8                        |   73 +
 doc/man/check_lft_balance.8.in                     |   73 +
 doc/man/dump_lfts.8                                |  177 +
 doc/man/dump_lfts.8.in                             |  177 +
 doc/man/dump_mfts.8                                |  170 +
 doc/man/dump_mfts.8.in                             |  170 +
 doc/man/ibaddr.8                                   |  207 +
 doc/man/ibaddr.8.in                                |  207 +
 doc/man/ibcacheedit.8                              |   86 +
 doc/man/ibcacheedit.8.in                           |   86 +
 doc/man/ibccconfig.8                               |  197 +
 doc/man/ibccconfig.8.in                            |  197 +
 doc/man/ibccquery.8                                |  194 +
 doc/man/ibccquery.8.in                             |  194 +
 doc/man/ibclearcounters.8.in                       |  101 +
 doc/man/ibfindnodesusing.8                         |  123 +
 doc/man/ibfindnodesusing.8.in                      |  123 +
 doc/man/ibhosts.8                                  |  169 +
 doc/man/ibhosts.8.in                               |  169 +
 doc/man/ibidsverify.8                              |   82 +
 doc/man/ibidsverify.8.in                           |   82 +
 doc/man/iblinkinfo.8                               |  315 +
 doc/man/iblinkinfo.8.in                            |  315 +
 doc/man/ibnetdiscover.8                            |  393 +
 doc/man/ibnetdiscover.8.in                         |  393 +
 doc/man/ibnodes.8                                  |  169 +
 doc/man/ibnodes.8.in                               |  169 +
 doc/man/ibping.8                                   |  178 +
 doc/man/ibping.8.in                                |  178 +
 doc/man/ibportstate.8                              |  259 +
 doc/man/ibportstate.8.in                           |  259 +
 doc/man/ibqueryerrors.8                            |  327 +
 doc/man/ibqueryerrors.8.in                         |  327 +
 doc/man/ibroute.8                                  |  235 +
 doc/man/ibroute.8.in                               |  235 +
 doc/man/ibrouters.8                                |  169 +
 doc/man/ibrouters.8.in                             |  169 +
 doc/man/ibstat.8                                   |  129 +
 doc/man/ibstat.8.in                                |  129 +
 doc/man/ibstatus.8                                 |   78 +
 doc/man/ibstatus.8.in                              |   78 +
 doc/man/ibswitches.8                               |  169 +
 doc/man/ibswitches.8.in                            |  169 +
 doc/man/ibsysstat.8                                |  184 +
 doc/man/ibsysstat.8.in                             |  184 +
 doc/man/ibtracert.8                                |  268 +
 doc/man/ibtracert.8.in                             |  268 +
 doc/man/infiniband-diags.8                         |  447 ++
 doc/man/infiniband-diags.8.in                      |  447 ++
 doc/man/perfquery.8                                |  305 +
 doc/man/perfquery.8.in                             |  305 +
 doc/man/saquery.8                                  |  387 +
 doc/man/saquery.8.in                               |  387 +
 doc/man/sminfo.8                                   |  218 +
 doc/man/sminfo.8.in                                |  218 +
 doc/man/smpdump.8                                  |  213 +
 doc/man/smpdump.8.in                               |  213 +
 doc/man/smpquery.8                                 |  292 +
 doc/man/smpquery.8.in                              |  292 +
 doc/man/vendstat.8                                 |  231 +
 doc/man/vendstat.8.in                              |  231 +
 doc/rst/check_lft_balance.8.in.rst                 |   52 +
 doc/rst/common/opt_C.rst                           |    4 +
 doc/rst/common/opt_D.rst                           |   14 +
 doc/rst/common/opt_D_with_param.rst                |   14 +
 doc/rst/common/opt_G.rst                           |    4 +
 doc/rst/common/opt_G_with_param.rst                |    4 +
 doc/rst/common/opt_K.rst                           |    4 +
 doc/rst/common/opt_L.rst                           |    4 +
 doc/rst/common/opt_P.rst                           |    4 +
 doc/rst/common/opt_V.rst                           |    4 +
 doc/rst/common/opt_cache.rst                       |    7 +
 doc/rst/common/opt_d.rst                           |    6 +
 doc/rst/common/opt_diff.rst                        |    9 +
 doc/rst/common/opt_diffcheck.rst                   |   13 +
 doc/rst/common/opt_e.rst                           |    3 +
 doc/rst/common/opt_h.rst                           |    4 +
 doc/rst/common/opt_load-cache.rst                  |    8 +
 doc/rst/common/opt_node_name_map.rst               |    6 +
 doc/rst/common/opt_o-outstanding_smps.rst          |    7 +
 doc/rst/common/opt_s.rst                           |    4 +
 doc/rst/common/opt_t.rst                           |    4 +
 doc/rst/common/opt_v.rst                           |    6 +
 doc/rst/common/opt_y.rst                           |    6 +
 doc/rst/common/opt_z-config.rst                    |    6 +
 doc/rst/common/sec_config-file.rst                 |   10 +
 doc/rst/common/sec_node-name-map.rst               |   43 +
 doc/rst/common/sec_portselection.rst               |   24 +
 doc/rst/common/sec_topology-file.rst               |   89 +
 doc/rst/dump_lfts.8.in.rst                         |   73 +
 doc/rst/dump_mfts.8.in.rst                         |   64 +
 doc/rst/ibaddr.8.in.rst                            |  101 +
 doc/rst/ibcacheedit.8.in.rst                       |   59 +
 doc/rst/ibccconfig.8.in.rst                        |   94 +
 doc/rst/ibccquery.8.in.rst                         |   90 +
 doc/rst/ibclearcounters.8.in.rst                   |   51 +
 doc/rst/ibfindnodesusing.8.in.rst                  |   54 +
 doc/rst/ibhosts.8.in.rst                           |   56 +
 doc/rst/ibidsverify.8.in.rst                       |   63 +
 doc/rst/iblinkinfo.8.in.rst                        |  132 +
 doc/rst/ibnetdiscover.8.in.rst                     |  115 +
 doc/rst/ibnodes.8.in.rst                           |   58 +
 doc/rst/ibping.8.in.rst                            |   86 +
 doc/rst/ibportstate.8.in.rst                       |  125 +
 doc/rst/ibqueryerrors.8.in.rst                     |  156 +
 doc/rst/ibqueryerrors.8.in.rst.orig                |  153 +
 doc/rst/ibroute.8.in.rst                           |  109 +
 doc/rst/ibrouters.8.in.rst                         |   57 +
 doc/rst/ibstat.8.in.rst                            |   83 +
 doc/rst/ibstatus.8.in.rst                          |   54 +
 doc/rst/ibswitches.8.in.rst                        |   55 +
 doc/rst/ibsysstat.8.in.rst                         |   87 +
 doc/rst/ibtracert.8.in.rst                         |  108 +
 doc/rst/infiniband-diags.8.in.rst                  |  166 +
 doc/rst/perfquery.8.in.rst                         |  177 +
 doc/rst/saquery.8.in.rst                           |  207 +
 doc/rst/sminfo.8.in.rst                            |  102 +
 doc/rst/smpdump.8.in.rst                           |  104 +
 doc/rst/smpquery.8.in.rst                          |  115 +
 doc/rst/vendstat.8.in.rst                          |  120 +
 etc/error_thresholds                               |   16 +
 etc/ibdiag.conf                                    |   22 +
 include/ibdiag_common.h                            |  132 +-
 include/ibdiag_version.h                           |    2 +-
 include/ibnetdiscover.h                            |  107 -
 infiniband-diags.spec                              |  145 +-
 infiniband-diags.spec.in                           |  139 +-
 libibnetdisc/Makefile.am                           |   52 +
 libibnetdisc/Makefile.in                           |  755 ++
 libibnetdisc/include/infiniband/ibnetdisc.h        |  253 +
 .../include/infiniband/ibnetdisc_osd.h             |   21 +-
 libibnetdisc/libibnetdisc.ver                      |    9 +
 libibnetdisc/man/ibnd_debug.3                      |    2 +
 libibnetdisc/man/ibnd_destroy_fabric.3             |    2 +
 libibnetdisc/man/ibnd_discover_fabric.3            |   65 +
 libibnetdisc/man/ibnd_find_node_dr.3               |    2 +
 libibnetdisc/man/ibnd_find_node_guid.3             |   21 +
 libibnetdisc/man/ibnd_iter_nodes.3                 |   20 +
 libibnetdisc/man/ibnd_iter_nodes_type.3            |    2 +
 libibnetdisc/man/ibnd_show_progress.3              |    2 +
 libibnetdisc/src/chassis.c                         | 1344 ++++
 include/grouping.h => libibnetdisc/src/chassis.h   |   62 +-
 libibnetdisc/src/ibnetdisc.c                       |  904 +++
 libibnetdisc/src/ibnetdisc_cache.c                 |  954 +++
 libibnetdisc/src/internal.h                        |  108 +
 libibnetdisc/src/libibnetdisc.map                  |   21 +
 libibnetdisc/src/query_smp.c                       |  288 +
 libibnetdisc/test/testleaks.c                      |  174 +
 man/check_lft_balance.8                            |   42 -
 man/dump_lfts.8                                    |   50 -
 man/dump_mfts.8                                    |   45 -
 man/ibaddr.8                                       |  109 -
 man/ibcheckportwidth.8                             |    2 +-
 man/ibdatacounters.8                               |    3 +-
 man/ibfindnodesusing.8                             |   30 -
 man/ibhosts.8                                      |   31 -
 man/ibidsverify.8                                  |   36 -
 man/iblinkinfo.8                                   |   52 -
 man/ibnetdiscover.8                                |  233 -
 man/ibnodes.8                                      |   31 -
 man/ibping.8                                       |   84 -
 man/ibportstate.8                                  |  113 -
 man/ibprintrt.8                                    |    3 +-
 man/ibprintswitch.8                                |   15 +-
 man/ibqueryerrors.8                                |   63 -
 man/ibroute.8                                      |  119 -
 man/ibrouters.8                                    |   31 -
 man/ibstat.8                                       |  110 -
 man/ibstatus.8                                     |   41 -
 man/ibswitches.8                                   |   31 -
 man/ibswportwatch.8                                |    8 +-
 man/ibsysstat.8                                    |   83 -
 man/ibtracert.8                                    |  112 -
 man/perfquery.8                                    |  124 -
 man/saquery.8                                      |  132 -
 man/sminfo.8                                       |  105 -
 man/smpdump.8                                      |   98 -
 man/smpquery.8                                     |  113 -
 man/vendstat.8                                     |   84 -
 scripts/IBswcountlimits.pm                         |   56 +-
 scripts/check_lft_balance.pl                       |  162 +-
 scripts/dump_lfts.sh                               |    6 +-
 scripts/dump_mfts.sh                               |   10 +-
 scripts/ibcheckerrors                              |    9 +-
 scripts/ibcheckerrors.in                           |    9 +-
 scripts/ibcheckerrs                                |   84 +-
 scripts/ibcheckerrs.in                             |   84 +-
 scripts/ibchecknet                                 |   11 +-
 scripts/ibchecknet.in                              |   11 +-
 scripts/ibchecknode                                |   10 +-
 scripts/ibchecknode.in                             |   10 +-
 scripts/ibcheckport                                |   21 +-
 scripts/ibcheckport.in                             |   21 +-
 scripts/ibcheckportstate                           |   10 +-
 scripts/ibcheckportstate.in                        |   10 +-
 scripts/ibcheckportwidth                           |   12 +-
 scripts/ibcheckportwidth.in                        |   12 +-
 scripts/ibcheckstate                               |    8 +-
 scripts/ibcheckstate.in                            |    8 +-
 scripts/ibcheckwidth                               |    7 +-
 scripts/ibcheckwidth.in                            |    7 +-
 scripts/ibclearcounters                            |    3 +-
 scripts/ibclearcounters.in                         |    3 +-
 scripts/ibclearerrors                              |    3 +-
 scripts/ibclearerrors.in                           |    3 +-
 scripts/ibdatacounters                             |   10 +-
 scripts/ibdatacounters.in                          |   10 +-
 scripts/ibdatacounts                               |   12 +-
 scripts/ibdatacounts.in                            |   12 +-
 scripts/ibdiscover.pl                              |    9 +
 scripts/ibhosts                                    |    8 +-
 scripts/ibhosts.in                                 |    8 +-
 scripts/ibidsverify.pl                             |   50 +-
 scripts/iblinkinfo.pl                              |  295 +-
 scripts/iblinkinfo.pl.in                           |   42 +
 scripts/ibnodes                                    |    2 +-
 scripts/ibnodes.in                                 |    2 +-
 scripts/ibprintca.pl                               |    9 +
 scripts/ibprintrt.pl                               |    2 +
 scripts/ibprintswitch.pl                           |    2 +
 scripts/ibqueryerrors.pl                           |  199 +-
 scripts/ibqueryerrors.pl.in                        |   41 +
 scripts/ibrouters                                  |    8 +-
 scripts/ibrouters.in                               |    8 +-
 scripts/ibstatus                                   |    3 +-
 scripts/ibswitches                                 |   12 +-
 scripts/ibswitches.in                              |   12 +-
 scripts/set_nodedesc.sh                            |    5 +-
 src/grouping.c                                     |  787 --
 src/ibaddr.c                                       |  181 +-
 src/ibcacheedit.c                                  |  356 +
 src/ibccconfig.c                                   |  643 ++
 src/ibccquery.c                                    |  427 +
 src/ibdiag_common.c                                |  964 ++-
 src/iblinkinfo.c                                   |  765 ++
 src/ibnetdiscover.c                                | 1636 ++--
 src/ibping.c                                       |  245 +-
 src/ibportstate.c                                  |  914 ++-
 src/ibqueryerrors.c                                | 1014 +++
 src/ibroute.c                                      |  336 +-
 src/ibsendtrap.c                                   |  199 +-
 src/ibstat.c                                       |  233 +-
 src/ibsysstat.c                                    |  306 +-
 src/ibtracert.c                                    |  445 +-
 src/mcm_rereg_test.c                               |  232 +-
 src/perfquery.c                                    |  831 +-
 src/saquery.c                                      | 2151 +++--
 src/sminfo.c                                       |  170 +-
 src/smpdump.c                                      |  262 +-
 src/smpquery.c                                     |  392 +-
 src/vendstat.c                                     |  472 +-
 276 files changed, 41809 insertions(+), 21182 deletions(-)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..66f9be2
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,4 @@
+Shahar Frank		<shahar at voltaire.com>
+Hal Rosenstock		<halr at voltaire.com>
+Sasha Khapyorsky	<sashak at voltaire.com>
+Ira Weiny			<weiny2 at llnl.gov>
diff --git a/COPYING b/COPYING
index a017728..6958ce9 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,6 @@
-This software with the exception of OpenSM is available to you
-under a choice of one of two licenses. You may chose to be
-licensed under the terms of the the OpenIB.org BSD license or
-the GNU General Public License (GPL) Version 2, both included
-below.
-
-OpenSM is licensed under either GNU General Public License (GPL)
-Version 2, or Intel BSD + Patent license. See OpenSM for the
-specific language for the latter licensing terms.
+This software is available to you under a choice of one of two licenses. You
+may chose to be licensed under the terms of the the OpenIB.org BSD license or
+the GNU General Public License (GPL) Version 2, both included below.
 
 
 Copyright (c) 2004, 2005 Voltaire, Inc.  All rights reserved.
diff --git a/ChangeLog b/ChangeLog
index 37b63ae..713c3ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,1245 +1,7882 @@
 
+** Version: HEAD
+
+Mon Jul 30 16:20:55 2012 -0400 Ira Weiny
+f1fa20e2bec8d5866a60bda99dd62e292d2dd616
+
+	* infiniband-diags: update README and configure.in for 1.6.1 release
+
+Mon Jul 23 16:45:33 2012 -0700 Albert Chu
+6356b648e83fac8a20a6678dc5949ae86e40f257
+
+	* infiniband-diags: Fix command line parsing bug in ibccconfig, ibccquery, saquery, and smpquery.
+
+Thu Jul 12 10:35:13 2012 +0000 Hal Rosenstock
+e72ca56743022f8005d7c93c940ca8a028974590
+
+	* infiniband-diags/vendstat.c: Commentary change
+
+Wed Jul 11 14:05:37 2012 +0000 Hal Rosenstock
+370f2330dc55a7dd25f2d465d44ca82ad071721c
+
+	* infiniband-diags/perfquery.c: Fix compile warning
+
+Tue Jul 10 15:24:33 2012 +0000 Daniel Klein
+9ccd4685ba61d9cb3a7f29a8e87f0f2b694eaf4a
+
+	* Subject: [PATCHv2] infiniband-diags/vendstat: updated devices supporting extended fw info
+
+Sun Jul 8 17:49:37 2012 +0000 Hal Rosenstock
+3b22454dffaa0207d3f5ed935266571476b450fe
+
+	* infiniband-diags: Support MLNX ExtendedPortInfo for ConnectIB device
+
+Thu Jul 5 12:45:20 2012 -0400 Hal Rosenstock
+4e3a9074b69e41166089d4a3772aa585dc29987d
+
+	* iblinkinfo: fix no port 0 info segmentation fault
+
+Thu Jul 5 14:25:50 2012 -0400 Hal Rosenstock
+1b78dc56302a00070d06257be124e9c17835145a
+
+	* mcm_rereg_test.c: Fix a couple of output messages
+
+Thu Jul 5 12:42:53 2012 -0400 Hal Rosenstock
+b18dbe3725f0e75f7ca09cd95b8968322856d503
+
+	* ibnetdiscover: fix not showing FDR10 speeds
+
+Thu Jun 28 13:13:07 2012 -0400 Hal Rosenstock
+1d88102ec41667b839273f69beb64816a72a3680
+
+	* infiniband-diags/ibnetdiscover: fix no port 0 info segmentation fault
+
+Fri Jun 1 15:44:46 2012 -0700 Ira Weiny
+30cdb87ebb2018cacfd577b32394e1f3e898a664
+
+	* infiniband-diags: saquery avoid a potential seg fault in libibmad
+
+Thu May 31 17:48:04 2012 -0700 Ira Weiny
+370ee066a1d4ee5bb59786df7ab717486efa9870
+
+	* infiniband-diags: update README for 1.6.0 release
+
+Thu May 31 16:59:12 2012 -0700 Ira Weiny
+47e95f6b97c338afad38571e7b03231d63d53b22
+
+	* infiniband-diags: udpate smp documentation in infiniband-diags page
+
+Tue May 29 20:54:33 2012 -0700 Ira Weiny
+8dbb41ce333e37b3a52b52bbd9febc9d6b9cbb0e
+
+	* infiniband-diags: Add SMP/QP0 usage explanation to general man page
+
+Thu May 31 15:10:54 2012 -0700 Ira Weiny
+9ca4c0369b6fd1266f50105c07ec7f85db9e8c7a
+
+	* infiniband-diags: saquery clarify default smkey option value
+
+Wed May 30 15:15:14 2012 -0700 Jim Foraker
+a27e2e1683cb7ce3d1cc55b1055c2a8fb0695e16
+
+	* infiniband-diags: Add SA smkey option to config file
+
+Wed May 30 15:14:20 2012 -0700 Jim Foraker
+1ff0e5182fbec725e14c7101e1f9848c278202ab
+
+	* ib-diags/saquery: Fix smkey handling
+
+Wed May 30 10:21:35 2012 -0700 Jim Foraker
+c361d33cb57a2c942ffa4bbcd3a1dcf08f05b45c
+
+	* infiniband-diags: Add m_key option to config file
+
+Wed May 30 10:21:34 2012 -0700 Jim Foraker
+32a72dd3ea0efbe09579d0ee806d298614d0d722
+
+	* infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits
+
+Thu May 31 12:11:33 2012 -0700 Jim Foraker
+ced1cd4758638468329392099ee82c6f2650ea0c
+
+	* infiniband-diags: Allow specification of an mkey to use on the command line
+
+Wed May 30 10:21:32 2012 -0700 Jim Foraker
+05de760798b5ee0e249b540543d4282a2a2a0d4a
+
+	* infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits
+
+Wed May 30 10:21:31 2012 -0700 Jim Foraker
+a259b9a0d6e7aa53d4013db69126c54a1e83cf7d
+
+	* infiniband-diags: install config file mode 400
+
+Wed May 30 10:21:30 2012 -0700 Jim Foraker
+546ecba50dcb1b24b5fb64e7e1fc947e4d0c2192
+
+	* infiniband-diags: Obfuscate sensitive output by default
+
+Wed May 30 10:09:02 2012 -0700 Jim Foraker
+91277f7a31489a12de94d17bca4f5c7f373616ff
+
+	* infiniband-diags: clean up exclude arguments to ibdiag_process_opts()
+
+Tue May 29 10:04:03 2012 -0700 Hal Rosenstock
+42a7b27865250af8ae87564a66e9fcd5f71dadbe
+
+	* infiniband-diags/ibportstate.c: Remove an extra space from warning message
+
+Thu May 24 13:42:29 2012 -0400 Hal Rosenstock
+c7c22d109e3b690e4c38e95fe4590115ca07dc44
+
+	* infiniband-diags/ibportstate.c: Add newly added options to usage
+
+Tue May 15 15:52:26 2012 -0700 Ira Weiny
+4d1fab57d2a572dfbd0370b1e0cac5ccfea8ac67
+
+	* infiniband-diags: fix autogen with new rst documentation
+
+Thu May 3 17:13:32 2012 -0700 Ira Weiny
+5f8679d4959904e2f7f890fb35885076cdec460f
+
+	* infiniband-diags: move man/check_lft_balance,ibcacheedit,ibstatus,ibidsverify to rst documentation
+
+Thu May 3 14:20:56 2012 -0700 Ira Weiny
+09627e978bb0a7dc99f4bb7cac677dfef592b90a
+
+	* infiniband-diags: move man/saquery,vendstat,ibsysstat,ibfindnodesusing to rst documentation
+
+Thu May 3 09:48:39 2012 -0700 Ira Weiny
+15bea0d4bbb28df87ef813788324b819ef30bf41
+
+	* infiniband-diags: move man/perfquery,sminfo,smpdump,smpquery to rst documentation
+
+Wed May 2 17:01:34 2012 -0700 Ira Weiny
+7bdba73a18dbd23874de51a53ead53f5ab3fedc2
+
+	* infiniband-diags: move man/ibportstate,ibstat,ibroute,ibtracert to rst documentation
+
+Wed May 2 11:27:32 2012 -0700 Ira Weiny
+71634f0a6acb6a93bdd5fb70b1ce7d5a00c1ff81
+
+	* infiniband-diags: move man/ibping,ibnodes,ibhosts,ibswitches,ibrouters to rst documentation
+
+Wed May 9 14:41:50 2012 -0700 Ira Weiny
+c8c9818dfd3f2ea2ae3a9d19e4e0cb539504f5c9
+
+	* infiniband-diags: move man/ibcc[config|query] to rst documentation
+
+Wed May 9 14:39:08 2012 -0700 Ira Weiny
+2a81766b7dae22878dbc973060ff34226c3bffcd
+
+	* infiniband-diags: move man/dump_[ml]fts to rst documentation
+
+Wed May 9 14:30:22 2012 -0700 Ira Weiny
+818ed87d906b0d5c5c989316aae58a12ee866401
+
+	* infiniband-diags: convert documentation from nroff to rst
+
+Wed May 9 14:13:57 2012 -0700 Ira Weiny
+3bca843a80bfaed68a9ccd3d9585339ad47d531a
+
+	* infiniband-diags: check_lft_balance.pl remove unused options
+
+Fri May 4 12:08:57 2012 -0700 Ira Weiny
+6de4c35dd109e60882d733c155254adff08f62bd
+
+	* infiniband-diags: ibidsverify exit status 1 on errors found
+
+Fri May 4 11:51:58 2012 -0700 Ira Weiny
+c8cba00f39ef38cb74db984700d69e09bc16d52a
+
+	* infiniband-diags: fix ibidsverify portguid validation.
+
+Fri May 4 10:34:30 2012 -0700 Ira Weiny
+97f0f6b09fd10a4a4c9956c72bc305e7478b2632
+
+	* infiniband-diags: move ibidsverify man page to main rpm
+
+Fri May 4 09:20:20 2012 -0700 Ira Weiny
+990917642e047966174101aefad9535d380437f4
+
+	* infiniband-diags: move deprecated scripts to "compat" rpm
+
+Wed May 2 16:13:19 2012 -0700 Ira Weiny
+b4cfdf3dc688008cf8471a27f7525ef768413047
+
+	* infiniband-diags: update ib[hosts|switches|routers] to standard options
+
+Thu May 3 10:26:58 2012 -0700 Ira Weiny
+d5181ea92be7d2a422b22fed7abcbb796d6ed0cf
+
+	* infiniband-diags: smpdump fix option 'string'
+
+Wed May 2 17:26:07 2012 -0700 Ira Weiny
+b04f511198d9f6f37edd79582ad6f71e993dc187
+
+	* infiniband-diags: remove -u common option
+
+Fri Apr 27 15:53:15 2012 -0700 Ira Weiny
+a4cedde4bbb7699558aa00d83ed24f14c94ea265
+
+	* infiniband-diags: remove SMI class registration where possible
+
+Fri Apr 27 14:33:30 2012 -0700 Ira Weiny
+5748256b13a3a1d24ee28e85e5eb233ce5db586b
+
+	* infiniband-diags: remove mad.h from ibstat
+
+Mon Apr 30 17:27:57 2012 -0700 Albert Chu
+7ed1cf6a1b82ed8877ca7f26f0165ac46325cd55
+
+	* infiniband-diags ibcconfig: Update documentation examples
+
+Thu Apr 26 14:43:13 2012 -0700 Albert Chu
+71c07674356f2fdf93187430908cbb501a1ee6ec
+
+	* infiniband-diags/src/ibccquery.c: Fix CACongestionSetting inputs
+
+Mon Sep 26 16:47:21 2011 -0700 Ira Weiny
+7cdad904b8d846cf3958a779561ede8bc59b5d05
+
+	* infiniband-diags: move deprecated scripts to "compat" rpm
+
+Wed Apr 20 23:30:27 2011 -0700 Ira Weiny
+c670c59cecbdbfc0f3fbc1afdecf312f21e771d3
+
+	* infiniband-diags: mark duplicate/lower performing scripts as deprecated.
+
+Wed Apr 18 09:01:21 2012 -0400 Hal Rosenstock
+d5df2450a1b6da5bb5bdc64123ba7a6da28a92f4
+
+	* infiniband-diags/vendstat.c: Support IS4/SX firmware version info
+
+Tue Apr 17 10:55:13 2012 -0700 Ira Weiny
+3ff5a791fe4235d39aca591bf2ac056b7e8f9fc3
+
+	* infiniband-diags: preserve long_opts global for use in ibdiag_show_usage
+
+Thu Apr 12 18:09:45 2012 -0700 Jim Foraker
+288234aad813f218049fbfe0e3b0b25ee8f83f69
+
+	* infiniband-diags: migrate resolve_portid_str in from libibmad
+
+Thu Apr 12 18:09:44 2012 -0700 Jim Foraker
+16f11b35f0cd961e8dc8c6dabd155f2dca024833
+
+	* infiniband-diags: Remove dependencies on ib_resolve_smlid/ib_resolve_self
+
+Thu Apr 12 18:09:43 2012 -0700 Jim Foraker
+7cdde53ada761d06d610544e3a10a1cdb8dd192a
+
+	* infiniband-diags/mcm_rereg_test.c: Include ib_types.h
+
+Thu Apr 12 18:09:42 2012 -0700 Jim Foraker
+ec94c8f13b35c87fc9dd8a54ee86e0f73703ae33
+
+	* infiniband-diags/mcm_rereg_test.c: dead code removal
+
+Thu Apr 12 18:09:41 2012 -0700 Jim Foraker
+18fe6ba8a5e4c1c9afd59e87fc36a28ec4e9582d
+
+	* infiniband-diags/ibroute.c: Dead code removal
+
+Mon Mar 5 13:29:13 2012 -0800 Ira Weiny
+5370dfd43d4a00879bca6a5efd14ce21d20967ac
+
+	* infiniband-diags: saquery further error value clean up.
+
+Mon Feb 27 14:18:09 2012 -0800 Ira Weiny
+c1a428ff57c92dc6c1135755fa5da271acfe74fd
+
+	* infiniband-diags: remove unused options from check_lft_balance.pl
+
+Mon Feb 20 08:17:20 2012 -0800 Ira Weiny
+3179ae8c8d7f4fb1372f2813afcd80e4d772a14b
+
+	* infiniband-diags: remove ib_resolve_smlid_via requirement for sa queries
+
+Fri Feb 17 22:25:42 2012 -0800 Ira Weiny
+0810a520a70897566ab09ed245cdad2c8add3103
+
+	* infiniband-diags: Fix saquery error reporting
+
+Wed Feb 8 10:17:20 2012 -0800 Ira Weiny
+8146868765268752b3e9f60908dded7fcd9180a0
+
+	* Fix ibping server when client stops sending.
+
+Thu Nov 3 14:42:34 2011 -0700 Albert Chu
+4ac43920fb8e2b6c5679498181aa3688eca117f9
+
+	* infiniband-diags: Support ibccconfig, congestion control setting tool
+
+Wed Jan 11 23:39:45 2012 -0800 Ira Weiny
+8aadc8ad3ad1df57941022826a03bce3707907c3
+
+	* ibswitches: fix output when switch names have "base" or "enhanced" in them
+
+Tue Jan 10 12:22:58 2012 -0800 Hal Rosenstock
+cb92b9808bdc292b291e2ef416b6ead19745826c
+
+	* infiniband-diags/configure.in: Fix typo
+
+Sun Dec 4 19:37:00 2011 -0800 Ira Weiny
+78ec2486dfce920b650cf2719acc649b297e2197
+
+	* infiniband-diags/ibccquery Fix field name
+
+Fri Dec 2 16:00:10 2011 -0800 Albert Chu
+4fabac9d235341b32756a8584e80db86bb348c5b
+
+	* infiniband-diags/src/ibccquery.c: Fix off by one output bug, ccti_limit is 0 based not 1 based
+
+Fri Dec 2 11:52:27 2011 -0800 Ira Weiny
+d8648e9d603e469d0fbd90d18b4c99e725d05812
+
+	* infiniband-diags: add config file option for Mellanox ExtPortInfo queries
+
+Fri Dec 2 11:50:31 2011 -0800 Ira Weiny
+3d726a8ec8752938e224ef6bb0cbea8e84544dff
+
+	* infiniband-diags: move is_mlnx_ext_port_info_supported to common code
+
+Fri Dec 2 13:38:17 2011 -0800 Ira Weiny
+72f1eb2e425f6198ea2153f1a8a30cacba37b0a5
+
+	* infiniband-diags: fix printing of extended speeds when port is down
+
+Thu Dec 1 11:33:09 2011 -0800 Hal Rosenstock
+7db86c37537a43521df77ccfce81b714f5c02667
+
+	* infiniband-diags/perfquery.c: Fix reset for PortExtendedSpeedsCounters
+
+Thu Dec 1 08:21:12 2011 -0800 Hal Rosenstock
+389da636bf1b9614276500039c8c017623fd8c8e
+
+	* infiniband-diags/perfquery.c: Fix display of PortExtendedSpeedsCounters
+
+Wed Nov 30 14:09:52 2011 -0800 Albert Chu
+3c1b21f10c632448419911efa13a5763d15dae7b
+
+	* Fix typo in ibccquery manpage
+
+Mon Nov 7 08:47:43 2011 -0800 Ira Weiny
+5286c744427e642e3ee039fafe8b71d3e3f1ba6e
+
+	* infiniband-diags: check_lft_balance.pl add -C/-P options
+
+Mon Nov 7 07:42:19 2011 -0800 Ira Weiny
+843371947e7f447446df59dd6a5e4e78f264c0e6
+
+	* check_lft_balance.pl: Add extra check when using -e heuristic flag in check_lft_balance.pl
+
+Wed Oct 12 17:17:08 2011 -0700 Albert L.Chu
+4ed1bbb8e642d88cca5dbbd2b5c6fb5473f45265
+
+	* Add -e heuristic flag to check_lft_balance.pl to detect common scenarios where unbalanced routing will occur.
+
+Wed Oct 12 15:43:01 2011 -0700 Albert L.Chu
+ff9b775a6bef88f50751fc80deba8d90d962bbcd
+
+	* Update check_lft_balance.pl to work with newer infiniband-diag tools
+
+Mon Oct 31 22:48:12 2011 -0700 Ira Weiny
+7f38b58ae850acaad4c4a79209aec47eb33580a5
+
+	* infiniband-diags: ibqueryerrors: don't exit on reset error
+
+Thu Oct 13 15:35:59 2011 -0700 Ira Weiny
+2a8f55f0926461cfcf81fb41b75da6a653fc1ef5
+
+	* infiniband-diags: add a general config file
+
+Thu Oct 27 00:02:33 2011 -0700 Ira Weiny
+117d3ba10d3e22fecd70080e901ad101c7d6b8de
+
+	* infiniband-diags: add ibccquery man page to build
+
+Wed Oct 26 14:24:46 2011 -0700 Ira Weiny
+a717450ac7ed0b6b08f4ec962ede218a3531238b
+
+	* infiniband-diags: clean up build
+
+Wed Oct 26 11:15:03 2011 -0700 Ira Weiny
+7c49fa20284c5d70831fb03fcec2b45b82251d90
+
+	* infiniband-diags: iblinkinfo flag ports which were not scanned
+
+Wed Oct 12 16:55:10 2011 -0700 Ira Weiny
+e2bdd6ca078aa6c86bdc6ab53fe8c907f1f81ba2
+
+	* infiniband-diags: saquery: use ib-node-name-map file
+
+Thu Oct 13 15:28:50 2011 -0700 Ira Weiny
+00e47776956d769fb2f9bdceafd960917581f492
+
+	* infiniband-diags: iblinkinfo: fix error message
+
+Wed Oct 12 17:28:57 2011 -0700 Ira Weiny
+31c06d94d4ecc5fd6af45150807061848ed89092
+
+	* infiniband-diags: fix installation of error_thresholds file
+
+Thu Oct 13 15:58:33 2011 -0700 Ira Weiny
+607467e00f36c9aa62662445bcd18d0ce72f3be7
+
+	* Master branch is not moving on to 1.6
+
+Thu Sep 29 11:02:21 2011 -0700 Albert Chu
+15ee3ea96e4a280873b9f5b6302aa1c359789ec6
+
+	* support --switches-only and --cas-only options in iblinkinfo
+
+Thu Sep 29 11:26:29 2011 -0700 Ira Weiny
+1c9866e0437fc83dc7b01cd3d8b19300b0d1dfe5
+
+	* Update version in prep for next release
+
+Tue Aug 2 11:15:07 2011 -0700 Albert Chu
+64afec3a376d0d3037bc4c89dd8384f7fa863777
+
+	* Support ibccquery, congestion control query tool.
+
+Tue Sep 27 18:15:12 2011 -0700 Marcus R Epperson
+cdbc1cde39a9ae75212f85e8d24326fb72d1cc7d
+
+	* infiniband-diags/src/ibqueryerrors.c: don't increment bad_ports for port ALL
+
+Tue Sep 27 18:15:11 2011 -0700 Marcus R Epperson
+ae19572efa6bcc389b27302ae0606c7fda2093f0
+
+	* infiniband-diags/src/ibqueryerrors.c: fix segv due to CA port 0 reference
+
+Sun Sep 11 01:10:32 2011 -0700 Alex Netes
+a3b24e9ffa4da0e2b47a6007834bed2ce3530429
+
+	* infiniband-diags/scripts/ibcheckport.in: ignore lid/sm lid checks on non zero port switches
+
+Mon Sep 19 15:32:24 2011 -0700 Ira Weiny
+bb3213197719ec673e898dbec153ee6424097446
+
+	* infiniband-diags: ibqueryerrors add query failure count
+
+Mon Sep 19 14:05:09 2011 -0700 Ira Weiny
+1a72e89eb7386bd9b2ee4e64f95359324025c298
+
+	* infiniband-diags: ibnetdisc Wrap header for use in C++ code
+
+Thu Sep 22 13:37:23 2011 -0700 Hefty, Sean
+8243db1e588c34c7777945c2cc51b94d21ee3d36
+
+	* RE: [PATCH v2] ib-diags: Add cast to fix build on windows
+
+Tue Aug 16 13:40:32 2011 -0700 Ira Weiny
+5ba0caf35bf96c17b0f795e787292afc82116b8b
+
+	* Update AUTHORS and make README release notes.
+
+Thu Sep 1 01:47:39 2011 +0000 Hal Rosenstock
+d7f9ad0651276578b2c2ce22dd32496a419f484e
+
+	* infiniband-diags: Fix cap_mask extended link speed supported endian checks
+
+Wed Aug 31 15:26:42 2011 +0000 Hal Rosenstock
+1e62d09ae5d7e4d43089deea07ceb94f8dfd49a0
+
+	* infiniband-diags/ibqueryerrors.c: Add support for FDR10
+
+Wed Aug 31 17:08:50 2011 -0700 Ira Weiny
+95a84b7cc30aae53e4212e6138b95b515287b151
+
+	* infiniband-diags/iblinkinfo.c: Add support for FDR10
+
+Wed Aug 31 17:07:29 2011 -0700 Ira Weiny
+ce6c56fa2165078e9f653428e26368f5393dd081
+
+	* infiniband-diags: Add support for FDR10 to ibnetdiscover
+
+Wed Aug 31 17:06:43 2011 -0700 Ira Weiny
+c8542da6a0c00ab463f8b7a066219baa1afcb43c
+
+	* infiniband-diags: Add FDR10 support to libibnetdisc
+
+Wed Aug 31 15:26:53 2011 +0000 Hal Rosenstock
+1344cb3feacafc462440dabfa5997c5205486d83
+
+	* infiniband-diags/ibstat.c: Add support for FDR10
+
+Mon Aug 29 21:18:31 2011 +0000 Hal Rosenstock
+3133743b5ea6a7d81b7d70e8a83ce4eb28fec8e6
+
+	* infiniband-diags/ibnetdiscover.c: Fix cap_mask endian for extended link speeds
+
+Wed Aug 31 15:26:28 2011 +0000 Hal Rosenstock
+0020ee448d908011f5f68f1e1d297f1abe58b376
+
+	* infiniband-diags/ibportstate: Add support for FDR10
+
+Wed Aug 31 10:38:08 2011 -0700 Albert Chu
+2100e88e994709789207e010f22a6f7a06afeaa7
+
+	* fix manpage typos
+
+Tue Aug 23 16:12:39 2011 -0700 Ira Weiny
+510c0e0d164ca93af5c263074dea04065fee99fa
+
+	* infiniband-diags: ibqueryerrors Clean up exit codes
+
+Wed Jul 6 18:50:27 2011 -0700 Ira Weiny
+0c220a760d9e42581d326899b8bbbafa16799c06
+
+	* infiniband-diags: add human readable output for data counters
+
+Thu Aug 18 14:47:26 2011 -0700 Ira Weiny
+8bc3e398a656a175a29daa61d461e5fa0ad76c56
+
+	* infiniband-diags: move get_msg to common code
+
+Fri Aug 19 16:53:42 2011 +0000 Hal Rosenstock
+6d819a447ce87825c5c6c84723793c7ab9971f3f
+
+	* infiniband-diags/man/ibportstate.8: Update for fdr
+
+Tue Aug 16 13:44:44 2011 +0000 Hal Rosenstock
+ae7695abf3916f3d434dd62c5bacfc5250c36c32
+
+	* infiniband-diags/ibnetdiscover.c: Changes for extended link speeds
+
+Tue Aug 16 13:44:37 2011 +0000 Hal Rosenstock
+2e77e728c219bc55d88be10015b641158e1e61b2
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Changes for extended link speeds
+
+Tue Aug 16 11:13:59 2011 +0000 Hal Rosenstock
+fa92836fcbe1e4255ff9d6bb8cb3a842fa43e38f
+
+	* infiniband-diags/ibqueryerrors.c: Changes for extended link speeds
+
+Tue Aug 16 10:28:39 2011 +0000 Hal Rosenstock
+d7bb3c119f3a20410937c4a83bb01b8afaf30298
+
+	* infiniband-diags/iblinkinfo.c: Changes for extended link speeds
+
+Tue Aug 16 09:14:39 2011 +0000 Hal Rosenstock
+6aab8ab5db478cc46e01c6bc8cfceb32c7e1b42d
+
+	* infiniband-diags/ibportstate.c: Changes for extended link speeds
+
+Tue Aug 16 00:37:15 2011 +0000 Hal Rosenstock
+b550a953e5f8ff7637054377c2f2fde014198f9b
+
+	* infiniband-diags/perfquery: Add support for extended link speeds
+
+Tue Aug 16 00:18:51 2011 +0000 Hal Rosenstock
+a76827fc6b9562c43940bac49d6a9cb9d40df979
+
+	* infiniband-diags/saquery: Add extended link speed support for PortInfoRecord queries
+
+Mon Aug 15 23:54:33 2011 +0000 Hal Rosenstock
+678ec2f9fc14f60038cd77e46d15040b1b159fd4
+
+	* infiniband-diags/smpquery: Add support for extended link speeds
+
+Fri Aug 5 20:44:39 2011 +0000 shefty
+a817e38e5275dcf75404af19b8592c03f4822118
+
+	* ibnetdisc: Fix build for windows
+
+Fri Aug 5 16:59:08 2011 -0700 Ira Weiny
+65818eabe526aee176fc7129e2b5c1b264ba0a3b
+
+	* infiniband-diags: make library dependancies explicit
+
+Wed Aug 3 13:09:00 2011 -0700 Ira Weiny
+6f87728b6f0e230a8706842695a8388a9083b508
+
+	* infiniband-diags: update check for latest dump function in libibmad
+
+Sat Jul 23 11:02:52 2011 +0000 Hal Rosenstock
+d85a6a88f35bae0182c116298ef57cc224bb02dd
+
+	* infiniband-diags/smpquery: Add Mellanox extended portinfo query
+
+Wed Aug 3 17:58:04 2011 +0000 Hal Rosenstock
+c80dc802054484883a92f96fc9ede9f2a9c076df
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Remove compile warning
+
+Thu Jul 14 17:10:52 2011 -0700 Albert L.Chu
+aa80e79a008717bc40145e06a7f693ae5c592179
+
+	* perfquery: support many optional performance counters, including congestion control counters
+
+Tue Jul 26 12:18:02 2011 +0000 Hal Rosenstock
+ae82553337eaab6140582ef782cbd11e32cb1401
+
+	* infiniband-diags/saquery.c: PortInfoRecord now has an options field
+
+Wed Jul 20 10:01:26 2011 -0700 Ira Weiny
+0ee2db536f7e04678664ac51c0f940fa76cbac1c
+
+	* infiniband-diags: ibqueryerrors fix null threshold_str
+
+Thu Jul 14 14:27:07 2011 -0700 Ira Weiny
+1274813595ceaf4c6cc0726e0aa157111ce4ce19
+
+	* infiniband-diags: convert ib[linkinfo|queryerrors] to use PortGUIDs
+
+Thu Jul 14 16:05:30 2011 -0700 Ira Weiny
+ac291237eec71b758401bab4b8d9ec51b6387e79
+
+	* infiniband-diags: libibnetdisc Allow a DR Path partial fabric query starting at a CA
+
+Thu Jul 14 14:25:41 2011 -0700 Ira Weiny
+f3e0901c7dd69f5d5b81f80a9d1c675898569f6b
+
+	* infiniband-diags: libibnetdisc add port interface
+
+Thu Jun 9 22:18:28 2011 -0700 Ira Weiny
+89b6a7b026e85e6ddfa8d47dde951f7accd5fff3
+
+	* infiniband-diags: move core saquery functionality to ibdiag_common
+
+Thu Jun 2 00:13:38 2011 -0700 Ira Weiny
+80628857886b0b26182fcf4e5d17f3c72a90d8b1
+
+	* infiniband-diags: saquery; remove "result" global
+
+Tue Jul 12 11:34:36 2011 -0700 Ira Weiny
+c06655b88bc1b88f3aa42be4d1306b4fa42e3b47
+
+	* infiniband-diags: change perl install to vendorlib
+
+Tue Jun 28 17:50:37 2011 -0700 Ira Weiny
+dee28c9a36941f6c2f8ae69f4a574984254afeb4
+
+	* infiniband-diags: configure.in; check for more recent function in libibmad
+
+Tue Jul 12 11:35:04 2011 -0700 Ira Weiny
+1098eac2138a533e5fdbdfffbe4837763b78ba37
+
+	* infiniband-diags: Add sysconfdir to spec for config files
+
+Thu Jul 7 09:50:12 2011 -0700 Hal Rosenstock
+c8a3e7bf94498459aad16cd298268e7767e9e9ed
+
+	* infiniband-diags: Initial changes for extended speed support in libibmad
+
+Wed Jul 6 14:32:08 2011 -0700 Ira Weiny
+0138f443fc02c3c650a496db851777221b37e74c
+
+	* infiniband-diags: Remove reference to OpenSM from COPYING
+
+Wed Jun 1 21:49:57 2011 -0700 Ira Weiny
+46b1ba489d6ed3bde6a60c95d07233b67439e4f8
+
+	* infiniband-diags: add package requires to spec file.
+
+Sun May 29 18:01:31 2011 -0700 Ira Weiny
+291a922cbcf246e15f0b71ef5d467c6e8bebb6d2
+
+	* infiniband-diags: test for libosmcomp with a function that is used in the code
+
+Mon Jun 20 06:00:56 2011 -0700 Hal Rosenstock
+e9d099eda47f77d456996ce2fc385423ba19cbc0
+
+	* infiniband-diags/ibnetdiscover.c: Fix typo in help
+
+Thu Jun 16 13:52:43 2011 -0700 Hal Rosenstock
+25fad278d4b8a808da5fe0e2ae7042ba18e74fdc
+
+	* infiniband-diags/ibqueryerrors.c: Fix typo in help
+
+Wed Jun 8 05:47:34 2011 -0700 Hal Rosenstock
+22c5087c091b895507882eec85d6b57b641e637f
+
+	* infiniband-diags/libibnetdisc/ibnetdisc_cache.c: Fix a couple of memory leaks
+
+Wed Jun 8 05:47:15 2011 -0700 Hal Rosenstock
+2a75c3e874e0d5edaaf84085f94fc65cd7c5a5be
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Fix possible overrun of path
+
+Wed Jun 8 05:57:55 2011 -0700 Hal Rosenstock
+3364bcd41ec12c357c0510ac86a0cbb0313ca2d6
+
+	* infiniband-diags/ibportstate.c: Fix sizeof
+
+Fri May 13 22:28:55 2011 -0700 Ira Weiny
+1004b7f967df8a09e82d986124d1881b94dcb370
+
+	* infiniband-diags: perfquery; Support PortCountersExtendedNoIETF
+
+Thu May 12 17:31:15 2011 -0700 Ira Weiny
+5ef9bfa5d30baca408f310630de55aa1f0ecfc33
+
+	* infiniband-diags: perfquery; print cap_mask for information
+
+Fri May 27 10:52:05 2011 -0700 Hal Rosenstock
+82849a8212253c7c91ec6ce3ef15655e1c29b5b1
+
+	* infiniband-diags/saquery.c: Fix SA_ERR_UNKNOWN define
+
+Wed May 25 05:30:06 2011 -0700 Hal Rosenstock
+ca54411f41b9192918c971a6a58b373e11e47919
+
+	* infiniband-diags/configure.in: Support override for IBPATH
+
+Tue May 24 11:26:33 2011 -0700 Hal Rosenstock
+1a2ec7c386ae0ee749ac7b66ed0337b9fe1e1f5f
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Better error message
+
+Thu Apr 28 02:09:36 2011 -0700 Eli Dorfman
+87a30707bb36164a11dd1dd24087ca6bd3a333d1
+
+	* infiniband-diags/vendstat: Fixed general info query
+
+Wed Apr 27 01:07:59 2011 -0700 Ira Weiny
+1e406cb50f406a769afbbf806f984775a10dac4d
+
+	* infiniband-diags: ibqueryerrors; add --counters option
+
+Tue Apr 26 22:59:15 2011 -0700 Ira Weiny
+33a76020297553a5fad0f480e41f6ee9d86f12c7
+
+	* infiniband-diags: ibqueryerrors --data; show/clear PortCountersExtended when supported
+
+Tue Apr 26 22:18:27 2011 -0700 Ira Weiny
+214bb92d11e93c76276db471ce88423d32c531a5
+
+	* infiniband-diags: ibqueryerrors; use #defines for CapabilityMask
+
+Mon Apr 25 12:39:12 2011 -0700 Ira Weiny
+3387935ce91193fc7a3d7cdd9adea124f71a7640
+
+	* infiniband-diags: ibqueryerrors; add ibcheckerrors like summary
+
+Wed Apr 27 10:43:01 2011 -0700 Ira Weiny
+cbe10407a14e57c8febe6e039ae617737f0b6e0f
+
+	* infiniband-diags: ibqueryerrors; add error thresholds
+
+Thu Apr 28 07:47:16 2011 -0700 Hal Rosenstock
+53ac239ede48d6a1df8ed1f048cebe2eb2dc38e4
+
+	* infiniband-diags/perfquery.c: Use ib_types.h defines for CapabilityMask
+
+Wed Apr 27 12:48:15 2011 -0700 Hal Rosenstock
+42b5389f870c192627c22470298f8f97764b5979
+
+	* infiniband-diags/ibnetdiscover.c: Eliminate blank line when sysimgguid is 0
+
+Wed Apr 27 11:17:46 2011 -0700 Hal Rosenstock
+d5d44d167696eeffcb31e941ded9da76566dde6d
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Handle calloc failure
+
+Wed Apr 27 10:08:03 2011 -0700 Ira Weiny
+32c0166f2f3afe68a599b107133ea6e6c6e72edd
+
+	* infiniband-diags: fix "dist" target and subsequent rpm building
+
+Mon Apr 25 19:55:22 2011 -0700 Marcus Epperson
+5f9facd634ed8f95d493c78dec5c1bc12795fbee
+
+	* infiniband-diags/ibnetdiscover: Make --ports option use remap_node_name()
+
+Thu Apr 21 14:47:03 2011 -0700 Ira Weiny
+085432de49bcf6ebbcb927e2cac53da32cc9be94
+
+	* infiniband-diags: improve backwards/standalone compatibility
+
+Sun Apr 17 03:06:21 2011 -0700 Ira Weiny
+a398a098d0c21f0993cd3b8e3cd7485d87d6dff8
+
+	* infiniband-diags: iblinkinfo; remove non-supported -c option from man page
+
+Tue Mar 29 17:48:41 2011 -0700 Ira Weiny
+a8c7126ff8cafc828ddbfe3708d25861e5440056
+
+	* infiniband-diags: saquery, clean up error code/return types
+
+Wed Apr 13 09:10:34 2011 -0700 Ira Weiny
+ef2c2d6732c2f4e92a30e33e1bb4911eddd65223
+
+	* infiniband-diags: saquery, properly free mad in get_and_dump_any_records
+
+Sat Apr 9 15:22:02 2011 +0000 Hal Rosenstock
+6df1fdd5aeb16fe17f08b5693b79326e8d78c7d2
+
+	* infiniband-diags: Make sure buffers are set to zero before calling xxx_query_via
+
+Fri Apr 1 18:38:50 2011 +0000 Hal Rosenstock
+a57e627722a5cad227baaae8de22b0af1438008d
+
+	* infiniband-diags.spec.in: Remove duplication of ibdiscover.pl
+
+Thu Mar 17 17:34:52 2011 -0700 Ira Weiny
+9f91f2a277ade5875af43beb9ae246b9534d8279
+
+	* infiniband-diags: saquery; clean up name/lid processing
+
+Mon Apr 26 14:27:32 2010 -0400 Hal Rosenstock
+1ee5bfabda30ae61ac869c380bbfe4bce3d7de1c
+
+	* infiniband-diags/saquery: Add GUIDInfoRecord support
+
+Tue Mar 22 15:11:45 2011 -0700 Jason Gunthorpe
+7596207a1810dd7c5168469b0c3afd86aca8ae50
+
+	* Fix ibdatacounters
+
+Tue Mar 22 14:25:59 2011 -0700 Jason Gunthorpe
+568a1175a1089ebe8ee2d9b6e57086398219ba38
+
+	* Fix missing $IBPATH in ibdatacounts
+
+Mon Feb 14 15:17:15 2011 -0800 Tamir Ronen
+a6abfa00de4e45cedde3616e03de37b3a3430bf2
+
+	* add support for ibnetdiscover grouping for Mellanox switches
+
+** Version: infiniband-diags-1.5.8
+
+Wed Apr 21 17:04:02 2010 -0700 Albert Chu
+450de0f8196a855bfa1f6da7310dc399088a38a5
+
+	* support --filterdownports in iblinkinfo
+
+Tue Apr 20 10:13:05 2010 -0700 Albert Chu
+c9adf42231d0bb1fc09d361c828bbb54b3f3b2f2
+
+	* Add lid and node description diff options for --diffcheck in iblinkinfo
+
+Tue Apr 20 09:53:53 2010 -0700 Albert Chu
+20af5c37bbdb21482f2f35a0ad087e143a207c4b
+
+	* support --diffcheck in iblinkinfo
+
+Mon Apr 19 10:36:54 2010 -0700 Albert Chu
+1950038c3f71bb1eaecb77516f2022c13189fdcc
+
+	* add --diff support to iblinkinfo
+
+Fri Jul 30 14:26:39 2010 -0700 Ira Weiny
+d58cb634194c80b91bac8caf6ab34d7a1b7408fc
+
+	* ibnetdisc.c: Fix partial scan of the fabric.
+
+Mon Feb 14 10:36:13 2011 -0800 Jason Gunthorpe
+d60d71eeb9890e932472c415164b1ff400d73b12
+
+	* The shell scripts use bashism, so use bash directly.
+
+Mon Feb 14 11:56:21 2011 +0200 Alex Netes
+ff57b27e8ec02f4f92e50cbda5caa4b8e6035823
+
+	* infiniband-diags: package versions update
+
+Mon Feb 14 11:53:59 2011 +0200 Alex Netes
+6edf9877048fd050361fbccdfce69fc2c73b1b06
+
+	* infiniband-diags: update shared library versions
+
+Thu Feb 3 18:25:19 2011 +0200 Alex Netes
+b1e4531e2d10a8404cc7873c6f899494cef236c4
+
+	* Makefile: ChangeLog and version generation script path fix
+
+Wed Dec 22 11:47:07 2010 -0800 Ira Weiny
+b260cb4f276b756ded39455969028bcdcd49f60e
+
+	* Further timeout paramater verification (Was: [PATCH] infiniband-diags: Verify timeout value specified to diagnostics)
+
+Wed Dec 15 11:47:09 2010 -0800 Ira Weiny
+298998c77dad10630608374ed1915b506008e79b
+
+	* infiniband-diags: Verify timeout value specified to diagnostics
+
+Tue Aug 3 10:40:56 2010 -0700 Ira Weiny
+8ab2e41e866c27f2ce605fa0bc16b52cd96babf9
+
+	* libibmad/fields.c: Change all PortCounter names to match the Specification
+
+Wed Oct 27 08:47:07 2010 -0400 Hal Rosenstock
+07b4b1afa21a6b4157a69e82b95ad1bc709326c8
+
+	* infiniband-diags/iblinkinfo.c: Limit some queries to switches
+
+Wed Oct 27 09:06:36 2010 -0400 Hal Rosenstock
+0d7e988df53e6ebf1b86d24cebab308527c811ac
+
+	* infiniband-diags/saquery.c: In dump_one_mcmember_record, fix flow label endian
+
+Tue Sep 14 11:10:16 2010 -0400 Hal Rosenstock
+3d00c3eb9ae7019dbb8d9e4c10fdc54af9855dd2
+
+	* infiniband-diags/ibtracert: Eliminate direct route (-D) option
+
+Mon Oct 4 12:16:43 2010 +0200 Yevgeny Kliteynik
+c58dcaa92c3cce03f03a5d4e6fc6e5197ed9674d
+
+	* ibstat.c: fix core dump if wrong port phys state is reported
+
+Thu Oct 7 16:33:01 2010 -0600 Jason Gunthorpe
+f5178760dcdaeecaad9f98a28ed2d32c74908704
+
+	* Fix autotools to include the necessary M4 files
+
+Sun Sep 5 11:30:37 2010 +0300 Eli Dorfman (Voltaire)
+782fd92025d3c97d8822e95be239edd7553c7b80
+
+	* inifiband-diags: Support Voltaire switch ISR4200
+
+Sun Sep 5 11:28:57 2010 +0300 Eli Dorfman (Voltaire)
+5578a9c0b4b8d614880840305badfc81ef5a33d9
+
+	* infiniband-diags: Do not exit when unexpected node found
+
+** Version: infiniband-diags-1.5.7
+
+Sat Sep 4 14:15:33 2010 +0300 Sasha Khapyorsky
+843d2bb428f5e9fda3628252abcedd69300ee9c0
+
+	* management: packages versions update
+
+Sat Sep 4 14:13:06 2010 +0300 Sasha Khapyorsky
+3eabf4227a7267c52e7be496ffdfb857018c6c83
+
+	* management: update shared library versions
+
+Wed Aug 25 14:08:02 2010 -0400 Hal Rosenstock
+c02bdb17ef04162968e88379b5ab86f10935ba9b
+
+	* infiniband-diags/ibnetdiscover: Fix handling of CA ports in recv_port_info
+
+Thu Aug 26 16:14:16 2010 +0300 Doron Shoham
+843a0072a86afe85e053dceb402c2d62bb38e002
+
+	* ibnetdiscover: add '-f' flag to show full information (ports' speed and width).
+
+Sun Aug 1 20:26:11 2010 +0300 Sasha Khapyorsky
+a387f265398c671e9067e055bbebaa634fb4aa49
+
+	* infiniband-diags/ibstat: convert to PRIx64 macros GUID printing
+
+Mon Jul 26 11:40:30 2010 -0700 Hefty, Sean
+732bac4c01d9e6f2da203ad1a2df241cc5d70cab
+
+	* libibnetdisc: fix cast in unmarshall16
+
+Wed Jun 16 07:05:42 2010 -0400 Hal Rosenstock
+30309edcc97a452ca38cb3f3e8ae278c2a811618
+
+	* infiniband-diags/perfquery.8: Add some missing counters to description
+
+Thu May 6 13:49:55 2010 -0700 Ira Weiny
+074ef7c2578b8837428ea12bffb7803336a113eb
+
+	* ibqueryerrors.c: Optimize by querying AllPortSelect first
+
+Thu Jun 10 18:03:03 2010 +0300 Eli Dorfman (Voltaire)
+35a3ce2a8d9374e0f10f56faf8c4d86e30e38299
+
+	* fix MFT record dump
+
+Wed Apr 21 11:19:44 2010 -0700 Al Chu
+9151e22daf3f7c0ff478bc0af77d1281efa52e75
+
+	* support diffing lids and nodedesc on remoteports in ibnetdiscover
+
+Tue Apr 20 15:30:40 2010 -0700 Al Chu
+d84c9d4ea679a13e64952cf4f45862b6a90c5074
+
+	* support diffing nodedesc on remoteports in ibnetdiscover
+
+Mon Apr 19 11:43:34 2010 -0700 Al Chu
+5763f49eb3d5ba3ba33a05b34790c28d1d7ff727
+
+	* add ibcacheedit tool
+
+Mon Apr 19 11:43:15 2010 -0700 Al Chu
+08512b831eaf13f4c8e8b2d4a00b660ade8efa32
+
+	* support libibnetdisc caching no-overwrite flag
+
+Mon Apr 19 11:43:07 2010 -0700 Al Chu
+38181cf26e31a93b48e91576cc360e3d3de85e98
+
+	* make libibnetdisc default behavior to overwrite a cache
+
+Wed Jun 2 13:15:31 2010 -0700 Hefty, Sean
+e6ae86f02337167843d9e3b1011e27cb26ab8fd0
+
+	* ib/mgmt: fix build under windows stack
+
+Wed Jun 2 09:05:19 2010 -0400 Hal Rosenstock
+e8f783c5a65d1f3452b84f3a321c448c226d2bf7
+
+	* infiniband-diags/ibnetdiscover.c: Cosmetic changes
+
+Wed Jun 2 09:04:15 2010 -0400 Hal Rosenstock
+cbcde100c7eb9387aad69811f969240471b99668
+
+	* infiniband-diags/libibnetdisc/chassis.c: In group_nodes, set fabric->chassis
+
+Wed Jun 2 09:02:54 2010 -0400 Hal Rosenstock
+d6ddf46c171b2f8e38a910e75b2ff503d149450b
+
+	* infiniband-diags/libibnetdisc/chassis.c: In group_nodes, pass on all nodes
+
+Tue May 25 13:32:18 2010 -0700 Ira Weiny
+c09b93cfe52854ff8e8f2aab5177ef2c0b34e93f
+
+	* libibnetdisc: move ibmad_port out of smp_engine
+
+Mon May 24 15:45:08 2010 -0400 Hal Rosenstock
+37b6c70f7f607dd41170fee967859400ce16d553
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Fix compile warns on 32 bit archs
+
+Mon May 24 21:53:15 2010 +0300 Sasha Khapyorsky
+076189da8896da13a8f7eb9786768120ce1ed017
+
+	* infiniband-diags/vendstat: allow multiple config space records
+
+Mon May 24 21:53:15 2010 +0300 Sasha Khapyorsky
+dc7b66e6fb3353fcb4ecf4e98453f11163282d4b
+
+	* infiniband-diags/vendstat: add config space access options
+
+Mon May 24 20:37:29 2010 +0300 Sasha Khapyorsky
+1db6d9db939d76888568624d530293936c05a25f
+
+	* infiniband-diags/vendstat: code simplifications
+
+** Version: infiniband-diags-1.5.6
+
+Sat May 22 18:00:16 2010 +0300 Sasha Khapyorsky
+210775cb6cd383a19a5dadb42a9da97d83aaf118
+
+	* management: packages versions update
+
+Sat May 22 17:52:50 2010 +0300 Sasha Khapyorsky
+9c01c858ed5e6f0d1602315633206964e797ea07
+
+	* management: update shared library versions
+
+Sun Apr 25 14:04:07 2010 +0300 Eli Dorfman (Voltaire)
+92b4f4be3a69f95de4157c46132f1f0caeca929e
+
+	* opensm: Always set enabled speed and width
+
+Tue May 11 15:36:08 2010 -0700 Ira Weiny
+ae0675b483b7e8834b5163c15eead36162709b66
+
+	* ibnetdisc: Separate calls to umad and mad layer to avoid race condition on response MAD's
+
+Tue Apr 27 14:35:29 2010 +0200 sebastien dugue
+21ec4a345a6aff6993989b0e86620e62e1f4caf5
+
+	* libibnetdisc: Add grouping for Voltaire's ISR4700 switch
+
+Thu May 6 13:34:46 2010 -0500 Mike Heinz
+3eb3622ba70363c9975f3bb5a608e437508cbcd2
+
+	* RE: [PATCH] management: adding mad_dump_fields to libibmad
+
+Thu May 6 13:30:02 2010 -0500 Mike Heinz
+0176eec5b554dc9bb7a121482afe51e43b410de8
+
+	* RE: [PATCH] management: adding mad_dump_fields to libibmad
+
+Mon Apr 19 18:08:19 2010 +0300 Sasha Khapyorsky
+1a4b90a74be9ae47d51485e2ed29a18b1a1e26eb
+
+	* libibnetdisc: fix indentations
+
+Wed Apr 14 15:48:01 2010 -0700 Al Chu
+116e64efe8dd4e91a264778996f401cfb57a3497
+
+	* check for duplicate port guids in libibnetdisc cache
+
+Wed Apr 14 15:47:49 2010 -0700 Al Chu
+a4a7f4707734bf72ff5177397da661f0583ea158
+
+	* fix libibnetdisc cache error path memleak
+
+Wed Apr 14 10:48:03 2010 -0700 Al Chu
+e8cd82856a6cca259f0592bb4a6233eb0146d053
+
+	* fix libibnetdisc portguid hashing corner case
+
+Fri Apr 16 19:31:43 2010 +0300 Sasha Khapyorsky
+97161a8523e5e94da9f6bfc3fb555daf35fb3c7c
+
+	* libibnetdisc: remove not needed num_smps_outstanding counter
+
+Fri Apr 16 15:14:00 2010 +0300 Sasha Khapyorsky
+eea29a4b4d0fdd75c75595ffa2317fffc872dbf6
+
+	* libibnetdisc: remove not needed process_smp_queue() call
+
+Fri Apr 16 19:31:43 2010 +0300 Sasha Khapyorsky
+2c89899269aff81dce048ae9a6a7a5d17c1aad10
+
+	* libibnetdiscover: more outstanding MADs counting fix
+
+Fri Apr 16 15:10:30 2010 +0300 Sasha Khapyorsky
+a9989e08fbb9e69dc7d69ad7c96d289b01d22e16
+
+	* libibnetdisc: fix memory leak in case of send_smps() failure
+
+Fri Apr 9 04:48:15 2010 +0300 Sasha Khapyorsky
+c22a907d93a8eadde12f5af75a7c571454880986
+
+	* libibnetdisc: config struct for ibnd_discover_fabric()
+
+Tue Apr 13 20:41:59 2010 +0300 Sasha Khapyorsky
+60514dcb474325d3b8a99007efbe3ee522ede710
+
+	* libibnetdisc: don't query CA ports not connected to a fabric
+
+Tue Apr 13 19:54:45 2010 +0300 Sasha Khapyorsky
+0914ffdf6538c271d5de12a6db945796e03851c6
+
+	* libibnetdisc: don't try to cross discovery over CA
+
+Tue Apr 13 19:30:23 2010 +0300 Sasha Khapyorsky
+001dc72c15ee5329bba9966018c4ab84d436ce9b
+
+	* libibnetdisc: fix outstanding SMPs countung
+
+Tue Apr 13 17:54:38 2010 +0300 Sasha Khapyorsky
+7ff1e266c3f48c8f0bdf59b9e606ec538726ba3a
+
+	* libibnetdisc: add \n at end of error messages
+
+Tue Apr 13 15:48:30 2010 +0300 Sasha Khapyorsky
+a17e36656a53ca9363ef6b6b3ffb58a434c0f70c
+
+	* infiniband-diags/ibnetdiscover: cleanups
+
+Wed Apr 7 10:06:43 2010 -0700 Al Chu
+1b60fb0afd6383e94d0d626dbd10a12136f6b635
+
+	* support lid and nodedesc diffchecks in ibnetdiscover
+
+Wed Apr 7 10:06:32 2010 -0700 Al Chu
+f6d4848d3c7462c4140a4050e61b96bf9efb6924
+
+	* support --diffcheck in ibnetdiscover
+
+Wed Apr 7 10:05:38 2010 -0700 Al Chu
+90df93c4ec0e6bec20bef88de4c8bce3e0284362
+
+	* support --diff in ibnetdiscover
+
+Fri Apr 9 10:24:50 2010 -0700 Al Chu
+ee9cd9d43ef94454d93c77988efb0c3f0ec45d9e
+
+	* fix libibnetdisc corner case when user tries to re-cache a loaded cache
+
+Sat Apr 10 02:43:24 2010 +0300 Sasha Khapyorsky
+937eaaccc0f3a32a861333d5018e3fb8e35feb68
+
+	* libibnetdisc: no backward NodeInfo queries
+
+Sat Apr 10 02:16:40 2010 +0300 Sasha Khapyorsky
+b5c7dc59cebfcea80a7a853ace8d7e8316f0b689
+
+	* infiniband-diags/ibnetdiscover: report number of used MADs
+
+Sat Apr 10 02:07:07 2010 +0300 Sasha Khapyorsky
+c690e85eb3822b557bf0fefcf53f03ff403d8cfb
+
+	* libibnetdisc: keep total number of used SMPs
+
+Sat Apr 10 01:01:44 2010 +0300 Sasha Khapyorsky
+4f55f7cd7e8d45ca49c3e107607d5758c6ba3448
+
+	* libibnetdisc: restore hops limited discovery
+
+Sat Apr 10 00:14:27 2010 +0300 Sasha Khapyorsky
+baae94d9af69e246038f970a5b30ae6d8126aed8
+
+	* libibnetdisc: restore show_progress functionality
+
+Fri Apr 9 03:35:29 2010 +0300 Sasha Khapyorsky
+85e417e33d777cc515040b561eb6a5e3511e09b7
+
+	* libibnetdisc: code cleanups
+
+Tue Feb 2 14:06:03 2010 -0800 Ira Weiny
+f518fb5a780fcbec37b54803508abdc9e60e6ac3
+
+	* libibnetdisc: add ibnd_set_max_smps_on_wire call
+
+Fri Jan 22 17:33:30 2010 -0800 Ira Weiny
+089f028dcd5cf4a121a02bec80f3ca54c2e55494
+
+	* libibnetdisc: Convert to a multi-smp algorithm
+
+Tue Mar 9 12:41:15 2010 +0200 Yevgeny Kliteynik
+1226619d64fb4d6bbedba7d04ede5df497057fb6
+
+	* infiniband-diags/ibstat.c: print link layer for RoCEE support
+
+Tue Mar 9 12:37:38 2010 +0200 Yevgeny Kliteynik
+a6cc34bfbc10a93c823668b10bcc39191f044a81
+
+	* infiniband-diags/ibstatus: add link_layer for RoCEE support
+
+Thu Mar 4 15:01:44 2010 -0600 Mike Heinz
+b0caed9bb5f0d1fe80d0c66519bccaaa852e4dbd
+
+	* Perfquery can be too noisy.
+
+Thu Mar 18 18:35:34 2010 -0700 Ira Weiny
+30b8c9067ca388f9291e6298a65c077a568d2981
+
+	* infiniband-diags: Ignore PortInfo data on down port.
+
+Tue Feb 2 17:43:20 2010 -0800 Ira Weiny
+156cd056ab5ef0e69053f5bf324e1835cc67c6d9
+
+	* libibnetdisc: fix typo in man page for ibnd_show_progress
+
+Wed Feb 10 09:32:05 2010 -0500 Hal Rosenstock
+74d69f75fc9bdc72a604a05b9511b5d2dac256f7
+
+	* infiniband-diags/vendstat: Indicate general info for IS4 as well as IS3
+
+Mon Jan 25 08:32:45 2010 -0500 Hal Rosenstock
+17adabc46e41157ea8983ffc52ae16c34d29922c
+
+	* infiniband-diags/ibqueryerrors.c: Fix typo in counter name
+
+Tue Jan 19 15:47:12 2010 +0200 Sasha Khapyorsky
+ce85937be777a9686f58e37bdbbadc0f612bab0f
+
+	* infiniband-diags/iblinkinfo,ibqueryerrors: code refactoring
+
+Mon Jan 18 21:35:51 2010 -0800 Al Chu
+256269defbd56c5bc475f65488267db6e3f5c6b6
+
+	* support --load-cache in iblinkinfo and ibqueryerrors
+
+Tue Jan 12 20:56:20 2010 +0200 Sasha Khapyorsky
+6afc4b05e85c2864c48868a95d82da063676358d
+
+	* ibqueryerrors.c: more readable details dump function
+
+Thu Dec 31 14:10:54 2009 -0500 Hal Rosenstock
+f1d70f4a2a9d6f1d267c7f20b6fdcbd3a64e48a8
+
+	* infiniband-diags/ibqueryerrors: Add support for optional PortRcvErrorDetails counter
+
+Sat Jan 16 20:29:29 2010 +0200 Sasha Khapyorsky
+5d4f4bda8f0e96a407e4b5de9d38798b051604a5
+
+	* infiniband-diags: indentation fixes
+
+Fri Jan 15 10:23:16 2010 -0800 Al Chu
+3d5c94091ce0fc7da8ebf79affac67d1fc92b75b
+
+	* support --cache and --load-cache options in ibnetdiscover
+
+Fri Jan 15 10:23:13 2010 -0800 Al Chu
+01b8045f28f6c1fd6a4dd170e8a89b85e7ff1ad2
+
+	* add libibnetdisc caching to libibnetdiscover
+
+Thu Jan 14 09:13:24 2010 -0500 Hal Rosenstock
+cd383d54dba7e43a1f2de77382c6c31187571491
+
+	* infiniband-diags/perfquery: Add support for PortSamplesControl counter
+
+Wed Jan 13 15:23:18 2010 -0500 Hal Rosenstock
+c259589b1f75e4a6c8d9ea16e8ee0f71c828ac75
+
+	* infiniband-diags/ibportstate.8: Add new supported ops
+
+Thu Dec 31 11:58:34 2009 -0500 Hal Rosenstock
+eae275ce547dd148d7526974b601ccdaa03f9cd7
+
+	* infiniband-diags/perfquery: Add support for optional PortRcvErrorDetails counter
+
+Thu Nov 5 11:56:56 2009 -0800 Ralph Campbell
+b8bbcef89b68865f3fc522a2973131442ca06581
+
+	* infiniband-diags/ibportstate: allow changes to CA portinfo parameters
+
+Tue Jan 12 11:14:15 2010 +0200 Sasha Khapyorsky
+c7589c66ff78f72cf2817e6864b9c43e49dfbd52
+
+	* infiniband-diags: -V, --version: exit with zero status
+
+Tue Dec 29 09:30:49 2009 -0500 Hal Rosenstock
+a5427f83c976ae0bbeee6b4d3f7afe38bf87ee0c
+
+	* infiniband-diags/ibqueryerrors.c: Fix output format of counters
+
+** Version: infiniband-diags-1.5.5
+
+Thu Dec 24 15:14:41 2009 +0200 Sasha Khapyorsky
+a02a72e79fb350e23da731c313a281a6b0c0ca0d
+
+	* management: packages versions update
+
+Thu Dec 10 13:24:01 2009 -0800 Al Chu
+d70ab89db505c9ccaf8d0f9231cfcc6344aba038
+
+	* correct manpages for tools that are no longer scripts
+
+Thu Dec 10 11:38:38 2009 -0800 Al Chu
+2f0ba97a07db2bd307f589823fb6ffc7bbd479b7
+
+	* remove obsoleted option from iblinkinfo manpage
+
+** Version: infiniband-diags-1.5.4
+
+Sun Dec 13 19:39:11 2009 +0200 Sasha Khapyorsky
+8596afb4a92181eb2055123cbcca73715a177cf7
+
+	* management: package versions bump
+
+Sun Dec 13 19:36:19 2009 +0200 Sasha Khapyorsky
+3ef00cf4084364fd3779eb673348d525122976a3
+
+	* management: update library versions
+
+Tue Nov 17 10:17:30 2009 -0800 Al Chu
+a498f70a59397120f1799645944255d2c1f57401
+
+	* splice out chassis scan specific from general scan in libibnetdiscover
+
+Tue Nov 17 10:17:20 2009 -0800 Al Chu
+8b1d334b64a7ef7451c796268332fcf15bfc882e
+
+	* use nodes/switches lists instead of nodesdist array in libibnetdiscover
+
+Tue Nov 17 10:16:14 2009 -0800 Al Chu
+d365a61048d93cc9f65a9826d9b10f107d56150e
+
+	* remove unnecessary casting in libibnetdiscover
+
+Mon Nov 23 12:04:19 2009 +0200 Doron Shoham
+97f3fd404d39053f008e68d46c4baff8f4ce2fe1
+
+	* Add different print macros
+
+Fri Nov 13 09:52:16 2009 -0800 Al Chu
+0d3e5accc016609e7dfce6331d4d44252182ec16
+
+	* split out scan specific data from ibnd_node_t [attempt #2]
+
+Tue Nov 3 20:17:14 2009 -0800 Ira Weiny
+e51da7bd0efedd17f4252c09c833a280e08eb1df
+
+	* infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails
+
+Tue Nov 3 20:22:38 2009 -0800 Ira Weiny
+8f8736a6a6993f718ecd47c4bf3d001f68b25229
+
+	* infiniband-diags/ibqueryerrors: Change realloc of suppressed fields to a static array
+
+Tue Nov 3 19:51:32 2009 -0800 Ira Weiny
+587a6f8ce63933ca004f5fca216f7616fd64f342
+
+	* infiniband-diags/ibqueryerrors: Fix remote node name printing
+
+Fri Nov 6 10:14:24 2009 -0800 Al Chu
+190451c0b7ff164b198d999aeaaa30016bfa7793
+
+	* fix potential segfault in ibnd_node_t destroy path
+
+Fri Nov 6 10:14:21 2009 -0800 Al Chu
+a95d8789c55bd06ae62b80c4d32f889289893efd
+
+	* consistently type lids and lmcs libibnetdisc
+
+Tue Nov 10 13:51:41 2009 -0800 Ira Weiny
+10861458f2b3034262bb9a01125704d9709cc6e1
+
+	* infiniband-diags/libibnetdisc: Remove nearly duplicate "get_node_info" function
+
+Tue Nov 10 14:01:37 2009 -0800 Ira Weiny
+8ad91fd22ae4b0d1bfd504218a02899d3263b576
+
+	* infiniband-diags/libibnetdisc: clean up PortInfo queries
+
+Thu Nov 12 19:20:39 2009 +0200 Sasha Khapyorsky
+ccf687f2949256973153c38f5e34a31ecf47337d
+
+	* infiniband-diags/ibqueryerrors: minor improvements
+
+Tue Nov 3 13:58:03 2009 -0800 Ira Weiny
+8d673b478e78d5f0e4ff606f55c19f942cc8db4c
+
+	* infiniband-diags/ibqueryerrors: Reformat the output of the xmtdiscard details.
+
+Fri Nov 6 15:32:25 2009 -0500 Hal Rosenstock
+3a3734befe391e891ae18bbb925897fe6edb4a46
+
+	* infiniband-diags/saquery.c: Change lids and port numbers to decimal
+
+Fri Nov 6 10:59:00 2009 -0500 Hal Rosenstock
+e11ee0b20b01fabe91f482eb91a90e5849b824c5
+
+	* infiniband-diags/ibsendtrap.c: Add support for SysImageGuid changed trap (145)
+
+Fri Nov 6 17:54:48 2009 +0200 Sasha Khapyorsky
+b363af1580ac214dfa24662285a0b4d6a5d2fecf
+
+	* libibnetdisc: remove man page of removed API
+
+Mon Nov 2 11:33:17 2009 -0800 Al Chu
+2cc2bf56e95ba43cf1b8bdc7c2953e71976de331
+
+	* remove ibnd_update_node
+
+Tue Nov 3 17:03:15 2009 -0800 Ira Weiny
+3d44880d512c76f3494037a1973ffdf45205964d
+
+	* infiniband-diags/ibnetdisc.h: Clarify "ports" member of ibnd_node_t with more descriptive comment
+
+Wed Nov 4 09:42:19 2009 -0500 Hal Rosenstock
+b61a2910d09a09d58a0ead85dd6db5654fb89aaa
+
+	* infiniband-diags/ibqueryerrors: Add support for PortXmitDiscardDetails
+
+Tue Nov 3 10:37:29 2009 -0800 Al Chu
+abc34ab016bb8f006d394a24c2107ec08b2fab7c
+
+	* remove unused headers in libibnetdiscover
+
+Mon Nov 2 11:40:19 2009 +0200 Eli Dorfman (Voltaire)
+84377df7ce7146b1bf6d9d702bd29d509e8b1d37
+
+	* infiniband-diags/saquery: Report SA MAD Class specific status.
+
+** Version: infiniband-diags-1.5.3
+
+Sun Nov 1 21:55:47 2009 +0200 Sasha Khapyorsky
+0b1c91a77dec80e2d2c39e3f6484f095c0d41175
+
+	* management: bump package versions
+
+Sun Nov 1 21:42:56 2009 +0200 Sasha Khapyorsky
+8baf219009567aacb067764323d006cbbd9f69f7
+
+	* management: update libraries version information
+
+Mon Nov 2 02:09:14 2009 +0200 Sasha Khapyorsky
+edb6c696d5570ed77da48fda8813b1d79604261d
+
+	* management: update/add Voltaire copyright
+
+Fri Oct 30 00:49:36 2009 +0200 Sasha Khapyorsky
+929e69b5de0b131d66ab15356e2dd386b870e81c
+
+	* infiniband-diags/perfquery: merge some code
+
+Wed Sep 23 09:29:43 2009 -0400 Hal Rosenstock
+3b0b12cd867006e2e918b9a97b6721dfb5025fed
+
+	* infiniband-diags/perfquery: Add support for optional PortXmitDiscardDetails counter
+
+Thu Oct 29 23:34:27 2009 +0200 Sasha Khapyorsky
+d557de94aa4ca0f4fdaca8948d49e37cbae215e2
+
+	* libibnetdisc: some cleanups
+
+Thu Oct 29 23:11:29 2009 +0200 Sasha Khapyorsky
+80c220bd2c8fe3c8abb8b9d10a23b1377d744fbb
+
+	* libibnetdisc: rename ibnd_scan variable to scan
+
+Wed Oct 28 16:52:11 2009 -0700 Al Chu
+9e92e25de600c088034351c83088e6a4e5d8cc11
+
+	* remove 'dist' field from ibnd_node_t, which was virtually not used
+
+Wed Oct 28 16:52:09 2009 -0700 Al Chu
+29003140079845c69888622ababf200e424fdf5f
+
+	* split out ibnd_fabric_t fields that are only used during a scan
+
+Tue Oct 27 10:22:36 2009 -0700 Ira Weiny
+2d237d0b99560b44f41ce8716a39edc31abdf7e6
+
+	* infiniband-diags/ibqueryerrors: Use remap'ed node name in clear port error message
+
+Fri Oct 23 13:57:46 2009 -0400 Hal Rosenstock
+7107a106aeb0a283da875e7bbe955b3e4c28f781
+
+	* infiniband-diags/ibqueryerrors.c: Cosmetic changes
+
+Wed Oct 14 09:44:35 2009 +0530 Keshetti Mahesh
+609e037c3723bc759293ec9c343969daf236a8fc
+
+	* infiniband-diags/libibnetdisc: Removed trivial comments
+
+Fri Oct 23 18:20:59 2009 +0200 Sasha Khapyorsky
+fb9503355addb8e01b0903ba2fab21ec7f98fc1a
+
+	* infiniband-diags/ibqueryerrors.c: use common node_name
+
+Fri Oct 23 17:08:29 2009 +0200 Sasha Khapyorsky
+7a0d07dc019b206b8c98e85bf10707fa0dd8fec1
+
+	* infiniband-diags/ibqueryerrors.c: use common portid in query_cap_mask()
+
+Fri Oct 23 17:02:22 2009 +0200 Sasha Khapyorsky
+2aca4b06068a049781387d240a85f468cf9b8633
+
+	* infiniband-diags: minor cosmetic fixes
+
+Fri Sep 25 09:33:58 2009 -0700 Ira Weiny
+21b42954dceeb4924b7f4e57c37250b3bdcd7f0b
+
+	* infiniband-diags/src/ibqueryerrors: Add clear errors and counters options
+
+Wed Oct 7 10:35:25 2009 -0700 Ira Weiny
+de9d8f08fc127f09e6f3825686806f59b5c821b4
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: fix bug in single node processing.
+
+Tue Oct 13 09:04:54 2009 -0400 Hal Rosenstock
+65f305cc51d07aa53437e961b43f69005361d0a8
+
+	* infiniband-diags/saquery.c: Modify dump_path_record
+
+Tue Sep 29 14:22:46 2009 +0200 Sasha Khapyorsky
+642160c80693b4f8fd038e04dd728da1431734dc
+
+	* infiniband-diags/ibqueryerrors: simplify node_type_to_print setup.
+
+Wed Sep 23 11:38:11 2009 -0700 Ira Weiny
+e426d5b7f495550f28b558917eae074bea75600f
+
+	* infiniband-diags/src/ibqueryerrors.c: Remove --all option and replace it with --switch, --ca, --router
+
+Wed Sep 23 14:26:55 2009 -0700 Ira Weiny
+c92b21e9a15fbdabc7f37b986cb036276f02e939
+
+	* infiniband-diags/src/ibqueryerrors.c: fix bug when attempting a sub-fabric scan
+
+Tue Sep 22 19:59:36 2009 -0400 Hal Rosenstock
+a74d1210266cc8aca0169f5a1e9b43bbf7673948
+
+	* infiniband-diags/ibportstate.c: Eliminate uninitialized variable compile warning
+
+Mon Sep 14 12:59:33 2009 +0200 sebastien dugue
+f80eefd7c31e0c511794d582d05611fb30f83be4
+
+	* infiniband-diags/ibnetdiscover: Add separator when printing chassis type
+
+Sun Sep 13 19:23:13 2009 +0300 Doron Shoham
+59d05a9509ae337b7d5786c0970dce88a4fa9b1a
+
+	* ibportstate: fixes for width option
+
+Tue Sep 8 18:11:37 2009 -0400 Hal Rosenstock
+0987cc1e8cbdc683838794429d873b07d72a7077
+
+	* infiniband-diags/ibportstate: Support changing of link width
+
+Wed Sep 16 09:12:14 2009 +0530 Keshetti Mahesh
+31710227062002f12b1c2b2ca51878f98e6d7bcb
+
+	* 'ibcheckportwidth' : Exit if LWS is 1X
+
+Tue Sep 15 17:09:29 2009 +0530 Keshetti Mahesh
+d8b07f4ca62f6167698e83a8afcef08d424ffa44
+
+	* infiniband-diags/: Cosmetic changes, mostly typos
+
+Mon Aug 31 19:45:44 2009 +0300 Sasha Khapyorsky
+fe9319b87d22f139b0c6c58c364b0c4c0974b0ba
+
+	* infiniband-diags/ibroute: minor flow optimization
+
+Sun Aug 30 12:32:07 2009 -0400 Hal Rosenstock
+127ddeb0b59f9996d45fba20175b844b466a7342
+
+	* infiniband-diags/ibroute: Add support for MulticastFDBTop
+
+Sun Aug 30 15:39:33 2009 +0300 Sasha Khapyorsky
+946624a269122d579c7bdd52dc80596c83384e7f
+
+	* libibnetdisc: fix compilation warning
+
+Wed Aug 26 09:25:00 2009 -0700 Ira Weiny
+c0d2f74c6f8ac227f9eecffd4905fe60b73e3a20
+
+	* libibnetdisc: add retract_dpath function
+
+Fri Aug 21 15:01:00 2009 -0700 Ira Weiny
+b50abf9bbca002a79aa4b80327cd42c8287ea74c
+
+	* infiniband-diags/libibnetdisc: add missing '\n' to error message
+
+Sun Aug 30 15:29:24 2009 +0300 Sasha Khapyorsky
+4e7655c49bc612215b379f3f171490c0f20be123
+
+	* infiniband-diags/perfquery: indentation fixes
+
+Wed Aug 26 12:12:23 2009 -0400 Hal Rosenstock
+7400343098e38dc9a22b80914a803a30bd6aeae0
+
+	* infiniband-diags/perfquery.c: Indicate whether PortXmitWait counter is supported
+
+Wed Aug 26 17:37:30 2009 +0300 Eli Dorfman (Voltaire)
+1ddb09cf33e08068e813f4fb7038c6addadea3b2
+
+	* Fix IB network discovery from switch node.
+
+Mon Aug 17 14:03:38 2009 -0700 Ira Weiny
+2180add45e2b95ea69d0c14eb09d609b637b0e14
+
+	* libibnetdisc: make all fields of ibnd_fabric_t public
+
+Sun Aug 16 07:02:24 2009 -0400 Hal Rosenstock
+4bf42172903fa14c6c21eea125623434bdfb3ccc
+
+	* infiniband-diags/saquery.c: Allow pkey and qkey to be hidden
+
+Sat Aug 15 09:46:24 2009 -0400 Hal Rosenstock
+12504d1532991c680212eacd3af1cbfa995c9f88
+
+	* infiniband-diags/saquery.c: Fix CHECK_AND_SET_VAL macro
+
+Thu Aug 13 19:54:00 2009 -0700 Ira Weiny
+efbce75536679fe07c4dd2f9e9cc494a26c2cd9f
+
+	* libibnetdisc: make all fields of ibnd_port_t public
+
+Sun Aug 16 13:22:09 2009 +0300 Sasha Khapyorsky
+fb94a681aaa1d56e69fe9975b07b0ca05c9be14b
+
+	* libibnetdisc: fix again typo in dump_node()
+
+Tue Aug 11 15:15:21 2009 -0700 Ira Weiny
+d6f2d1fd279f39fd0243a1e10c13ef9ed1950db2
+
+	* libibnetdisc: make all fields of ibnd_node_t public
+
+Fri Aug 14 10:52:49 2009 -0400 Hal Rosenstock
+32c65e163cf4ca64b4db4adb68afb5962d3c1d23
+
+	* infiniband-diags/saquery.c: Fix typo in option name
+
+Fri Aug 14 13:15:03 2009 +0300 Sasha Khapyorsky
+832b9162b84741f9288f0427a24c1a06493f7f60
+
+	* infiniabnd-diags: indentation fixes
+
+Fri Aug 14 04:40:54 2009 +0300 Sasha Khapyorsky
+898ffb9f282e1cc1de5a0d17ede549383a4733e7
+
+	* infiniband-diags/ibportstat.c: simplify conditions
+
+Fri Aug 14 04:36:24 2009 +0300 Sasha Khapyorsky
+ea58a37aac5158be2b8a2d7b267eef29e0469956
+
+	* infiniband-diags/ibportstate.c: consolidate flows
+
+Thu Aug 13 15:37:50 2009 +0300 Sasha Khapyorsky
+4e0fb746fa86be7badb067d5f75b92dc362885e4
+
+	* libibnetdisc: indentation fixes
+
+Thu Aug 13 15:25:50 2009 +0300 Sasha Khapyorsky
+0c033c2da354c20afe805d3f3f145b6c867180a5
+
+	* libibnetdisc/ibnetdisc.c: typo fix
+
+Wed Aug 12 16:53:20 2009 -0700 Ira Weiny
+676bd9f565fb6a8ab72cdc77c03ccf734a1b6917
+
+	* infiniband-diags/libibnetdisc: remove all IBPANIC's and clean up error handling
+
+Fri Aug 7 09:05:44 2009 -0700 Ira Weiny
+db808b6ecfab52fbeb75816092263033de96d307
+
+	* libibnetdisc: fix potential memory leak of port object
+
+Wed Aug 5 10:29:31 2009 +0300 Sasha Khapyorsky
+cf5922b9bd38f545ef33963fd32896ca25f4b04e
+
+	* infiniband-diags/ibsendtrap.c: code consolidation
+
+Wed Aug 5 10:24:32 2009 +0300 Sasha Khapyorsky
+7c5b3323b29f25e6baaac7934d4f540e41b5eb11
+
+	* infiniband-diags/ibsendtrap.c: fix array size
+
+Tue Aug 4 08:50:09 2009 -0400 Hal Rosenstock
+4b78754846dfe7ebd0ee86d074b4c6662d657e7f
+
+	* infiniband-diags/ibsendtrap.c: Add support for link_speed_enabled_change trap
+
+Mon Aug 3 16:39:57 2009 -0400 Hal Rosenstock
+395d4d003d63fa5005c4418bf3c6055ca80705be
+
+	* infiniband-diags/ibsendtrap.c: Fill in capability mask on trap 144
+
+Mon Aug 3 15:22:56 2009 +0300 Sasha Khapyorsky
+9d60102edae3f9dbfe20686aa6df34e1219e9504
+
+	* infiniband-diags/man: break long lines
+
+Sun Aug 2 20:15:32 2009 -0400 Hal Rosenstock
+17b317ae81ec6999c608f81b422159bc4194fe11
+
+	* infiniband-diags/ibnetdiscover.8: Add max hops option
+
+Sun Aug 2 10:55:37 2009 +0300 Sasha Khapyorsky
+fbc728662320140a66db48bded71c7e1a3d94949
+
+	* infiniband-diags/ibnetdiscover: remove not used var
+
+Mon Jul 27 10:13:01 2009 -0700 Al Chu
+dfbb9603f8f87c5709573f6f031da256153f9e02
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:59 2009 -0700 Al Chu
+3eb0af51f36c75691afbd46e1a8eca2d86143cf3
+
+	* fix libibnetdisc API consistency and bugs
+
+Sat Aug 1 02:59:50 2009 +0300 Sasha Khapyorsky
+5d06b65f612802565e7fc7cf1bf8fc84f3d96806
+
+	* bibnetdisc/ibnetdisc.c: fix parameter incompatibility warning
+
+Mon Jul 27 10:12:51 2009 -0700 Al Chu
+8092614f5309ed111516dde50bd3390a611d155b
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:41 2009 -0700 Al Chu
+3fa0a9d8db3430fa7e21b1d528db85ab6833639b
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:36 2009 -0700 Al Chu
+47323f3b253593863a3862c18b3ffb4c0aa42e89
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:32 2009 -0700 Al Chu
+a150500a3451689bf0eb82203762e8dad4c07522
+
+	* fix libibnetdisc API consistency and bugs
+
+Thu Jul 30 18:40:12 2009 -0700 Ira Weiny
+ab70ff96ebf87a63c0dc1aaeb947ababb2125d5e
+
+	* infiniband-diags/libibnetdisc: fix DBGFLAGS variable
+
+Mon Jul 20 08:58:47 2009 -0400 Hal Rosenstock
+a6fbe5f00a3331bf79fc28c37f3d648ec0bb3cc5
+
+	* infiniband-diags/ibtracert.c: Fix linearcap test in switch_lookup
+
+Tue Jul 7 15:24:26 2009 -0700 Al Chu
+b0e2e5c901f342c7813ac91486e474afd2a65204
+
+	* libibnetdisc cleanup patches
+
+Thu Jul 16 09:32:38 2009 -0400 Hal Rosenstock
+5dd30ca90a66cd77d6653deefedffc0cbeac651f
+
+	* infiniband-diags/ibroute.c: Fix typo in IBWARN message
+
+Thu Jul 16 09:31:58 2009 -0400 Hal Rosenstock
+b26200734f13cdb2c7d2f1e4d7acc39599b849e7
+
+	* infiniband-diags/ibtracert.c: Fix comparison to SwitchInfo.MulticastFDBCap in switch_mclookup
+
+Tue Jul 14 13:28:52 2009 -0400 Hal Rosenstock
+7937993a10638a8d57b80506f040a6cd1ec0413f
+
+	* infiniband-diags/README: Update saquery dependencies
+
+Tue Jul 14 04:26:20 2009 +0300 Sasha Khapyorsky
+c91986c7f354065c42ce70f2dc9fee59d1c73bce
+
+	* infiniband-diags/libibnetdisc: add man pages to EXTRA_DIST
+
+Thu Jul 9 15:39:15 2009 -0400 Hal Rosenstock
+ba92f994d43a360cb7fa47d6976e370e9471a005
+
+	* infiniband-diags/ibroute.c: Fix format and typo in printf
+
+Tue Jul 7 06:43:57 2009 +0300 Sasha Khapyorsky
+579be1dbd8096f4b42faae75c4070057a614a105
+
+	* libibnetdisc/Makefile.am: add internal.h to SOURCES list
+
+Wed Jun 24 18:22:14 2009 -0700 Ira Weiny
+3123b272c1d3a7e06223bedd5a9cdcc2be7cfa61
+
+	* iblinkinfo, ibqueryerrors: clean up ibdiag_process_opts call
+
+Tue Jun 23 13:29:19 2009 -0700 Ira Weiny
+c2a119da5ef4f2c99c07a5e7230812ab038717da
+
+	* ibprintca.pl: fix corner case: print switch information for CA's found at the end of the cache file.
+
+Wed Jun 24 17:52:37 2009 -0700 Ira Weiny
+314008b45efea52c471e5e0ec86dadc47cba698f
+
+	* ibqueryerrors: optomize -D operation
+
+Thu Jun 18 14:07:13 2009 -0700 Ira Weiny
+2df69c8f20a57ac4ccc501f447fc70e7e3dc8cb4
+
+	* iblinkinfo: optomize -D operation
+
+Thu May 14 17:24:29 2009 -0700 Ira Weiny
+9da2a098863c6633bd9d4a7f48446593904e77a8
+
+	* ibqueryerrors: fix custom opts string
+
+Thu May 14 17:23:22 2009 -0700 Ira Weiny
+ab82af39c6b7376739d7c813cd6dba7522405745
+
+	* iblinkinfo: convert to ibdiag_process_opts
+
+Thu May 14 16:39:52 2009 -0700 Ira Weiny
+1b6b85aba85ed0a9249ffcb33ee3c4c9d262ee11
+
+	* iblinkinfo: remove unused file pointer.
+
+Thu May 14 15:52:42 2009 -0700 Ira Weiny
+5d6a05b24c6116759a45e4a7fa5632b940682bd0
+
+	* iblinkinfo, ibqueryerrors: prevent core when switch is not found
+
+Wed May 13 09:30:20 2009 -0700 Ira Weiny
+8022ccc98bc83cb59a08cc8ce3a621a80cd7ed91
+
+	* ibnetdiscover: only report max hops discovered when requested
+
+Thu Jun 4 11:08:27 2009 -0700 Ira Weiny
+443ef9a59d4447d7753e0dc7ddeaec167932c8c8
+
+	* Move _with_node_name_map rpm spec option from infiniband-diags to opensm.
+
+Mon Jun 8 13:03:01 2009 +0300 Eli Dorfman (Voltaire)
+76f74f789656dac2707f0f34933b76955cbac368
+
+	* infiniband_diags/ibportstate.c perform reset in a single mad
+
+Wed Jun 3 17:12:56 2009 +0300 Eli Dorfman (Voltaire)
+9d832c6596bf1ad50814aa3533f4e8706a03404f
+
+	* infiniband-diags: Do not change port state on SubnSet
+
+Fri May 29 15:31:12 2009 -0400 Hal Rosenstock
+dbb68b43fd64ae30f013e929dc9e06c9a9c9ee12
+
+	* infiniband-diags/ibdiag_common.c: Eliminate compile warning on x86_64 archs
+
+Wed May 27 11:08:10 2009 -0700 Sean Hefty
+4348825c9a1f964f17d0d06eeefc600b81de0a3f
+
+	* ib-mgmt/libibnetdisc: fix typecast warning
+
+Sun May 10 14:30:13 2009 +0300 Doron Shoham
+71a382ef541de82fe1aec80dcc6aac0a972859b3
+
+	* saquery: fix -c arguement
+
+Wed May 6 09:53:03 2009 -0700 Ira Weiny
+3917867db504d6aefbe7ca27bcbd3ac5507c8a55
+
+	* Clean up printing of switch heading when printing "down links" only.
+
+Wed May 6 09:51:14 2009 -0700 Ira Weiny
+ce9635bda568014f391a6bd2aa165115004c4161
+
+	* Fix 2 formatting diff's from old ibqueryerrors.
+
+Tue Apr 28 16:38:38 2009 -0700 Ira Weiny
+e5c1b9659adf803bd01bf908a52be5ea374e1307
+
+	* Modify '-S' option of iblinkinfo and ibqueryerrors to do a limited scan of the
+
+Wed May 6 09:33:47 2009 -0700 Ira Weiny
+c6f03b72633aff494ac0572ae7bf051d854fff90
+
+	* Add combined routing support to libibnetdisc
+
+Mon May 4 15:49:49 2009 -0700 Sean Hefty
+750c7d1ee5c4850a9533dbd003e6873d1e0a8c53
+
+	* ib-mgmt: fixup ibsendtrap for windows
+
+Fri May 1 22:47:51 2009 +0300 Sasha Khapyorsky
+4f784b38fb9628e35a2a0b1378b6e530206f7aff
+
+	* ibstat.c: use htohl() for 32-bit capmask conversion
+
+Mon May 4 15:17:32 2009 -0400 Hal Rosenstock
+03b311f8a46a7d9c88c176480de807e29866107b
+
+	* infiniband-diags/ibnetdiscover.c: Cosmetic formatting changes
+
+Mon May 4 12:58:09 2009 +0200 Nicolas Morey-Chaisemartin
+984b98326378702e50dffb854cc72853274cd700
+
+	* infiniband-diags: Added libibnetdiscover to .spec file
+
+Mon Apr 27 14:17:53 2009 -0400 Hal Rosenstock
+0b33c91abdb02403764ca2e4d889a1d14b2d4bac
+
+	* infiniband-diags/saquery.c: Display attribute ID in hex rather than decimal
+
+Mon Apr 27 12:59:05 2009 +0200 Nicolas Morey-Chaisemartin
+bfc1992705db38f2fda331d3cd0ce4acd48aa277
+
+	* management: Fixed custom_release in SPEC files
+
+Mon Apr 27 14:50:26 2009 -0700 Ira Weiny
+24741af2301ae8aa2772a35c405212ede4c0a6c8
+
+	* ibqueryerrors: switch_guid_str is required for the string resolve function.
+
+Sat Apr 25 20:10:59 2009 +0300 Sasha Khapyorsky
+76e4fb8b76d1ab240728c5c7bfa7d94a4d803469
+
+	* ibdiag_common: remove duplicated ibdebug variable
+
+Sat Apr 25 19:51:06 2009 +0300 Sasha Khapyorsky
+466fbe3e786598904e7cad9cb99abe7ea81f69f5
+
+	* infiniband-diags: remove not used ibnetdiscover.h
+
+Sat Apr 25 14:36:43 2009 +0300 Sasha Khapyorsky
+0d0c89063dfe8d5ef8ec9ac836e48c8a7d1008bb
+
+	* infiniband-diags: cosmetic fixes
+
+Thu Apr 23 10:57:10 2009 -0700 Ira Weiny
+bff90d580d150cab5f741400fce88ce244cd1ddf
+
+	* Convert ibqueryerrors.pl to C and use new ibnetdisc library.
+
+Wed Apr 22 18:54:46 2009 -0700 Ira Weiny
+5d5734e58b6f73bb1ab7810a63c7ca32b7dfb5cf
+
+	* libibnetdisc: change ibnd_discover_fabric to receive ibmad_port
+
+Sat Apr 25 15:00:13 2009 +0300 Sasha Khapyorsky
+0d1e27e38285e242d438ff6a658363821e583135
+
+	* ibnetdiscover: fix types to avoid portability castings
+
+Tue Apr 21 12:06:42 2009 -0700 Sean Hefty
+b0b97a684d0133c30571b4e16bc0d31a56bdc446
+
+	* ib-mgmt/ibn3 branch: libibnetdisc add windows support
+
+Tue Apr 21 12:02:18 2009 -0700 Sean Hefty
+3ef7d3de4ebcd6519899b51e4b1b17c0007c180b
+
+	* ib-mgmt/ibn3 branch: diags updated for continued windows support
+
+Thu Apr 23 10:57:10 2009 -0700 Ira Weiny
+51401a3ed834f5369dc0c98f134db75a2b6e8ee0
+
+	* Convert ibnetdiscover to use new ibnetdisc library
+
+Thu Apr 23 10:57:10 2009 -0700 Ira Weiny
+339cf92d36a47c2c50727d5ab1c3fd03c409d3fc
+
+	* clean up iblinkinfo conversion
+
+Fri Apr 3 15:42:54 2009 -0700 Ira Weiny
+392a032eda0243931d2b82b8bc8174293ba11e44
+
+	* Convert iblinkinfo.pl to C and use new ibnetdisc library.
+
+Fri Apr 3 15:42:51 2009 -0700 Ira Weiny
+a626de1abde7223348ed88474e168c3e68f86565
+
+	* Create a new library libibnetdisc
+
+** Version: infiniband-diags-1.5.2
+
+Sun Apr 26 17:05:13 2009 +0300 Sasha Khapyorsky
+186fa39842b64785eb572a69ddeddc5613419782
+
+	* management: bump package versions
+
+Sat Apr 25 20:10:59 2009 +0300 Sasha Khapyorsky
+bbee6691e502306397f7be2593293a0baaa90c40
+
+	* ibdiag_common: remove duplicated ibdebug variable
+
+Sun Apr 19 06:32:41 2009 -0400 Hal Rosenstock
+a9acc85489ea27649d726f338a044cc989d5b173
+
+	* infiniband-diags/man/vendstat.8: Indicate IS4 config group config not persistent across IS4 reboot
+
+Sat Apr 18 09:11:36 2009 -0400 Hal Rosenstock
+34fe5e885707ccf06fb77086a849d0d73a485ae4
+
+	* infiniband-diags/ibsendtrap.c: Set producer type according to node type
+
+Thu Apr 16 09:01:45 2009 -0400 Hal Rosenstock
+668fb55fc9cb98c1242ff1f7e7305fd6d9c2362e
+
+	* infiniband-diags/man/vendstat.8: Fix PortXmit/RcvDataSL examples
+
+Wed Apr 15 19:38:30 2009 +0300 Sasha Khapyorsky
+8b8a9f0cf5cdae9a0d2552d4d8e5742d10ba385d
+
+	* infiniband-diags/perltidy.sh: option to format a single file
+
+Fri Apr 3 16:02:49 2009 -0700 Ira Weiny
+e34a45c85df471dc11a43107dabe1cf6186bf422
+
+	* Fix ibidsverify.pl to use the correct cache file
+
+Wed Apr 15 09:05:18 2009 -0400 Hal Rosenstock
+02e69153449f8ed17b3b98a8754734f9a5058d7d
+
+	* infiniband-diags/ibsendtrap.c: Local link integrity is an "urgent" trap
+
+Tue Apr 14 15:11:18 2009 +0300 Sasha Khapyorsky
+347e4ffb4d8297ce656cc1daa6ced0e2a4bd9afe
+
+	* infiniband-diags/ibsendtrap: code consolidation
+
+Mon Mar 16 11:20:38 2009 +0200 Julia Volynsky
+441ece311d51c8a30d27a7b45dc176c98fd23534
+
+	* Added send trap for trap 129 (local link integrity)
+
+Wed Apr 8 11:04:45 2009 -0400 Hal Rosenstock
+6c2a373455e37c3488bc0f90e8ab0b3a6ffa1f16
+
+	* infiniband-diags/vendstat: Update man page and examples for PortXmit/RcvDataSL counter support
+
+Tue Mar 24 03:09:15 2009 +0200 Sasha Khapyorsky
+c73f168ca22d40cabb3bb88e827bfb077080cf05
+
+	* infiniband-diags/vendstat.c: code moving
+
+Thu Mar 19 14:27:25 2009 +0200 Or Gerlitz
+c10e955f68414381d81c5400559281cbf14e1283
+
+	* ib-diag/vendstat: counter-group-info & config-counter-group vendor mads
+
+Fri Mar 20 18:12:22 2009 -0500 Hal Rosenstock
+fc3d02c9871820f35a34b331046b1fa81b055291
+
+	* infiniband-diags/perfquery.8: Fix typo in short option for PortXmitDataSL counters
+
+Fri Mar 13 15:37:18 2009 -0500 Hal Rosenstock
+71113b0100ad0236abdc1bfa4868a89b47387880
+
+	* infiniband-diags/perfquery.c: Label PortXmit/RcvDataSL counters in headings
+
+Thu Mar 12 11:38:56 2009 -0500 Hal Rosenstock
+9e2416c1e1bf0b95db675844e7d4592db8cb1115
+
+	* infiniband-diags/perfquery.8: Extended counters are now -x rather than -e
+
+Wed Mar 11 08:29:19 2009 -0500 Hal Rosenstock
+90ef4ffcf239cd82e88a5cbccefb60356be8d250
+
+	* infiniband-diags/vendstat.c: Add missing mad_rpc_close_port call
+
+Tue Mar 10 17:50:01 2009 -0500 Hal Rosenstock
+21478a728ef32a4863866c18e52b64306a86ec73
+
+	* infiniband-diags/perfquery.c: Fix some memory leaks on exit
+
+Tue Mar 10 15:50:23 2009 -0500 Hal Rosenstock
+680bafcf16c7b34c58a20af4b08350d07767dc81
+
+	* infiniband-diags/perfquery.8: Update man page for PortXmit/RcvDataSL
+
+Wed Mar 11 12:43:47 2009 +0200 Sasha Khapyorsky
+52c956f91512ded86a2c072074d07269d870128b
+
+	* libibmad: add mad_rpc_class_agent() call
+
+Mon Mar 9 13:53:21 2009 -0700 David A. McMillen
+05d7a879e3e59675a80c8250a1f53c53cf1766ee
+
+	* infiniband-diags/ibnetdiscover: Apply --node-name-map remapping to names printed by --ports option
+
+Mon Mar 9 18:01:02 2009 +0200 Or Gerlitz
+c236d1f91b9e6cccc3c30aec2dfcf050f0ac792a
+
+	* infiniband-diags/perfquery: add srcport param
+
+Fri Feb 20 14:45:29 2009 -0800 Ira Weiny
+9ef2ac0417237d757875a31572274be3f9a90f08
+
+	* infiniband-diags: convert ibnetdiscover to "new" ibmad interface
+
+Thu Feb 19 18:53:10 2009 -0800 Ira Weiny
+37a39ee80e8d59ed3c3ee1f0d6dddddbed20708a
+
+	* infiniband-diags: Convert perfquery, saquery, sminfo, smpquery, and vendstat to "new" ibmad interface
+
+Thu Feb 19 18:24:56 2009 -0800 Ira Weiny
+a76c09bc5779dad91e44e862ba48bf9ad63455e7
+
+	* infiniband-diags: Convert mcm_rereg_test to "new" ibmad interface
+
+Thu Feb 19 18:14:49 2009 -0800 Ira Weiny
+b34db7fbae6f36db0d426019df64a289b894a293
+
+	* infiniband-diags: Convert ibsysstat to "new" ibmad interface
+
+Thu Feb 19 17:58:36 2009 -0800 Ira Weiny
+20a6a5bbd9b0faed3d36a4e02cc00a576df08d3e
+
+	* infiniband-diags: Convert ibtracert to "new" ibmad interface
+
+Thu Feb 19 17:53:30 2009 -0800 Ira Weiny
+be317ec69458e453b7c13aba7adef1bdba770d96
+
+	* infiniband-diags: Convert ibsendtrap to "new" ibmad interface
+
+Thu Feb 19 17:30:14 2009 -0800 Ira Weiny
+63205b22834d97de1135647198d26655882a4a34
+
+	* infiniband-diags: Convert ibroute to "new" ibmad interface
+
+Thu Feb 19 17:27:21 2009 -0800 Ira Weiny
+37808bc670ef219c12d1aab22e30582babd5da4d
+
+	* infiniband-diags: Convert ibportstate to "new" ibmad interface
+
+Fri Mar 6 10:48:08 2009 -0800 Ira Weiny
+481279ff94de844a99ecd7c88f11365bad495c8d
+
+	* infiniband-diags: Convert ibaddr to "new" ibmad interface
+
+Fri Feb 27 13:46:53 2009 -0500 Hal Rosenstock
+45131fc051fc69fb3190a895345c15e57bb5c13f
+
+	* opensm/infiniband-diags: Changes for C rather than C++ style comments
+
+Mon Mar 2 11:35:54 2009 +0200 Or Gerlitz
+aa877e7dbd691589bfd45ddfc032514c08831580
+
+	* infiniband-diags: update configure.in check for libibmad API
+
+Sun Mar 1 14:41:51 2009 +0200 Or Gerlitz
+08775eda007eab489247542cb492663f7aea1f63
+
+	* perfquery PortXmtDataSL/PortRcvDataSL support
+
+Sun Mar 1 14:39:48 2009 +0200 Or Gerlitz
+3116fb5902642fb8cebbfb1c2f64c5a8cb3a7eb2
+
+	* generic libibmad perf query/reset api
+
+** Version: infiniband-diags-1.5.1
+
+Sat Feb 28 18:50:54 2009 +0200 Sasha Khapyorsky
+d5f23acbcbfe8ee51818ab364007d5b0a7387d01
+
+	* management: bump all package versions
+
+Fri Feb 27 10:34:19 2009 +0200 Sasha Khapyorsky
+1cb94c303b0a195d766e1d0eb39d87c18425cd4c
+
+	* infiniband-diags/ibroute: fix warning
+
+Thu Feb 26 13:08:23 2009 -0800 Sean Hefty
+bf861ff2118831d99231e2458132571ec30a01aa
+
+	* [ib-diag] saquery: add support for WinOF
+
+Thu Feb 26 12:33:49 2009 -0800 Sean Hefty
+9cb8cf81780c66e529bb275f180d1b734694031c
+
+	* [ib-diags] saquery: set correct pkey table field
+
+Thu Feb 26 12:22:04 2009 -0800 Sean Hefty
+d8b1999aee4635f6522947bb4bf036799d5869c9
+
+	* [ib-diag] ibsysstat: add support for WinOF
+
+Thu Feb 26 10:12:23 2009 -0800 Sean Hefty
+aaf13343ee26d4c5e597ddf69a8e3b2341291b98
+
+	* [ib-diag] mcm_rereg_test: add support for WinOF
+
+Thu Feb 26 10:12:19 2009 -0800 Sean Hefty
+3bc107e9c72908bbd51ebaf29389f142e3da72e9
+
+	* [ib-diag] ibsendtrap: add support for WinOF
+
+Thu Feb 26 10:11:58 2009 -0800 Sean Hefty
+02b7f2ed3e52cbaa39f1d6033a76b970b42ce949
+
+	* [ib-diag] ibtracert: add support for WinOF
+
+Thu Feb 26 10:10:58 2009 -0800 Sean Hefty
+9b59ad68b2b1976d5c1111531f3f3aacf867d2ab
+
+	* [ib-diag] ibroute: add support for WinOF
+
+Thu Feb 26 09:48:58 2009 -0800 Sean Hefty
+f3cf4703a3c421657ccd2a6a0a5cc6807bf5dd2f
+
+	* [ib-diag] ibnetdiscover: add support for WinOF
+
+Fri Feb 20 16:59:38 2009 -0500 Hal Rosenstock
+8f526856100acd3206ae7c268bb0cadc9c6a7088
+
+	* infiniband-diags/saquery.c: Convert more LID prints to unsigned decimal
+
+Wed Feb 18 12:19:32 2009 -0500 Hal Rosenstock
+1f6243a43bb429a50e3453178e9b456763cc78ef
+
+	* infiniband-diags/smpdump.c: Release umad resources on exit
+
+Wed Feb 18 10:55:37 2009 -0500 Hal Rosenstock
+cf6e7dcf310786a51deac8191df5a4307c2d5a3d
+
+	* infiniband-diags/smpdump.c: Fix usage examples
+
+Sun Feb 22 06:19:44 2009 -0600 David McMillen
+b75064b33c4faa157a0efb52d6498fa905fed4ff
+
+	* infiniband-diags/src/ibnetdiscover.c missing LID information on --ports
+
+Wed Feb 18 10:00:21 2009 -0800 Sean Hefty
+99225e635ae4a1abeb4f33185c394bc6f40d5db9
+
+	* smpquery: add support for WinOF
+
+Tue Feb 17 16:05:45 2009 -0800 Sean Hefty
+d82c0b8f7bad0f618ddcc19644f196e4fc6e8879
+
+	* ibping: add support for WinOF
+
+Tue Feb 17 14:36:20 2009 -0800 Sean Hefty
+7dbf78d97d95da1ad7769b8ed97496f0f56f55c2
+
+	* smpdump: add support for WinOF
+
+Tue Feb 17 14:35:40 2009 -0800 Sean Hefty
+799a70838ebae1519f6cdc6980327988a3e59057
+
+	* ibstat: add support for WinOF
+
+Tue Feb 17 14:33:09 2009 -0800 Sean Hefty
+61fb971b57dffbc10f83f51e28b4a67fb0c581cb
+
+	* ibportstate: add support for WinOF
+
+Tue Feb 17 14:32:38 2009 -0800 Sean Hefty
+518d5459663cb7367afac4e2255aa759d48b9889
+
+	* perfquery: add support for WinOF
+
+Tue Feb 17 14:32:05 2009 -0800 Sean Hefty
+43524e038a5fd95339fd5c43e2fedc32ac76c8f4
+
+	* ibaddr: add support for WinOF
+
+Tue Feb 17 14:31:31 2009 -0800 Sean Hefty
+0524c25610ea927053d7bf1144d1b06e7b969a80
+
+	* vendstat: add support for WinOF
+
+Tue Feb 17 14:30:54 2009 -0800 Sean Hefty
+43e6dfa72170309ef5f20100ec1119abdb2e2327
+
+	* sminfo: add support for WinOF
+
+Sat Feb 14 17:19:02 2009 +0200 Sasha Khapyorsky
+8219070572684307a500347ca0220e1b79640a5b
+
+	* infiniabnd-diags/common: wrap debug macros with do {} while (0)
+
+Wed Feb 11 18:37:24 2009 +0200 Sasha Khapyorsky
+68daa74daf262ee17cabf3a019348c7def662e3c
+
+	* infiniband-diags: some code consolidation
+
+Wed Feb 11 04:53:46 2009 +0200 Sasha Khapyorsky
+f2920cc66f525850f61d4ceaf87e05db8fab17cf
+
+	* infiniband-diags/saquery: fix types and some cleanup
+
+Wed Feb 11 02:11:30 2009 +0200 Sasha Khapyorsky
+ce8e82d5d53e698bf3ca41eb7295b8a19038dc72
+
+	* infiniband-diags/saquery: remove osm vendor layer
+
+Thu Feb 5 17:00:02 2009 -0700 Hal Rosenstock
+f13f0a25f22e1c9f2ad0e10bda830b83d0edcb80
+
+	* infiniband-diags/perfquery: Change option name for extended counters
+
+Thu Feb 5 20:18:10 2009 +0200 Sasha Khapyorsky
+6079cc21e9df4851ed5fe2a7e474642cd7b7ee78
+
+	* infiniband-diags/common: use enum MAD_DEST as ibd_dest_type type
+
+Fri Jan 30 15:51:05 2009 +0200 Sasha Khapyorsky
+5b6ba15dd1dfd5c0664cb3b4f820c10828b9add7
+
+	* infiniband-diags/saquery: merge PathRecord query functions
+
+Wed Jan 28 20:23:02 2009 +0200 Sasha Khapyorsky
+2305370eccc5891d310fa3b42c93a5257b390d18
+
+	* infiniband-diags/saquery: more params for Path and MCMember Records
+
+Wed Jan 28 20:23:02 2009 +0200 Sasha Khapyorsky
+db4dd2cbe5131ef240307cdf5df9c4031ed90376
+
+	* infiniband-diags/saquery: adding query params
+
+Thu Jan 29 14:34:45 2009 +0200 Sasha Khapyorsky
+d85205d7c14697b9777d13da39b1137f0db07636
+
+	* infiniband-diags/saquery: CHECK_AND_SET_VAL() macro
+
+Thu Jan 29 13:24:59 2009 +0200 Sasha Khapyorsky
+21de45df81e77ac214e355cf7f6861f83b2fc59f
+
+	* infiniband-diags/saquery: cosmetic
+
+Thu Jan 29 14:42:55 2009 +0200 Sasha Khapyorsky
+6d2909c11245777ce44e5b5716c6dc3c877b6a92
+
+	* infiniband-diags/saquery: fix encoding of SA queries
+
+Wed Jan 28 20:10:06 2009 +0200 Sasha Khapyorsky
+b2191875823de79245cbd6105307d98780f45d6b
+
+	* infiniband-diags/smpdump: fix SL value encoding
+
+Wed Jan 28 15:14:07 2009 +0200 Sasha Khapyorsky
+2e11ae51da524bffa49434e1aea1fc471f2a42b3
+
+	* infiniband-diags/saquery: fix backward compatibility bug
+
+Tue Jan 27 14:36:02 2009 +0200 Sasha Khapyorsky
+e478ef0b30fd7b7a889c1afb7d94553de15e4693
+
+	* infiniband-diags/ibsysstat: backward compatibility fixes
+
+Mon Jan 26 23:03:29 2009 +0200 Sasha Khapyorsky
+7d1b0a3d6aca0c5f96f3354a9e4a3ef40b25f300
+
+	* infiniband-diags/ibsysstat: use RMPP for client/server communication
+
+Mon Jan 26 16:35:51 2009 +0200 Sasha Khapyorsky
+a58765c29649fbf8ae8868e161a4285438c0bd95
+
+	* infiniband-diags/saquery: add lid parameter to NodeRecord query
+
+Mon Jan 26 10:49:43 2009 +0200 Sasha Khapyorsky
+c5f90ddff99b8d8e6a63bd8a248ff9ab1ec160b6
+
+	* infiniband-diags/smpquery: usage improvement
+
+Sat Jan 24 11:19:30 2009 +0200 Sasha Khapyorsky
+f1db964fd7316ac1900545078524f0ee5f71620a
+
+	* infiniband-diags: remove unneeded includes
+
+Sat Jan 24 10:50:50 2009 +0200 Sasha Khapyorsky
+cff14be7d5daa56c11177769ea736a654fc94869
+
+	* infiniband-diags: make get_build_version() static
+
+Sat Jan 24 10:11:08 2009 +0200 Sasha Khapyorsky
+0628026b304becf2c46ccc9ac7b30b02fafa2219
+
+	* infiniband-diags: remove argv0 global variable
+
+Sat Jan 24 00:31:01 2009 +0200 Sasha Khapyorsky
+3ccf4d576c28854a2c40237179f39185f2c1b5d3
+
+	* infiniband-diags: using common command line option processing
+
+Sat Jan 24 00:31:01 2009 +0200 Sasha Khapyorsky
+cd5a13772d750e8828e48fd1e921d972894c8d68
+
+	* infiniband-diags: command line option processing framework
+
+Sun Jan 25 11:45:03 2009 +0200 Sasha Khapyorsky
+591081b4ca2fe3d60e08545d4148e2ef68b6665e
+
+	* infiniband-diags/dump_mfts.sh: fix -D format parsing
+
+Sun Jan 25 11:45:03 2009 +0200 Sasha Khapyorsky
+26680730ec79303a32f0950dc3b6733172a9cd61
+
+	* infiniband-diags/dump_lfts.sh: fix -D format parsing
+
+Sat Jan 24 00:12:28 2009 +0200 Sasha Khapyorsky
+1fa3b32eba4218ab0fdce5a101624b007a82aad3
+
+	* infiniband-diags/ibdiag_common: cleanup argv0 prototype
+
+Sat Jan 24 00:06:11 2009 +0200 Sasha Khapyorsky
+7ea0dba08aaf94830e5ebabc83eb8ec5add689bb
+
+	* infiniband-diags/smpdump.c: use common ib definitions
+
+Thu Jan 22 22:32:34 2009 +0200 Sasha Khapyorsky
+bc4d17133d6677cec5e87079f5918e23ba81959f
+
+	* infiniband-diags: remove duplicated ibdebug prototype
+
+Thu Jan 22 15:00:58 2009 +0200 Sasha Khapyorsky
+40061e8db2192d7731f54bd12317e18def7f0062
+
+	* infiniband-diags/ibdiag_common: move get_build_version()
+
+Thu Jan 22 14:57:11 2009 +0200 Sasha Khapyorsky
+383afee5b334a83cce7030c8ce592b34439ab56e
+
+	* infiniband-diags/ibdiag_common: cosmetic
+
+Thu Jan 22 14:46:25 2009 +0200 Sasha Khapyorsky
+20bf9d37f8181acc0bac3aa8bbb41f275027c90e
+
+	* infiniband-diags/Makefile.am: use common library
+
+Thu Jan 22 14:37:11 2009 +0200 Sasha Khapyorsky
+e1ea13aa0655ab431677505823d5ba28dafff02e
+
+	* infiniband-diags/Makefile.am: merge CFLAGS
+
+Thu Jan 22 14:32:35 2009 +0200 Sasha Khapyorsky
+4318758cbb23f3e8a7136cc0efcc9345f590a982
+
+	* infiniband-diags/Makefile.am: kill -rpath
+
+Tue Jan 20 13:29:25 2009 +0200 Sasha Khapyorsky
+c002711719cc7e83210d4a8b3fe05f349e9d8bb2
+
+	* infiniband-diags/perfquery.c: fix typo
+
+Tue Jan 13 16:56:57 2009 +0200 Eli Dorfman (Voltaire)
+7dd16a49f1934d9912a7699bde63744b961564ff
+
+	* infiniband-diags support PortXmitWait get and set
+
+Mon Jan 5 14:31:07 2009 +0200 Sasha Khapyorsky
+69743b5082ed4bc11e211ae3081dbbb4f2feae81
+
+	* infiniband-diags/perfquery: indentation fixes
+
+Mon Dec 22 02:26:31 2008 +0200 Sasha Khapyorsky
+7e2d9e40c5d0d4d52056d6c17d65c3c9161aff79
+
+	* management: remove libibcommon dependencies
+
+Mon Dec 22 00:24:30 2008 +0200 Sasha Khapyorsky
+c01c74074db2e9c170f67969c020363fb3500f41
+
+	* management: move sysfs()_* function to libibumad
+
+Sun Dec 21 17:28:25 2008 +0200 Sasha Khapyorsky
+916e7571b49953360bc28fc53e0e1345c7fd5f3f
+
+	* infiniband-diags/ibstat,smpdump: kill unused includes
+
+Thu Dec 18 23:45:42 2008 +0200 Sasha Khapyorsky
+0a7b21b279f6221b9e0629c9d23c1185ab323948
+
+	* infiniband-diags/saquery: minor indentation fixes
+
+Sat Dec 13 22:46:56 2008 +0200 Sasha Khapyorsky
+656614a4a7a92765db698fa2c5a8a87f905473c3
+
+	* infinabd-diags: convert type uint -> unsigned int
+
+Fri Dec 12 17:30:25 2008 +0200 Sasha Khapyorsky
+75990408ac7cc42fede93581543caa7d63984de3
+
+	* infiniband-diags/saquery: PortInfoRecord query
+
+Fri Dec 12 16:11:52 2008 +0200 Sasha Khapyorsky
+07d702886ff10bc984e2cb1a0b509d67579ecee6
+
+	* infiniband-diags/saquery: separate queries and commands
+
+Wed Dec 10 19:50:35 2008 +0200 Sasha Khapyorsky
+4e858dc99c87fe68a2edfcdf0886fa5ae33dd6e1
+
+	* infiniband-diabs/saquery: unify SA queries processors
+
+Wed Dec 10 16:12:44 2008 +0200 Sasha Khapyorsky
+7fd2c792e433f53630f4055c0816f142296d8670
+
+	* infiniband-diags/saquery: indentation fixes
+
+** Version: infiniband-diags-1.5.0
+
+Sat Dec 13 19:46:15 2008 +0200 Sasha Khapyorsky
+f0ce6ce0c60165e80003c3e62ea07d399e7c8e06
+
+	* management: bump all package versions
+
 ** Version: infiniband-diags-1.4.4
 
 Sun Dec 7 00:16:36 2008 +0200 Sasha Khapyorsky
-b6d92f16d846bf55528502e3fa77429d3277fad5
+bbf5ee9cfbc23930530d105799c7fc8f6bf892fd
+
+	* management: update package versions
+
+Wed Nov 26 12:51:30 2008 +0200 Sasha Khapyorsky
+ed48f26b346d449a14927463edd7a4b2da9ec3ac
+
+	* infiniband-diags/grouping: add 10G IP router devid
+
+** Version: infiniband-diags-1.4.3
+
+Tue Nov 18 06:20:46 2008 +0200 Sasha Khapyorsky
+cbd77598741234f36af5f7ab6bd1915951151967
+
+	* management: update versions
+
+Sun Nov 16 11:37:31 2008 -0700 Hal Rosenstock
+abeb73d092aa649b9f4b9ba1c967276be4b3b15b
+
+	* infiniband-diags/ibstat.c: Use UMAD_MAX_DEVICES define
+
+Sun Nov 16 14:23:10 2008 +0200 Sasha Khapyorsky
+4949d1fc818c6d5e09c7e5507ed3d7d879dcccbf
+
+	* infiniband-diags/ibstat.c: remove casting
+
+Fri Nov 14 14:54:06 2008 -0800 Ira Weiny
+485d94520e2aa762f6d7f878e6372bf2397f56fe
+
+	* Fix max parameter passed to umad_get_cas_names
+
+** Version: infiniband-diags-1.4.2
+
+Sun Oct 19 20:53:23 2008 +0200 Sasha Khapyorsky
+46f65ae24efbbe01e50d192df5aad52ce2d3e1af
+
+	* management/*/configure.in: bump all versions
+
+Wed Oct 8 12:28:44 2008 +0200 Sasha Khapyorsky
+bfe012a31e6661439aa605449ec06f6e660f85d8
+
+	* management: update Voltaire copyright
+
+Sun Oct 19 08:54:32 2008 -0600 Hal Rosenstock
+8daa6f9b0cc008fc9d8b3b87c3c1e8b3b30c5497
+
+	* infiniband-diags/saquery.8: Update saquery man page
+
+Sun Oct 19 08:54:30 2008 -0600 Hal Rosenstock
+9def498100790ad773d7a94123f33217fa7acd8c
+
+	* infiniband-diags/saquery: Support MFTRecord
+
+Sun Oct 19 01:13:15 2008 +0200 Sasha Khapyorsky
+32fa8fcc642590f37a8c8197dc87886f1be3dfea
+
+	* infiniband-diags/saquery: add LFT Record handling
+
+Fri Oct 17 13:04:39 2008 -0400 Doug Ledford
+2d556cd0fcc73fdb63e0cc5dfe979b7598378ac8
+
+	* Trivial: update usage info for ibaddr.c in infiniband-diags-1.4.1
+
+Wed Oct 8 12:28:44 2008 +0200 Sasha Khapyorsky
+1b6e86e26f819ea40ca23bd0837ff71b84ab3e16
+
+	* management: add Voltaire copyright
+
+Sat Oct 11 22:02:38 2008 +0200 Sasha Khapyorsky
+80b3f33f1dede4d201146beb969a95459aaf2049
+
+	* infiniband-diags/perfquery: fix constant size warning
+
+Fri Oct 10 16:03:05 2008 -0700 Al Chu
+54f611b91bd7999378d3bddcb06f8e5614b5f396
+
+	* infiniband-diags/perfquery: if -a is specified loop through ports if required and aggregate output
+
+Fri Oct 10 15:58:20 2008 -0700 Al Chu
+12b8d91501e1088619aac720ee12f6be1aaaf836
+
+	* perfquery code cleanup
+
+Fri Oct 10 16:35:43 2008 -0700 Al Chu
+01f93e42ccc6c9953197641eb04b236a54d1d7be
+
+	* infiniband-diags/perfquery: if --loop_ports is specified always loop through all ports if desired
+
+Fri Oct 10 15:57:45 2008 -0700 Al Chu
+e7b0a62d9afd5a5958a7aea50a1114577e5f6ada
+
+	* infinibanf-diags/perfquery: remove single port CA AllPortSelect workaround
+
+Fri Oct 10 15:57:02 2008 -0700 Al Chu
+c77bfecaaf332c6e48ebe93a4561db9bb10005c9
+
+	* infiniband-diags/perfquery: error out if AllPortSelect is not supported
+
+Fri Oct 10 15:56:54 2008 -0700 Al Chu
+3e83004adec8fb54b4a39e04870c646a222f9084
+
+	* tweak notes about port 255 in perfquery manpage
+
+Fri Oct 10 15:56:46 2008 -0700 Al Chu
+d7730efcb0f152f42439508a96be43af8ef84c88
+
+	* infiniband-diags/ibclearerrors: specify -a in call to perfquery
+
+Wed Oct 8 17:40:52 2008 -0700 Al Chu
+88fe58c5987874f876a647fb1580f8dec8b7f5f3
+
+	* infiniband-diags/perfquery: fix comments
+
+Wed Oct 8 17:40:51 2008 -0700 Al Chu
+0ee221d5c169096cba8f5c9841d71a2d631d976d
+
+	* infiniband-diags/perfquery: support ehanced port 0 with --loop-ports
+
+Mon Sep 29 14:25:01 2008 -0600 Hal Rosenstock
+7193fae14dbd197ebc0679aa44184376c387fe7f
+
+	* infiniband-diags/ibsysstat.c: Fix a couple of latent bugs
+
+Tue Oct 7 15:54:05 2008 -0700 Al Chu
+c56710398f5c90d7c28d0f9d83eef0531518fb30
+
+	* add --loop_ports option to perfquery
+
+Tue Oct 7 15:38:51 2008 -0700 Al Chu
+b6d240c2e30128f15e51af75c1678e7442b3db9e
+
+	* add more detail to error message on perfquery workaround
+
+Tue Oct 7 15:38:27 2008 -0700 Al Chu
+d2409b5673e1e9608054462c12224bf90bd155f6
+
+	* use 0xff vs. 255 consistently in perfquery
+
+Tue Oct 7 15:38:17 2008 -0700 Al Chu
+adbbf1e9e88ec646f36e0f06326a2e8ff4fc8c9f
+
+	* add clarification in perfquery manpage
+
+Wed Sep 24 16:59:23 2008 +0300 Jack Morgenstein
+8e6f693a356cd76669efc28009207307b78b5155
+
+	* infiniband-diags: eliminate compiler warnings
+
+Sat Sep 13 04:07:54 2008 +0300 Sasha Khapyorsky
+372998d988c22c1fbfbc44465c56f9d995c6b513
+
+	* infiniband-diags/ibtracert: fix port by direct path resolving
+
+Fri Sep 12 22:07:56 2008 +0300 Sasha Khapyorsky
+f959ff0a5c134761d04c427502539449bb85961e
+
+	* man/ibtracert: remove non-existing -e option
+
+Fri Sep 12 22:03:42 2008 +0300 Sasha Khapyorsky
+251ddae270fb411db838cb04cbe82faaa194bd38
+
+	* infiniband-diags/ibclearcounters: remove unrelated -N option
+
+Fri Sep 12 21:49:19 2008 +0300 Sasha Khapyorsky
+ad37a027ceac3923378dca830130a5de73456503
+
+	* man/ibnetdiscover: cleanup non-existing options
+
+Fri Sep 5 15:47:16 2008 -0700 Ira Weiny
+8a09e0bfdf2aa9e5f939247bfe7a18f6656f9a6b
+
+	* ibnetdiscover.c: continue processing other ports even if smpquery fails on one port
+
+Mon Aug 18 15:46:51 2008 -0700 Ira Weiny
+cf7517aafac9a7fbd441edb08e00151b62cad091
+
+	* Fix some missing node name map substitutions
+
+Thu Jul 24 07:05:05 2008 +0300 Sasha Khapyorsky
+be288b2384a6ace9dff1fe39d95c9fe97afa89f6
+
+	* infiniband-diags/src/ibaddr.c: remove unused variables
+
+Thu Jul 10 17:44:08 2008 -0700 Ira Weiny
+10f82e3df67d5000c029caa218097f174724b9c5
+
+	* infiniband-diags/src/ibaddr.c: convert GID prints to use inet_ntop
+
+Thu Jul 24 07:00:51 2008 +0300 Sasha Khapyorsky
+779d2b88d7bca5e5799ad613c8fd14b295dbcfe7
+
+	* infiniband-diags/saquery: remove unused variable
+
+Thu Jul 10 17:44:07 2008 -0700 Ira Weiny
+2fd9b7f64327d1bdb10bebbace3b9e4740edfa52
+
+	* infiniband-diags/src/saquery.c: convert GID prints to use inet_ntop
+
+** Version: infiniband-diags-1.4.1
+
+Tue Jul 8 07:22:02 2008 +0300 Sasha Khapyorsky
+e43349f373da5275259d095df21696d666feab7f
+
+	* management: bump management versions
+
+Mon Jul 7 14:12:58 2008 -0700 Hal Rosenstock
+ab61af409d8d99f56d4bd8b04e46110da224d7d7
+
+	* infiniband-diags/mcm_rereg_test.c: Cosmetic formatting change
+
+Sun Jul 6 23:07:38 2008 +0300 Sasha Khapyorsky
+91671f93e01d199d8ff9f0047b79910317f174ec
+
+	* management: revert configure.in update configure.in on 'make dist'
+
+Mon Jun 30 15:11:29 2008 -0700 Al Chu
+66862733a42d0d425306a866cb6856cc83e31c0a
+
+	* Fix regenerate cache corner case.
+
+Sun Jun 29 17:20:23 2008 +0300 Sasha Khapyorsky
+b1178b0dbcaaa15edb8d5dbc54cfbb5d00ee4005
+
+	* infiniband-diags: fix snprintf() usage
+
+Thu Jun 12 22:38:02 2008 +0300 Sasha Khapyorsky
+60e7e24ecd223ab4ad37b3399e37638b09e46655
+
+	* infiniband-diags/saquery: split print_multicast_group_records() function
+
+Tue Jun 10 13:18:03 2008 -0700 Ira Weiny
+8e33e60e86f5d01d3db519df6f6866f0e73a0b61
+
+	* infiniband-diags/src/saquery.c: fix potential core dump
+
+Tue Jun 10 11:12:31 2008 -0700 Hal Rosenstock
+bbeed16b0a5d5d00d4ea7986ff4ee874d45e0623
+
+	* infiniband-diags/saquery.c: In print_multicast_group_records, only query NodeRecords when needed
+
+Sun Jun 8 13:17:50 2008 -0700 Hal Rosenstock
+2e5e1e6ea1b4e3dcacce899399f1979d6e879d53
+
+	* infiniband-diags/saquery.c: In dump_results, use query_result rather than query_svc_rec
+
+Thu Jun 5 19:12:51 2008 -0700 Ira Weiny
+7ab6e63cf28eaaa8dac4dcd0a55dff1f7a92695f
+
+	* infiniband-diags/src/ibnetdiscover.c: Fix the PortInfo data on the port we discover a switch on.
+
+Sun Jun 8 07:14:42 2008 +0300 Sasha Khapyorsky
+98dcc64c4628c5335f1f0a41532de9caffd0f5c0
+
+	* infiniband-diags/man/saquery: add --smkey option to the man page
+
+Thu May 22 16:50:39 2008 +0300 Sasha Khapyorsky
+ac99fcb8367da5baf8078b6012aeb41a9ffe92f5
+
+	* saquery: --smkey command line option
+
+Thu Jun 5 12:51:53 2008 -0700 Hal Rosenstock
+9ea58ce81448c61db2a79e719f5b9bb056c1ba5f
+
+	* infiniband-diags/ibsendtrap.c: Support CA and port num
+
+Thu Jun 5 12:51:49 2008 -0700 Hal Rosenstock
+3a0ccf24cf3e83ca13cf70e015d167be70675ced
+
+	* infiniband-diags/mcm_rereg_test.c: Handle error when guid file not found
+
+Tue Jun 3 06:01:28 2008 -0700 Hal Rosenstock
+1562103b9f3ce6aee323c6ae5dc4fc37c2f03197
+
+	* infiniband-diags/saquery.c: Update for change to osm_mad_pool_init API
+
+Thu May 29 06:22:52 2008 -0700 Hal Rosenstock
+7b08c94b4113e3951c5f73e52d49360dfcf440e5
+
+	* management: Support separate SA and SM keys as clarified in IBA 1.2.1
+
+Sun Jun 1 19:48:17 2008 +0300 Sasha Khapyorsky
+327fb32649f89740bbfb215882c860d0b42ba422
+
+	* infiniband-diags/scripts/*.pl: prevent some zero exists on errors
+
+Sun Jun 1 19:47:22 2008 +0300 Sasha Khapyorsky
+89544a6d93b76d344ac897a6812ce59bddd2c331
+
+	* infiniband-diags/scripts/*.pl: exit 2 on usage errors
+
+Wed May 21 16:48:28 2008 -0700 Matthias Blankenhaus
+95a60ca0020e76753d5d6b359939a3162aad1426
+
+	* saquery: port selection problem
+
+Wed May 28 17:59:41 2008 -0700 Ira Weiny
+90df7e65ee4ae6528984bb9fd8b81132a4e79598
+
+	* infiniband-diags/scripts/ibprint[ca|switch|rt].pl: allow printing of multiple matches but print warning to user that multiple matches were found
+
+Wed May 28 17:57:19 2008 -0700 Ira Weiny
+a061013fab2ad036b312112934dd935143a8b3bb
+
+	* infiniband-diags/scripts/ibprint[ca|switch|rt].pl: fix printing by name
+
+Thu May 1 15:50:45 2008 -0700 Ira Weiny
+4ec25884064a0a5c1e9bcd02188bf1b857449a2a
+
+	* infiniband-diags/scripts/iblinkinfo.pl: fix printing of switch name when port 1 is down.
+
+Sun May 11 15:37:11 2008 +0300 Yevgeny Kliteynik
+34f90df7e623b9eea858dae1171584457074a558
+
+	* infiniband-diags/Makefile.am: fix location of ibdiag_version.h
+
+** Version: 1.6.1
+
+Mon Jul 30 16:20:55 2012 -0400 Ira Weiny
+f1fa20e2bec8d5866a60bda99dd62e292d2dd616
+
+	* infiniband-diags: update README and configure.in for 1.6.1 release
+
+** Version: 1.6.0-7chaos
+
+Tue Jul 24 20:24:59 2012 -0400 Ira Weiny
+938dba3d880781e4516d5a460d86940952c651a2
+
+	* update META
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+c93a3d68dde4b90860ed325cd52a042593950852
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+862373f9432c8ff2637e3326915824fcfa1709e0
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+** Version: 1.6.0-6chaos
+
+Tue Jul 24 14:55:59 2012 -0400 Ira Weiny
+2f73c5bfeb0d88a243a380e315863310308d5c05
+
+	* tag for next release
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+eacf29e1f9794cdc5e1890cf1e3ae5c35eb6a85d
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+b0a08a5e43503b4860e1c50d1a6f96fe99876289
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+a79222f62cadb5cbce4d8e605e64d03db9dc8adb
+
+	* infiniband-diags: add libibfabricconf
+
+Thu Oct 27 00:16:23 2011 -0700 Ira Weiny
+0533c41918e4f0b93529da185c3b70e3bb75a021
+
+	* Add META for chaos build bot
+
+Mon Jul 23 16:45:33 2012 -0700 Albert Chu
+6356b648e83fac8a20a6678dc5949ae86e40f257
+
+	* infiniband-diags: Fix command line parsing bug in ibccconfig, ibccquery, saquery, and smpquery.
+
+Thu Jul 12 10:35:13 2012 +0000 Hal Rosenstock
+e72ca56743022f8005d7c93c940ca8a028974590
+
+	* infiniband-diags/vendstat.c: Commentary change
+
+Wed Jul 11 14:05:37 2012 +0000 Hal Rosenstock
+370f2330dc55a7dd25f2d465d44ca82ad071721c
+
+	* infiniband-diags/perfquery.c: Fix compile warning
+
+Tue Jul 10 15:24:33 2012 +0000 Daniel Klein
+9ccd4685ba61d9cb3a7f29a8e87f0f2b694eaf4a
+
+	* Subject: [PATCHv2] infiniband-diags/vendstat: updated devices supporting extended fw info
+
+Sun Jul 8 17:49:37 2012 +0000 Hal Rosenstock
+3b22454dffaa0207d3f5ed935266571476b450fe
+
+	* infiniband-diags: Support MLNX ExtendedPortInfo for ConnectIB device
+
+Thu Jul 5 12:45:20 2012 -0400 Hal Rosenstock
+4e3a9074b69e41166089d4a3772aa585dc29987d
+
+	* iblinkinfo: fix no port 0 info segmentation fault
+
+Thu Jul 5 14:25:50 2012 -0400 Hal Rosenstock
+1b78dc56302a00070d06257be124e9c17835145a
+
+	* mcm_rereg_test.c: Fix a couple of output messages
+
+Thu Jul 5 12:42:53 2012 -0400 Hal Rosenstock
+b18dbe3725f0e75f7ca09cd95b8968322856d503
+
+	* ibnetdiscover: fix not showing FDR10 speeds
+
+Thu Jun 28 13:13:07 2012 -0400 Hal Rosenstock
+1d88102ec41667b839273f69beb64816a72a3680
+
+	* infiniband-diags/ibnetdiscover: fix no port 0 info segmentation fault
+
+Fri Jun 1 15:44:46 2012 -0700 Ira Weiny
+30cdb87ebb2018cacfd577b32394e1f3e898a664
+
+	* infiniband-diags: saquery avoid a potential seg fault in libibmad
+
+Thu May 31 17:48:04 2012 -0700 Ira Weiny
+370ee066a1d4ee5bb59786df7ab717486efa9870
+
+	* infiniband-diags: update README for 1.6.0 release
+
+Thu May 31 16:59:12 2012 -0700 Ira Weiny
+47e95f6b97c338afad38571e7b03231d63d53b22
+
+	* infiniband-diags: udpate smp documentation in infiniband-diags page
+
+Tue May 29 20:54:33 2012 -0700 Ira Weiny
+8dbb41ce333e37b3a52b52bbd9febc9d6b9cbb0e
+
+	* infiniband-diags: Add SMP/QP0 usage explanation to general man page
+
+Thu May 31 15:10:54 2012 -0700 Ira Weiny
+9ca4c0369b6fd1266f50105c07ec7f85db9e8c7a
+
+	* infiniband-diags: saquery clarify default smkey option value
+
+Wed May 30 15:15:14 2012 -0700 Jim Foraker
+a27e2e1683cb7ce3d1cc55b1055c2a8fb0695e16
+
+	* infiniband-diags: Add SA smkey option to config file
+
+Wed May 30 15:14:20 2012 -0700 Jim Foraker
+1ff0e5182fbec725e14c7101e1f9848c278202ab
+
+	* ib-diags/saquery: Fix smkey handling
+
+Wed May 30 10:21:35 2012 -0700 Jim Foraker
+c361d33cb57a2c942ffa4bbcd3a1dcf08f05b45c
+
+	* infiniband-diags: Add m_key option to config file
+
+Wed May 30 10:21:34 2012 -0700 Jim Foraker
+32a72dd3ea0efbe09579d0ee806d298614d0d722
+
+	* infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits
+
+Thu May 31 12:11:33 2012 -0700 Jim Foraker
+ced1cd4758638468329392099ee82c6f2650ea0c
+
+	* infiniband-diags: Allow specification of an mkey to use on the command line
+
+Wed May 30 10:21:32 2012 -0700 Jim Foraker
+05de760798b5ee0e249b540543d4282a2a2a0d4a
+
+	* infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits
+
+Wed May 30 10:21:31 2012 -0700 Jim Foraker
+a259b9a0d6e7aa53d4013db69126c54a1e83cf7d
+
+	* infiniband-diags: install config file mode 400
+
+Wed May 30 10:21:30 2012 -0700 Jim Foraker
+546ecba50dcb1b24b5fb64e7e1fc947e4d0c2192
+
+	* infiniband-diags: Obfuscate sensitive output by default
+
+Wed May 30 10:09:02 2012 -0700 Jim Foraker
+91277f7a31489a12de94d17bca4f5c7f373616ff
+
+	* infiniband-diags: clean up exclude arguments to ibdiag_process_opts()
+
+Tue May 29 10:04:03 2012 -0700 Hal Rosenstock
+42a7b27865250af8ae87564a66e9fcd5f71dadbe
+
+	* infiniband-diags/ibportstate.c: Remove an extra space from warning message
+
+Thu May 24 13:42:29 2012 -0400 Hal Rosenstock
+c7c22d109e3b690e4c38e95fe4590115ca07dc44
+
+	* infiniband-diags/ibportstate.c: Add newly added options to usage
+
+Tue May 15 15:52:26 2012 -0700 Ira Weiny
+4d1fab57d2a572dfbd0370b1e0cac5ccfea8ac67
+
+	* infiniband-diags: fix autogen with new rst documentation
+
+Thu May 3 17:13:32 2012 -0700 Ira Weiny
+5f8679d4959904e2f7f890fb35885076cdec460f
+
+	* infiniband-diags: move man/check_lft_balance,ibcacheedit,ibstatus,ibidsverify to rst documentation
+
+Thu May 3 14:20:56 2012 -0700 Ira Weiny
+09627e978bb0a7dc99f4bb7cac677dfef592b90a
+
+	* infiniband-diags: move man/saquery,vendstat,ibsysstat,ibfindnodesusing to rst documentation
+
+Thu May 3 09:48:39 2012 -0700 Ira Weiny
+15bea0d4bbb28df87ef813788324b819ef30bf41
+
+	* infiniband-diags: move man/perfquery,sminfo,smpdump,smpquery to rst documentation
+
+Wed May 2 17:01:34 2012 -0700 Ira Weiny
+7bdba73a18dbd23874de51a53ead53f5ab3fedc2
+
+	* infiniband-diags: move man/ibportstate,ibstat,ibroute,ibtracert to rst documentation
+
+Wed May 2 11:27:32 2012 -0700 Ira Weiny
+71634f0a6acb6a93bdd5fb70b1ce7d5a00c1ff81
+
+	* infiniband-diags: move man/ibping,ibnodes,ibhosts,ibswitches,ibrouters to rst documentation
+
+Wed May 9 14:41:50 2012 -0700 Ira Weiny
+c8c9818dfd3f2ea2ae3a9d19e4e0cb539504f5c9
+
+	* infiniband-diags: move man/ibcc[config|query] to rst documentation
+
+Wed May 9 14:39:08 2012 -0700 Ira Weiny
+2a81766b7dae22878dbc973060ff34226c3bffcd
+
+	* infiniband-diags: move man/dump_[ml]fts to rst documentation
+
+Wed May 9 14:30:22 2012 -0700 Ira Weiny
+818ed87d906b0d5c5c989316aae58a12ee866401
+
+	* infiniband-diags: convert documentation from nroff to rst
+
+Wed May 9 14:13:57 2012 -0700 Ira Weiny
+3bca843a80bfaed68a9ccd3d9585339ad47d531a
+
+	* infiniband-diags: check_lft_balance.pl remove unused options
+
+Fri May 4 12:08:57 2012 -0700 Ira Weiny
+6de4c35dd109e60882d733c155254adff08f62bd
+
+	* infiniband-diags: ibidsverify exit status 1 on errors found
+
+Fri May 4 11:51:58 2012 -0700 Ira Weiny
+c8cba00f39ef38cb74db984700d69e09bc16d52a
+
+	* infiniband-diags: fix ibidsverify portguid validation.
+
+Fri May 4 10:34:30 2012 -0700 Ira Weiny
+97f0f6b09fd10a4a4c9956c72bc305e7478b2632
+
+	* infiniband-diags: move ibidsverify man page to main rpm
+
+Fri May 4 09:20:20 2012 -0700 Ira Weiny
+990917642e047966174101aefad9535d380437f4
+
+	* infiniband-diags: move deprecated scripts to "compat" rpm
+
+Wed May 2 16:13:19 2012 -0700 Ira Weiny
+b4cfdf3dc688008cf8471a27f7525ef768413047
+
+	* infiniband-diags: update ib[hosts|switches|routers] to standard options
+
+Thu May 3 10:26:58 2012 -0700 Ira Weiny
+d5181ea92be7d2a422b22fed7abcbb796d6ed0cf
+
+	* infiniband-diags: smpdump fix option 'string'
+
+Wed May 2 17:26:07 2012 -0700 Ira Weiny
+b04f511198d9f6f37edd79582ad6f71e993dc187
+
+	* infiniband-diags: remove -u common option
+
+Fri Apr 27 15:53:15 2012 -0700 Ira Weiny
+a4cedde4bbb7699558aa00d83ed24f14c94ea265
+
+	* infiniband-diags: remove SMI class registration where possible
+
+Fri Apr 27 14:33:30 2012 -0700 Ira Weiny
+5748256b13a3a1d24ee28e85e5eb233ce5db586b
+
+	* infiniband-diags: remove mad.h from ibstat
+
+Mon Apr 30 17:27:57 2012 -0700 Albert Chu
+7ed1cf6a1b82ed8877ca7f26f0165ac46325cd55
+
+	* infiniband-diags ibcconfig: Update documentation examples
+
+Thu Apr 26 14:43:13 2012 -0700 Albert Chu
+71c07674356f2fdf93187430908cbb501a1ee6ec
+
+	* infiniband-diags/src/ibccquery.c: Fix CACongestionSetting inputs
+
+Mon Sep 26 16:47:21 2011 -0700 Ira Weiny
+7cdad904b8d846cf3958a779561ede8bc59b5d05
+
+	* infiniband-diags: move deprecated scripts to "compat" rpm
+
+Wed Apr 20 23:30:27 2011 -0700 Ira Weiny
+c670c59cecbdbfc0f3fbc1afdecf312f21e771d3
+
+	* infiniband-diags: mark duplicate/lower performing scripts as deprecated.
+
+Wed Apr 18 09:01:21 2012 -0400 Hal Rosenstock
+d5df2450a1b6da5bb5bdc64123ba7a6da28a92f4
+
+	* infiniband-diags/vendstat.c: Support IS4/SX firmware version info
+
+Tue Apr 17 10:55:13 2012 -0700 Ira Weiny
+3ff5a791fe4235d39aca591bf2ac056b7e8f9fc3
+
+	* infiniband-diags: preserve long_opts global for use in ibdiag_show_usage
+
+Thu Apr 12 18:09:45 2012 -0700 Jim Foraker
+288234aad813f218049fbfe0e3b0b25ee8f83f69
+
+	* infiniband-diags: migrate resolve_portid_str in from libibmad
+
+Thu Apr 12 18:09:44 2012 -0700 Jim Foraker
+16f11b35f0cd961e8dc8c6dabd155f2dca024833
+
+	* infiniband-diags: Remove dependencies on ib_resolve_smlid/ib_resolve_self
+
+Thu Apr 12 18:09:43 2012 -0700 Jim Foraker
+7cdde53ada761d06d610544e3a10a1cdb8dd192a
+
+	* infiniband-diags/mcm_rereg_test.c: Include ib_types.h
+
+Thu Apr 12 18:09:42 2012 -0700 Jim Foraker
+ec94c8f13b35c87fc9dd8a54ee86e0f73703ae33
+
+	* infiniband-diags/mcm_rereg_test.c: dead code removal
+
+Thu Apr 12 18:09:41 2012 -0700 Jim Foraker
+18fe6ba8a5e4c1c9afd59e87fc36a28ec4e9582d
+
+	* infiniband-diags/ibroute.c: Dead code removal
+
+Mon Mar 5 13:29:13 2012 -0800 Ira Weiny
+5370dfd43d4a00879bca6a5efd14ce21d20967ac
+
+	* infiniband-diags: saquery further error value clean up.
+
+Mon Feb 27 14:18:09 2012 -0800 Ira Weiny
+c1a428ff57c92dc6c1135755fa5da271acfe74fd
+
+	* infiniband-diags: remove unused options from check_lft_balance.pl
+
+Mon Feb 20 08:17:20 2012 -0800 Ira Weiny
+3179ae8c8d7f4fb1372f2813afcd80e4d772a14b
+
+	* infiniband-diags: remove ib_resolve_smlid_via requirement for sa queries
+
+Fri Feb 17 22:25:42 2012 -0800 Ira Weiny
+0810a520a70897566ab09ed245cdad2c8add3103
+
+	* infiniband-diags: Fix saquery error reporting
+
+Wed Feb 8 10:17:20 2012 -0800 Ira Weiny
+8146868765268752b3e9f60908dded7fcd9180a0
+
+	* Fix ibping server when client stops sending.
+
+Thu Nov 3 14:42:34 2011 -0700 Albert Chu
+4ac43920fb8e2b6c5679498181aa3688eca117f9
+
+	* infiniband-diags: Support ibccconfig, congestion control setting tool
+
+Wed Jan 11 23:39:45 2012 -0800 Ira Weiny
+8aadc8ad3ad1df57941022826a03bce3707907c3
+
+	* ibswitches: fix output when switch names have "base" or "enhanced" in them
+
+Tue Jan 10 12:22:58 2012 -0800 Hal Rosenstock
+cb92b9808bdc292b291e2ef416b6ead19745826c
+
+	* infiniband-diags/configure.in: Fix typo
+
+** Version: 1.6.0-5chaos
+
+Tue Apr 17 11:07:37 2012 -0700 Ira Weiny
+23703e7661e8be4084138affe4adf894999a8451
+
+	* tag 1.6.0-5chaos
+
+Tue Apr 17 10:55:13 2012 -0700 Ira Weiny
+4286d05353a1e8d6badc929e5f1000cbec0cf738
+
+	* infiniband-diags: preserve long_opts global for use in ibdiag_show_usage
+
+** Version: 1.6.0-4chaos
+
+Tue Dec 6 12:08:05 2011 -0800 Ira Weiny
+1f0b2765bc6420208816665ab986fdf2a962429f
+
+	* tag 1.6.0-4chaos
+
+Sun Dec 4 19:37:00 2011 -0800 Ira Weiny
+78ec2486dfce920b650cf2719acc649b297e2197
+
+	* infiniband-diags/ibccquery Fix field name
+
+Fri Dec 2 16:00:10 2011 -0800 Albert Chu
+4fabac9d235341b32756a8584e80db86bb348c5b
+
+	* infiniband-diags/src/ibccquery.c: Fix off by one output bug, ccti_limit is 0 based not 1 based
+
+Fri Dec 2 11:52:27 2011 -0800 Ira Weiny
+d8648e9d603e469d0fbd90d18b4c99e725d05812
+
+	* infiniband-diags: add config file option for Mellanox ExtPortInfo queries
+
+Fri Dec 2 11:50:31 2011 -0800 Ira Weiny
+3d726a8ec8752938e224ef6bb0cbea8e84544dff
+
+	* infiniband-diags: move is_mlnx_ext_port_info_supported to common code
+
+Fri Dec 2 13:38:17 2011 -0800 Ira Weiny
+72f1eb2e425f6198ea2153f1a8a30cacba37b0a5
+
+	* infiniband-diags: fix printing of extended speeds when port is down
+
+Thu Dec 1 11:33:09 2011 -0800 Hal Rosenstock
+7db86c37537a43521df77ccfce81b714f5c02667
+
+	* infiniband-diags/perfquery.c: Fix reset for PortExtendedSpeedsCounters
+
+Thu Dec 1 08:21:12 2011 -0800 Hal Rosenstock
+389da636bf1b9614276500039c8c017623fd8c8e
+
+	* infiniband-diags/perfquery.c: Fix display of PortExtendedSpeedsCounters
+
+Wed Nov 30 14:09:52 2011 -0800 Albert Chu
+3c1b21f10c632448419911efa13a5763d15dae7b
+
+	* Fix typo in ibccquery manpage
+
+** Version: 1.6.0-3chaos
+
+Tue Nov 29 23:05:56 2011 -0800 Ira Weiny
+a9f29f2e1edc6cc9bc67873b6ff33b6905db4b40
+
+	* tag 1.6.0-3chaos
+
+Mon Sep 26 16:47:21 2011 -0700 Ira Weiny
+10fa604b2bec5c1fd661611638644b4042f09629
+
+	* infiniband-diags: move deprecated scripts to compat rpm
+
+Wed Apr 20 23:30:27 2011 -0700 Ira Weiny
+7792b37b50fa27ac3b24125f5c8217ea39d5e8f0
+
+	* infiniband-diags: mark duplicate/lower performing scripts as deprecated.
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+4d677a33a5c14531b71aa4a416226757e78b4e11
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+45e2bc07cbaac9ef3b39d7888a733b935f590dd0
+
+	* infiniband-diags: iblinkinfo add "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+7a0076507ec1e69483007a99a5117d94c4004416
+
+	* infiniband-diags: add libibfabricconf
+
+Mon Nov 7 08:47:43 2011 -0800 Ira Weiny
+5286c744427e642e3ee039fafe8b71d3e3f1ba6e
+
+	* infiniband-diags: check_lft_balance.pl add -C/-P options
+
+Mon Nov 7 07:42:19 2011 -0800 Ira Weiny
+843371947e7f447446df59dd6a5e4e78f264c0e6
+
+	* check_lft_balance.pl: Add extra check when using -e heuristic flag in check_lft_balance.pl
+
+Wed Oct 12 17:17:08 2011 -0700 Albert L.Chu
+4ed1bbb8e642d88cca5dbbd2b5c6fb5473f45265
+
+	* Add -e heuristic flag to check_lft_balance.pl to detect common scenarios where unbalanced routing will occur.
+
+Wed Oct 12 15:43:01 2011 -0700 Albert L.Chu
+ff9b775a6bef88f50751fc80deba8d90d962bbcd
+
+	* Update check_lft_balance.pl to work with newer infiniband-diag tools
+
+** Version: 1.6.0-2chaos
+
+Tue Nov 1 23:01:37 2011 -0700 Ira Weiny
+8abd86f983d0510f2a741a3ec4a8d66ef5050e4f
+
+	* tag 1.6.0-2chaos
+
+Mon Sep 26 16:47:21 2011 -0700 Ira Weiny
+78c65c1a57f8ea19d169f1cfed2dab41147beeb2
+
+	* infiniband-diags: move deprecated scripts to compat rpm
+
+Wed Apr 20 23:30:27 2011 -0700 Ira Weiny
+530154d57fbdaba250685b905cc2540026e7757c
+
+	* infiniband-diags: mark duplicate/lower performing scripts as deprecated.
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+9fb428d0855f6994bba1110524f9e311b059f688
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+6644a7951f737ef356212c9a701223e1e1c4f9e9
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+9caf4573c99abee6348c402931f305840c449e0d
+
+	* infiniband-diags: add libibfabricconf
+
+Mon Oct 31 22:48:12 2011 -0700 Ira Weiny
+7f38b58ae850acaad4c4a79209aec47eb33580a5
+
+	* infiniband-diags: ibqueryerrors: don't exit on reset error
+
+** Version: 1.6.0-1chaos
+
+Thu Oct 27 00:16:23 2011 -0700 Ira Weiny
+3a95ad7f6ac8cceddd7c76a26daef01c96662e45
+
+	* Add META for chaos build bot
+
+Mon Sep 26 16:47:21 2011 -0700 Ira Weiny
+a9989da04c7a8809f19e6e8ca40679ac612e1744
+
+	* infiniband-diags: move deprecated scripts to compat rpm
+
+Wed Apr 20 23:30:27 2011 -0700 Ira Weiny
+9f8437d5759967d7caa52470bc0a641c27ce4ad2
+
+	* infiniband-diags: mark duplicate/lower performing scripts as deprecated.
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+f045cf93e7652406ae15b947c977d3d1e894d947
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+4520f00da0e33af9111db524e978188cd50885f9
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+f09b947a7c2ad0fb3306349f65014e41498ad1ec
+
+	* infiniband-diags: add libibfabricconf
+
+** Version: 1.6.0
+
+Thu May 31 17:48:04 2012 -0700 Ira Weiny
+370ee066a1d4ee5bb59786df7ab717486efa9870
+
+	* infiniband-diags: update README for 1.6.0 release
+
+Thu May 31 16:59:12 2012 -0700 Ira Weiny
+47e95f6b97c338afad38571e7b03231d63d53b22
+
+	* infiniband-diags: udpate smp documentation in infiniband-diags page
+
+Tue May 29 20:54:33 2012 -0700 Ira Weiny
+8dbb41ce333e37b3a52b52bbd9febc9d6b9cbb0e
+
+	* infiniband-diags: Add SMP/QP0 usage explanation to general man page
+
+Thu May 31 15:10:54 2012 -0700 Ira Weiny
+9ca4c0369b6fd1266f50105c07ec7f85db9e8c7a
+
+	* infiniband-diags: saquery clarify default smkey option value
+
+Wed May 30 15:15:14 2012 -0700 Jim Foraker
+a27e2e1683cb7ce3d1cc55b1055c2a8fb0695e16
+
+	* infiniband-diags: Add SA smkey option to config file
+
+Wed May 30 15:14:20 2012 -0700 Jim Foraker
+1ff0e5182fbec725e14c7101e1f9848c278202ab
+
+	* ib-diags/saquery: Fix smkey handling
+
+Wed May 30 10:21:35 2012 -0700 Jim Foraker
+c361d33cb57a2c942ffa4bbcd3a1dcf08f05b45c
+
+	* infiniband-diags: Add m_key option to config file
+
+Wed May 30 10:21:34 2012 -0700 Jim Foraker
+32a72dd3ea0efbe09579d0ee806d298614d0d722
+
+	* infiniband-diags/ibportstate.c: Support changing MKey, lease, and protect bits
+
+Thu May 31 12:11:33 2012 -0700 Jim Foraker
+ced1cd4758638468329392099ee82c6f2650ea0c
+
+	* infiniband-diags: Allow specification of an mkey to use on the command line
+
+Wed May 30 10:21:32 2012 -0700 Jim Foraker
+05de760798b5ee0e249b540543d4282a2a2a0d4a
+
+	* infiniband-diags/ibportstate.c: Display MKey, lease, and protect bits
+
+Wed May 30 10:21:31 2012 -0700 Jim Foraker
+a259b9a0d6e7aa53d4013db69126c54a1e83cf7d
+
+	* infiniband-diags: install config file mode 400
+
+Wed May 30 10:21:30 2012 -0700 Jim Foraker
+546ecba50dcb1b24b5fb64e7e1fc947e4d0c2192
+
+	* infiniband-diags: Obfuscate sensitive output by default
+
+Wed May 30 10:09:02 2012 -0700 Jim Foraker
+91277f7a31489a12de94d17bca4f5c7f373616ff
+
+	* infiniband-diags: clean up exclude arguments to ibdiag_process_opts()
+
+Tue May 29 10:04:03 2012 -0700 Hal Rosenstock
+42a7b27865250af8ae87564a66e9fcd5f71dadbe
+
+	* infiniband-diags/ibportstate.c: Remove an extra space from warning message
+
+Thu May 24 13:42:29 2012 -0400 Hal Rosenstock
+c7c22d109e3b690e4c38e95fe4590115ca07dc44
+
+	* infiniband-diags/ibportstate.c: Add newly added options to usage
+
+Tue May 15 15:52:26 2012 -0700 Ira Weiny
+4d1fab57d2a572dfbd0370b1e0cac5ccfea8ac67
+
+	* infiniband-diags: fix autogen with new rst documentation
+
+Thu May 3 17:13:32 2012 -0700 Ira Weiny
+5f8679d4959904e2f7f890fb35885076cdec460f
+
+	* infiniband-diags: move man/check_lft_balance,ibcacheedit,ibstatus,ibidsverify to rst documentation
+
+Thu May 3 14:20:56 2012 -0700 Ira Weiny
+09627e978bb0a7dc99f4bb7cac677dfef592b90a
+
+	* infiniband-diags: move man/saquery,vendstat,ibsysstat,ibfindnodesusing to rst documentation
+
+Thu May 3 09:48:39 2012 -0700 Ira Weiny
+15bea0d4bbb28df87ef813788324b819ef30bf41
+
+	* infiniband-diags: move man/perfquery,sminfo,smpdump,smpquery to rst documentation
+
+Wed May 2 17:01:34 2012 -0700 Ira Weiny
+7bdba73a18dbd23874de51a53ead53f5ab3fedc2
+
+	* infiniband-diags: move man/ibportstate,ibstat,ibroute,ibtracert to rst documentation
+
+Wed May 2 11:27:32 2012 -0700 Ira Weiny
+71634f0a6acb6a93bdd5fb70b1ce7d5a00c1ff81
+
+	* infiniband-diags: move man/ibping,ibnodes,ibhosts,ibswitches,ibrouters to rst documentation
+
+Wed May 9 14:41:50 2012 -0700 Ira Weiny
+c8c9818dfd3f2ea2ae3a9d19e4e0cb539504f5c9
+
+	* infiniband-diags: move man/ibcc[config|query] to rst documentation
+
+Wed May 9 14:39:08 2012 -0700 Ira Weiny
+2a81766b7dae22878dbc973060ff34226c3bffcd
+
+	* infiniband-diags: move man/dump_[ml]fts to rst documentation
+
+Wed May 9 14:30:22 2012 -0700 Ira Weiny
+818ed87d906b0d5c5c989316aae58a12ee866401
+
+	* infiniband-diags: convert documentation from nroff to rst
+
+Wed May 9 14:13:57 2012 -0700 Ira Weiny
+3bca843a80bfaed68a9ccd3d9585339ad47d531a
+
+	* infiniband-diags: check_lft_balance.pl remove unused options
+
+Fri May 4 12:08:57 2012 -0700 Ira Weiny
+6de4c35dd109e60882d733c155254adff08f62bd
+
+	* infiniband-diags: ibidsverify exit status 1 on errors found
+
+Fri May 4 11:51:58 2012 -0700 Ira Weiny
+c8cba00f39ef38cb74db984700d69e09bc16d52a
+
+	* infiniband-diags: fix ibidsverify portguid validation.
+
+Fri May 4 10:34:30 2012 -0700 Ira Weiny
+97f0f6b09fd10a4a4c9956c72bc305e7478b2632
+
+	* infiniband-diags: move ibidsverify man page to main rpm
+
+Fri May 4 09:20:20 2012 -0700 Ira Weiny
+990917642e047966174101aefad9535d380437f4
+
+	* infiniband-diags: move deprecated scripts to "compat" rpm
+
+Wed May 2 16:13:19 2012 -0700 Ira Weiny
+b4cfdf3dc688008cf8471a27f7525ef768413047
+
+	* infiniband-diags: update ib[hosts|switches|routers] to standard options
+
+Thu May 3 10:26:58 2012 -0700 Ira Weiny
+d5181ea92be7d2a422b22fed7abcbb796d6ed0cf
+
+	* infiniband-diags: smpdump fix option 'string'
+
+Wed May 2 17:26:07 2012 -0700 Ira Weiny
+b04f511198d9f6f37edd79582ad6f71e993dc187
+
+	* infiniband-diags: remove -u common option
+
+Fri Apr 27 15:53:15 2012 -0700 Ira Weiny
+a4cedde4bbb7699558aa00d83ed24f14c94ea265
+
+	* infiniband-diags: remove SMI class registration where possible
+
+Fri Apr 27 14:33:30 2012 -0700 Ira Weiny
+5748256b13a3a1d24ee28e85e5eb233ce5db586b
+
+	* infiniband-diags: remove mad.h from ibstat
+
+Mon Apr 30 17:27:57 2012 -0700 Albert Chu
+7ed1cf6a1b82ed8877ca7f26f0165ac46325cd55
+
+	* infiniband-diags ibcconfig: Update documentation examples
+
+Thu Apr 26 14:43:13 2012 -0700 Albert Chu
+71c07674356f2fdf93187430908cbb501a1ee6ec
+
+	* infiniband-diags/src/ibccquery.c: Fix CACongestionSetting inputs
+
+Mon Sep 26 16:47:21 2011 -0700 Ira Weiny
+7cdad904b8d846cf3958a779561ede8bc59b5d05
+
+	* infiniband-diags: move deprecated scripts to "compat" rpm
+
+Wed Apr 20 23:30:27 2011 -0700 Ira Weiny
+c670c59cecbdbfc0f3fbc1afdecf312f21e771d3
+
+	* infiniband-diags: mark duplicate/lower performing scripts as deprecated.
+
+Wed Apr 18 09:01:21 2012 -0400 Hal Rosenstock
+d5df2450a1b6da5bb5bdc64123ba7a6da28a92f4
+
+	* infiniband-diags/vendstat.c: Support IS4/SX firmware version info
+
+Tue Apr 17 10:55:13 2012 -0700 Ira Weiny
+3ff5a791fe4235d39aca591bf2ac056b7e8f9fc3
+
+	* infiniband-diags: preserve long_opts global for use in ibdiag_show_usage
+
+Thu Apr 12 18:09:45 2012 -0700 Jim Foraker
+288234aad813f218049fbfe0e3b0b25ee8f83f69
+
+	* infiniband-diags: migrate resolve_portid_str in from libibmad
+
+Thu Apr 12 18:09:44 2012 -0700 Jim Foraker
+16f11b35f0cd961e8dc8c6dabd155f2dca024833
+
+	* infiniband-diags: Remove dependencies on ib_resolve_smlid/ib_resolve_self
+
+Thu Apr 12 18:09:43 2012 -0700 Jim Foraker
+7cdde53ada761d06d610544e3a10a1cdb8dd192a
+
+	* infiniband-diags/mcm_rereg_test.c: Include ib_types.h
+
+Thu Apr 12 18:09:42 2012 -0700 Jim Foraker
+ec94c8f13b35c87fc9dd8a54ee86e0f73703ae33
+
+	* infiniband-diags/mcm_rereg_test.c: dead code removal
+
+Thu Apr 12 18:09:41 2012 -0700 Jim Foraker
+18fe6ba8a5e4c1c9afd59e87fc36a28ec4e9582d
+
+	* infiniband-diags/ibroute.c: Dead code removal
+
+Mon Mar 5 13:29:13 2012 -0800 Ira Weiny
+5370dfd43d4a00879bca6a5efd14ce21d20967ac
+
+	* infiniband-diags: saquery further error value clean up.
+
+Mon Feb 27 14:18:09 2012 -0800 Ira Weiny
+c1a428ff57c92dc6c1135755fa5da271acfe74fd
+
+	* infiniband-diags: remove unused options from check_lft_balance.pl
+
+Mon Feb 20 08:17:20 2012 -0800 Ira Weiny
+3179ae8c8d7f4fb1372f2813afcd80e4d772a14b
+
+	* infiniband-diags: remove ib_resolve_smlid_via requirement for sa queries
+
+Fri Feb 17 22:25:42 2012 -0800 Ira Weiny
+0810a520a70897566ab09ed245cdad2c8add3103
+
+	* infiniband-diags: Fix saquery error reporting
+
+Wed Feb 8 10:17:20 2012 -0800 Ira Weiny
+8146868765268752b3e9f60908dded7fcd9180a0
+
+	* Fix ibping server when client stops sending.
+
+Thu Nov 3 14:42:34 2011 -0700 Albert Chu
+4ac43920fb8e2b6c5679498181aa3688eca117f9
+
+	* infiniband-diags: Support ibccconfig, congestion control setting tool
+
+Wed Jan 11 23:39:45 2012 -0800 Ira Weiny
+8aadc8ad3ad1df57941022826a03bce3707907c3
+
+	* ibswitches: fix output when switch names have "base" or "enhanced" in them
+
+Tue Jan 10 12:22:58 2012 -0800 Hal Rosenstock
+cb92b9808bdc292b291e2ef416b6ead19745826c
+
+	* infiniband-diags/configure.in: Fix typo
+
+Sun Dec 4 19:37:00 2011 -0800 Ira Weiny
+78ec2486dfce920b650cf2719acc649b297e2197
+
+	* infiniband-diags/ibccquery Fix field name
+
+Fri Dec 2 16:00:10 2011 -0800 Albert Chu
+4fabac9d235341b32756a8584e80db86bb348c5b
+
+	* infiniband-diags/src/ibccquery.c: Fix off by one output bug, ccti_limit is 0 based not 1 based
+
+Fri Dec 2 11:52:27 2011 -0800 Ira Weiny
+d8648e9d603e469d0fbd90d18b4c99e725d05812
+
+	* infiniband-diags: add config file option for Mellanox ExtPortInfo queries
+
+Fri Dec 2 11:50:31 2011 -0800 Ira Weiny
+3d726a8ec8752938e224ef6bb0cbea8e84544dff
+
+	* infiniband-diags: move is_mlnx_ext_port_info_supported to common code
+
+Fri Dec 2 13:38:17 2011 -0800 Ira Weiny
+72f1eb2e425f6198ea2153f1a8a30cacba37b0a5
+
+	* infiniband-diags: fix printing of extended speeds when port is down
+
+Thu Dec 1 11:33:09 2011 -0800 Hal Rosenstock
+7db86c37537a43521df77ccfce81b714f5c02667
+
+	* infiniband-diags/perfquery.c: Fix reset for PortExtendedSpeedsCounters
+
+Thu Dec 1 08:21:12 2011 -0800 Hal Rosenstock
+389da636bf1b9614276500039c8c017623fd8c8e
+
+	* infiniband-diags/perfquery.c: Fix display of PortExtendedSpeedsCounters
+
+Wed Nov 30 14:09:52 2011 -0800 Albert Chu
+3c1b21f10c632448419911efa13a5763d15dae7b
+
+	* Fix typo in ibccquery manpage
+
+Mon Nov 7 08:47:43 2011 -0800 Ira Weiny
+5286c744427e642e3ee039fafe8b71d3e3f1ba6e
+
+	* infiniband-diags: check_lft_balance.pl add -C/-P options
+
+Mon Nov 7 07:42:19 2011 -0800 Ira Weiny
+843371947e7f447446df59dd6a5e4e78f264c0e6
+
+	* check_lft_balance.pl: Add extra check when using -e heuristic flag in check_lft_balance.pl
+
+Wed Oct 12 17:17:08 2011 -0700 Albert L.Chu
+4ed1bbb8e642d88cca5dbbd2b5c6fb5473f45265
+
+	* Add -e heuristic flag to check_lft_balance.pl to detect common scenarios where unbalanced routing will occur.
+
+Wed Oct 12 15:43:01 2011 -0700 Albert L.Chu
+ff9b775a6bef88f50751fc80deba8d90d962bbcd
+
+	* Update check_lft_balance.pl to work with newer infiniband-diag tools
+
+Mon Oct 31 22:48:12 2011 -0700 Ira Weiny
+7f38b58ae850acaad4c4a79209aec47eb33580a5
+
+	* infiniband-diags: ibqueryerrors: don't exit on reset error
+
+Thu Oct 13 15:35:59 2011 -0700 Ira Weiny
+2a8f55f0926461cfcf81fb41b75da6a653fc1ef5
+
+	* infiniband-diags: add a general config file
+
+Thu Oct 27 00:02:33 2011 -0700 Ira Weiny
+117d3ba10d3e22fecd70080e901ad101c7d6b8de
+
+	* infiniband-diags: add ibccquery man page to build
+
+Wed Oct 26 14:24:46 2011 -0700 Ira Weiny
+a717450ac7ed0b6b08f4ec962ede218a3531238b
+
+	* infiniband-diags: clean up build
+
+Wed Oct 26 11:15:03 2011 -0700 Ira Weiny
+7c49fa20284c5d70831fb03fcec2b45b82251d90
+
+	* infiniband-diags: iblinkinfo flag ports which were not scanned
+
+Wed Oct 12 16:55:10 2011 -0700 Ira Weiny
+e2bdd6ca078aa6c86bdc6ab53fe8c907f1f81ba2
+
+	* infiniband-diags: saquery: use ib-node-name-map file
+
+Thu Oct 13 15:28:50 2011 -0700 Ira Weiny
+00e47776956d769fb2f9bdceafd960917581f492
+
+	* infiniband-diags: iblinkinfo: fix error message
+
+Wed Oct 12 17:28:57 2011 -0700 Ira Weiny
+31c06d94d4ecc5fd6af45150807061848ed89092
+
+	* infiniband-diags: fix installation of error_thresholds file
+
+Thu Oct 13 15:58:33 2011 -0700 Ira Weiny
+607467e00f36c9aa62662445bcd18d0ce72f3be7
+
+	* Master branch is not moving on to 1.6
+
+Thu Sep 29 11:02:21 2011 -0700 Albert Chu
+15ee3ea96e4a280873b9f5b6302aa1c359789ec6
+
+	* support --switches-only and --cas-only options in iblinkinfo
+
+Thu Sep 29 11:26:29 2011 -0700 Ira Weiny
+1c9866e0437fc83dc7b01cd3d8b19300b0d1dfe5
+
+	* Update version in prep for next release
+
+Tue Aug 2 11:15:07 2011 -0700 Albert Chu
+64afec3a376d0d3037bc4c89dd8384f7fa863777
+
+	* Support ibccquery, congestion control query tool.
+
+Tue Sep 27 18:15:12 2011 -0700 Marcus R Epperson
+cdbc1cde39a9ae75212f85e8d24326fb72d1cc7d
+
+	* infiniband-diags/src/ibqueryerrors.c: don't increment bad_ports for port ALL
+
+Tue Sep 27 18:15:11 2011 -0700 Marcus R Epperson
+ae19572efa6bcc389b27302ae0606c7fda2093f0
+
+	* infiniband-diags/src/ibqueryerrors.c: fix segv due to CA port 0 reference
+
+Sun Sep 11 01:10:32 2011 -0700 Alex Netes
+a3b24e9ffa4da0e2b47a6007834bed2ce3530429
+
+	* infiniband-diags/scripts/ibcheckport.in: ignore lid/sm lid checks on non zero port switches
+
+Mon Sep 19 15:32:24 2011 -0700 Ira Weiny
+bb3213197719ec673e898dbec153ee6424097446
+
+	* infiniband-diags: ibqueryerrors add query failure count
+
+Mon Sep 19 14:05:09 2011 -0700 Ira Weiny
+1a72e89eb7386bd9b2ee4e64f95359324025c298
+
+	* infiniband-diags: ibnetdisc Wrap header for use in C++ code
+
+Thu Sep 22 13:37:23 2011 -0700 Hefty, Sean
+8243db1e588c34c7777945c2cc51b94d21ee3d36
+
+	* RE: [PATCH v2] ib-diags: Add cast to fix build on windows
+
+** Version: 1.5.9-1chaos
+
+Thu Sep 22 14:35:29 2011 -0700 Ira Weiny
+1ebe44cd0c1799310f95c0de345bed7e5bdc4a2f
+
+	* tag it
+
+Tue Aug 2 11:15:07 2011 -0700 Albert Chu
+ea6238dfef4b12dab026884e05a556747140de55
+
+	* Support ibccquery, congestion control query tool.
+
+Mon Sep 19 14:05:09 2011 -0700 Ira Weiny
+394be9c093793e0f949344c2420d79b34feee6fd
+
+	* infiniband-diags: ibnetdisc Wrap header for use in C++ code
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+d3ff6bcb60598254f5ac7a091bb0e3ef946ce1f9
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+094c789c80daa5580a4cbd0ecb055c1397b1172a
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+be824cd3369c89f7e1b9f69a98930319f45af7f8
+
+	* infiniband-diags: add libibfabricconf
+
+Mon Sep 19 15:32:24 2011 -0700 Ira Weiny
+f2ee1f2758f9016bc792f1e530647397f119c06f
+
+	* infiniband-diags: ibqueryerrors add query failure count
+
+Wed Sep 14 13:08:27 2011 -0700 Ira Weiny
+3542f74b5f423938fc1babd71c3e67fe168b932e
+
+	* The merge failed to remove this file on this branch.
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+e56e9467984c9142507e8dda07062b22931b896a
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+2ce0ad4e371960e1d43edfabadcb6470e736695f
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+baad926df75886ca46897c7c8786ff868765d02f
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+ab31d99e1336e57f6c21b0dace9aafe3e13aeab7
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+1cd5c1616ced9ea72b4cca7182e8bca02e544d45
+
+	* infiniband-diags: add libibfabricconf
+
+Wed Aug 31 10:22:43 2011 -0700 Ira Weiny
+f7d822cfbdbcd55063834ebf05c987bcfcc5070f
+
+	* tag 1.5.8-7chaos
+
+Wed Aug 31 10:22:19 2011 -0700 Ira Weiny
+cfae4357d16352d332934bb3708305c515df754a
+
+	* Fix messed up merge
+
+Wed Aug 31 10:14:13 2011 -0700 Ira Weiny
+43cd1593e54361c02550184adb28a55699821eb7
+
+	* tag 1.5.8-6chaos
+
+Wed Aug 31 09:23:12 2011 -0700 Ira Weiny
+1080fd7cc004d5ef186ebdb5a66b73343ae08361
+
+	* add to fabricconf
+
+Wed Aug 31 09:27:14 2011 -0700 Ira Weiny
+e05601a61149680c19e852d69b25bcefbf230167
+
+	* tag 1.5.8-5chaos
+
+Wed Aug 31 09:23:12 2011 -0700 Ira Weiny
+25d3bd01def9c0f3824fda8493d243d679d7a889
+
+	* add to fabricconf
+
+Wed Aug 31 09:13:25 2011 -0700 Ira Weiny
+b5111b4a70425817272511b0786d8551283a3a44
+
+	* tag 1.5.8-4chaos
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+3672e50c43ee8b939b0aeae7f8d5fcd225d89e91
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+8173029113fd57d85c352e7e5289fb385b052d4a
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+ad73af596485064a51f79be48bfcb04008610de2
+
+	* infiniband-diags: add libibfabricconf
+
+Tue Aug 30 22:37:31 2011 -0700 Ira Weiny
+3e14ea66e7ae3ba1c4156a123e9263d6747e1108
+
+	* add to fabricconf
+
+Tue Aug 23 21:42:56 2011 -0700 Ira Weiny
+d414a4afdd07de048b8c5e7d48bd8a27e4d116c8
+
+	* Messed up the merge; new tag 3chaos
+
+Tue Aug 23 21:35:31 2011 -0700 Ira Weiny
+5414e2f99da51ffe517d7001beef8db7804f426b
+
+	* tag 1.5.8-2chaos
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+b08260639e2b350ae26cd79af912d9ccf382a2ff
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+4335917bcb4b31da25a3548461e5d2899203b187
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+1093495b10a269d63bc5cc8e2ddd09ecde42f2fe
+
+	* infiniband-diags: add libibfabricconf
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+49d047e8735adfba8c78ba4e0342dc96ffbb1bc8
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Fri Feb 25 15:13:33 2011 -0800 Ira Weiny
+131752b844249aefeb5f66427d3a501169ed39e6
+
+	* Add META for chaos build bot
+
+** Version: 1.5.9
+
+Tue Aug 16 13:40:32 2011 -0700 Ira Weiny
+5ba0caf35bf96c17b0f795e787292afc82116b8b
+
+	* Update AUTHORS and make README release notes.
+
+Thu Sep 1 01:47:39 2011 +0000 Hal Rosenstock
+d7f9ad0651276578b2c2ce22dd32496a419f484e
+
+	* infiniband-diags: Fix cap_mask extended link speed supported endian checks
+
+Wed Aug 31 15:26:42 2011 +0000 Hal Rosenstock
+1e62d09ae5d7e4d43089deea07ceb94f8dfd49a0
+
+	* infiniband-diags/ibqueryerrors.c: Add support for FDR10
+
+Wed Aug 31 17:08:50 2011 -0700 Ira Weiny
+95a84b7cc30aae53e4212e6138b95b515287b151
+
+	* infiniband-diags/iblinkinfo.c: Add support for FDR10
+
+Wed Aug 31 17:07:29 2011 -0700 Ira Weiny
+ce6c56fa2165078e9f653428e26368f5393dd081
+
+	* infiniband-diags: Add support for FDR10 to ibnetdiscover
+
+Wed Aug 31 17:06:43 2011 -0700 Ira Weiny
+c8542da6a0c00ab463f8b7a066219baa1afcb43c
+
+	* infiniband-diags: Add FDR10 support to libibnetdisc
+
+Wed Aug 31 15:26:53 2011 +0000 Hal Rosenstock
+1344cb3feacafc462440dabfa5997c5205486d83
+
+	* infiniband-diags/ibstat.c: Add support for FDR10
+
+Mon Aug 29 21:18:31 2011 +0000 Hal Rosenstock
+3133743b5ea6a7d81b7d70e8a83ce4eb28fec8e6
+
+	* infiniband-diags/ibnetdiscover.c: Fix cap_mask endian for extended link speeds
+
+Wed Aug 31 15:26:28 2011 +0000 Hal Rosenstock
+0020ee448d908011f5f68f1e1d297f1abe58b376
+
+	* infiniband-diags/ibportstate: Add support for FDR10
+
+Wed Aug 31 10:38:08 2011 -0700 Albert Chu
+2100e88e994709789207e010f22a6f7a06afeaa7
+
+	* fix manpage typos
+
+Tue Aug 23 16:12:39 2011 -0700 Ira Weiny
+510c0e0d164ca93af5c263074dea04065fee99fa
+
+	* infiniband-diags: ibqueryerrors Clean up exit codes
+
+Wed Jul 6 18:50:27 2011 -0700 Ira Weiny
+0c220a760d9e42581d326899b8bbbafa16799c06
+
+	* infiniband-diags: add human readable output for data counters
+
+Thu Aug 18 14:47:26 2011 -0700 Ira Weiny
+8bc3e398a656a175a29daa61d461e5fa0ad76c56
+
+	* infiniband-diags: move get_msg to common code
+
+Fri Aug 19 16:53:42 2011 +0000 Hal Rosenstock
+6d819a447ce87825c5c6c84723793c7ab9971f3f
+
+	* infiniband-diags/man/ibportstate.8: Update for fdr
+
+Tue Aug 16 13:44:44 2011 +0000 Hal Rosenstock
+ae7695abf3916f3d434dd62c5bacfc5250c36c32
+
+	* infiniband-diags/ibnetdiscover.c: Changes for extended link speeds
+
+Tue Aug 16 13:44:37 2011 +0000 Hal Rosenstock
+2e77e728c219bc55d88be10015b641158e1e61b2
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Changes for extended link speeds
+
+Tue Aug 16 11:13:59 2011 +0000 Hal Rosenstock
+fa92836fcbe1e4255ff9d6bb8cb3a842fa43e38f
+
+	* infiniband-diags/ibqueryerrors.c: Changes for extended link speeds
+
+Tue Aug 16 10:28:39 2011 +0000 Hal Rosenstock
+d7bb3c119f3a20410937c4a83bb01b8afaf30298
+
+	* infiniband-diags/iblinkinfo.c: Changes for extended link speeds
+
+Tue Aug 16 09:14:39 2011 +0000 Hal Rosenstock
+6aab8ab5db478cc46e01c6bc8cfceb32c7e1b42d
+
+	* infiniband-diags/ibportstate.c: Changes for extended link speeds
+
+Tue Aug 16 00:37:15 2011 +0000 Hal Rosenstock
+b550a953e5f8ff7637054377c2f2fde014198f9b
+
+	* infiniband-diags/perfquery: Add support for extended link speeds
+
+Tue Aug 16 00:18:51 2011 +0000 Hal Rosenstock
+a76827fc6b9562c43940bac49d6a9cb9d40df979
+
+	* infiniband-diags/saquery: Add extended link speed support for PortInfoRecord queries
+
+Mon Aug 15 23:54:33 2011 +0000 Hal Rosenstock
+678ec2f9fc14f60038cd77e46d15040b1b159fd4
+
+	* infiniband-diags/smpquery: Add support for extended link speeds
+
+Fri Aug 5 20:44:39 2011 +0000 shefty
+a817e38e5275dcf75404af19b8592c03f4822118
+
+	* ibnetdisc: Fix build for windows
+
+Fri Aug 5 16:59:08 2011 -0700 Ira Weiny
+65818eabe526aee176fc7129e2b5c1b264ba0a3b
+
+	* infiniband-diags: make library dependancies explicit
+
+Wed Aug 3 13:09:00 2011 -0700 Ira Weiny
+6f87728b6f0e230a8706842695a8388a9083b508
+
+	* infiniband-diags: update check for latest dump function in libibmad
+
+Sat Jul 23 11:02:52 2011 +0000 Hal Rosenstock
+d85a6a88f35bae0182c116298ef57cc224bb02dd
+
+	* infiniband-diags/smpquery: Add Mellanox extended portinfo query
+
+Wed Aug 3 17:58:04 2011 +0000 Hal Rosenstock
+c80dc802054484883a92f96fc9ede9f2a9c076df
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Remove compile warning
+
+Thu Jul 14 17:10:52 2011 -0700 Albert L.Chu
+aa80e79a008717bc40145e06a7f693ae5c592179
+
+	* perfquery: support many optional performance counters, including congestion control counters
+
+Tue Jul 26 12:18:02 2011 +0000 Hal Rosenstock
+ae82553337eaab6140582ef782cbd11e32cb1401
+
+	* infiniband-diags/saquery.c: PortInfoRecord now has an options field
+
+Wed Jul 20 10:01:26 2011 -0700 Ira Weiny
+0ee2db536f7e04678664ac51c0f940fa76cbac1c
+
+	* infiniband-diags: ibqueryerrors fix null threshold_str
+
+Thu Jul 14 14:27:07 2011 -0700 Ira Weiny
+1274813595ceaf4c6cc0726e0aa157111ce4ce19
+
+	* infiniband-diags: convert ib[linkinfo|queryerrors] to use PortGUIDs
+
+Thu Jul 14 16:05:30 2011 -0700 Ira Weiny
+ac291237eec71b758401bab4b8d9ec51b6387e79
+
+	* infiniband-diags: libibnetdisc Allow a DR Path partial fabric query starting at a CA
+
+Thu Jul 14 14:25:41 2011 -0700 Ira Weiny
+f3e0901c7dd69f5d5b81f80a9d1c675898569f6b
+
+	* infiniband-diags: libibnetdisc add port interface
+
+Thu Jun 9 22:18:28 2011 -0700 Ira Weiny
+89b6a7b026e85e6ddfa8d47dde951f7accd5fff3
+
+	* infiniband-diags: move core saquery functionality to ibdiag_common
+
+Thu Jun 2 00:13:38 2011 -0700 Ira Weiny
+80628857886b0b26182fcf4e5d17f3c72a90d8b1
+
+	* infiniband-diags: saquery; remove "result" global
+
+Tue Jul 12 11:34:36 2011 -0700 Ira Weiny
+c06655b88bc1b88f3aa42be4d1306b4fa42e3b47
+
+	* infiniband-diags: change perl install to vendorlib
+
+Tue Jun 28 17:50:37 2011 -0700 Ira Weiny
+dee28c9a36941f6c2f8ae69f4a574984254afeb4
+
+	* infiniband-diags: configure.in; check for more recent function in libibmad
+
+Tue Jul 12 11:35:04 2011 -0700 Ira Weiny
+1098eac2138a533e5fdbdfffbe4837763b78ba37
+
+	* infiniband-diags: Add sysconfdir to spec for config files
+
+Thu Jul 7 09:50:12 2011 -0700 Hal Rosenstock
+c8a3e7bf94498459aad16cd298268e7767e9e9ed
+
+	* infiniband-diags: Initial changes for extended speed support in libibmad
+
+Wed Jul 6 14:32:08 2011 -0700 Ira Weiny
+0138f443fc02c3c650a496db851777221b37e74c
+
+	* infiniband-diags: Remove reference to OpenSM from COPYING
+
+Wed Jun 1 21:49:57 2011 -0700 Ira Weiny
+46b1ba489d6ed3bde6a60c95d07233b67439e4f8
+
+	* infiniband-diags: add package requires to spec file.
+
+Sun May 29 18:01:31 2011 -0700 Ira Weiny
+291a922cbcf246e15f0b71ef5d467c6e8bebb6d2
+
+	* infiniband-diags: test for libosmcomp with a function that is used in the code
+
+Mon Jun 20 06:00:56 2011 -0700 Hal Rosenstock
+e9d099eda47f77d456996ce2fc385423ba19cbc0
+
+	* infiniband-diags/ibnetdiscover.c: Fix typo in help
+
+Thu Jun 16 13:52:43 2011 -0700 Hal Rosenstock
+25fad278d4b8a808da5fe0e2ae7042ba18e74fdc
+
+	* infiniband-diags/ibqueryerrors.c: Fix typo in help
+
+Wed Jun 8 05:47:34 2011 -0700 Hal Rosenstock
+22c5087c091b895507882eec85d6b57b641e637f
+
+	* infiniband-diags/libibnetdisc/ibnetdisc_cache.c: Fix a couple of memory leaks
+
+Wed Jun 8 05:47:15 2011 -0700 Hal Rosenstock
+2a75c3e874e0d5edaaf84085f94fc65cd7c5a5be
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Fix possible overrun of path
+
+Wed Jun 8 05:57:55 2011 -0700 Hal Rosenstock
+3364bcd41ec12c357c0510ac86a0cbb0313ca2d6
+
+	* infiniband-diags/ibportstate.c: Fix sizeof
+
+Fri May 13 22:28:55 2011 -0700 Ira Weiny
+1004b7f967df8a09e82d986124d1881b94dcb370
+
+	* infiniband-diags: perfquery; Support PortCountersExtendedNoIETF
+
+Thu May 12 17:31:15 2011 -0700 Ira Weiny
+5ef9bfa5d30baca408f310630de55aa1f0ecfc33
+
+	* infiniband-diags: perfquery; print cap_mask for information
+
+Fri May 27 10:52:05 2011 -0700 Hal Rosenstock
+82849a8212253c7c91ec6ce3ef15655e1c29b5b1
+
+	* infiniband-diags/saquery.c: Fix SA_ERR_UNKNOWN define
+
+Wed May 25 05:30:06 2011 -0700 Hal Rosenstock
+ca54411f41b9192918c971a6a58b373e11e47919
+
+	* infiniband-diags/configure.in: Support override for IBPATH
+
+Tue May 24 11:26:33 2011 -0700 Hal Rosenstock
+1a2ec7c386ae0ee749ac7b66ed0337b9fe1e1f5f
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Better error message
+
+Thu Apr 28 02:09:36 2011 -0700 Eli Dorfman
+87a30707bb36164a11dd1dd24087ca6bd3a333d1
+
+	* infiniband-diags/vendstat: Fixed general info query
+
+Wed Apr 27 01:07:59 2011 -0700 Ira Weiny
+1e406cb50f406a769afbbf806f984775a10dac4d
+
+	* infiniband-diags: ibqueryerrors; add --counters option
+
+Tue Apr 26 22:59:15 2011 -0700 Ira Weiny
+33a76020297553a5fad0f480e41f6ee9d86f12c7
+
+	* infiniband-diags: ibqueryerrors --data; show/clear PortCountersExtended when supported
+
+Tue Apr 26 22:18:27 2011 -0700 Ira Weiny
+214bb92d11e93c76276db471ce88423d32c531a5
+
+	* infiniband-diags: ibqueryerrors; use #defines for CapabilityMask
+
+Mon Apr 25 12:39:12 2011 -0700 Ira Weiny
+3387935ce91193fc7a3d7cdd9adea124f71a7640
+
+	* infiniband-diags: ibqueryerrors; add ibcheckerrors like summary
+
+Wed Apr 27 10:43:01 2011 -0700 Ira Weiny
+cbe10407a14e57c8febe6e039ae617737f0b6e0f
+
+	* infiniband-diags: ibqueryerrors; add error thresholds
+
+Thu Apr 28 07:47:16 2011 -0700 Hal Rosenstock
+53ac239ede48d6a1df8ed1f048cebe2eb2dc38e4
+
+	* infiniband-diags/perfquery.c: Use ib_types.h defines for CapabilityMask
+
+Wed Apr 27 12:48:15 2011 -0700 Hal Rosenstock
+42b5389f870c192627c22470298f8f97764b5979
+
+	* infiniband-diags/ibnetdiscover.c: Eliminate blank line when sysimgguid is 0
+
+Wed Apr 27 11:17:46 2011 -0700 Hal Rosenstock
+d5d44d167696eeffcb31e941ded9da76566dde6d
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Handle calloc failure
+
+Wed Apr 27 10:08:03 2011 -0700 Ira Weiny
+32c0166f2f3afe68a599b107133ea6e6c6e72edd
+
+	* infiniband-diags: fix "dist" target and subsequent rpm building
+
+Mon Apr 25 19:55:22 2011 -0700 Marcus Epperson
+5f9facd634ed8f95d493c78dec5c1bc12795fbee
+
+	* infiniband-diags/ibnetdiscover: Make --ports option use remap_node_name()
+
+Thu Apr 21 14:47:03 2011 -0700 Ira Weiny
+085432de49bcf6ebbcb927e2cac53da32cc9be94
+
+	* infiniband-diags: improve backwards/standalone compatibility
+
+Sun Apr 17 03:06:21 2011 -0700 Ira Weiny
+a398a098d0c21f0993cd3b8e3cd7485d87d6dff8
+
+	* infiniband-diags: iblinkinfo; remove non-supported -c option from man page
+
+Tue Mar 29 17:48:41 2011 -0700 Ira Weiny
+a8c7126ff8cafc828ddbfe3708d25861e5440056
+
+	* infiniband-diags: saquery, clean up error code/return types
+
+Wed Apr 13 09:10:34 2011 -0700 Ira Weiny
+ef2c2d6732c2f4e92a30e33e1bb4911eddd65223
+
+	* infiniband-diags: saquery, properly free mad in get_and_dump_any_records
+
+Sat Apr 9 15:22:02 2011 +0000 Hal Rosenstock
+6df1fdd5aeb16fe17f08b5693b79326e8d78c7d2
+
+	* infiniband-diags: Make sure buffers are set to zero before calling xxx_query_via
+
+Fri Apr 1 18:38:50 2011 +0000 Hal Rosenstock
+a57e627722a5cad227baaae8de22b0af1438008d
+
+	* infiniband-diags.spec.in: Remove duplication of ibdiscover.pl
+
+Thu Mar 17 17:34:52 2011 -0700 Ira Weiny
+9f91f2a277ade5875af43beb9ae246b9534d8279
+
+	* infiniband-diags: saquery; clean up name/lid processing
+
+Mon Apr 26 14:27:32 2010 -0400 Hal Rosenstock
+1ee5bfabda30ae61ac869c380bbfe4bce3d7de1c
+
+	* infiniband-diags/saquery: Add GUIDInfoRecord support
+
+Tue Mar 22 15:11:45 2011 -0700 Jason Gunthorpe
+7596207a1810dd7c5168469b0c3afd86aca8ae50
+
+	* Fix ibdatacounters
+
+Tue Mar 22 14:25:59 2011 -0700 Jason Gunthorpe
+568a1175a1089ebe8ee2d9b6e57086398219ba38
+
+	* Fix missing $IBPATH in ibdatacounts
+
+Mon Feb 14 15:17:15 2011 -0800 Tamir Ronen
+a6abfa00de4e45cedde3616e03de37b3a3430bf2
+
+	* add support for ibnetdiscover grouping for Mellanox switches
+
+** Version: 1.5.8-chaos1
+
+Fri Feb 25 15:13:33 2011 -0800 Ira Weiny
+f400454f05da011cb422b1aa3b787c22375427e5
+
+	* Add META for chaos build bot
+
+** Version: 1.5.8-7chaos
+
+Wed Aug 31 10:22:43 2011 -0700 Ira Weiny
+f7d822cfbdbcd55063834ebf05c987bcfcc5070f
+
+	* tag 1.5.8-7chaos
+
+Wed Aug 31 10:22:19 2011 -0700 Ira Weiny
+cfae4357d16352d332934bb3708305c515df754a
+
+	* Fix messed up merge
+
+** Version: 1.5.8-6chaos
+
+Wed Aug 31 10:14:13 2011 -0700 Ira Weiny
+43cd1593e54361c02550184adb28a55699821eb7
+
+	* tag 1.5.8-6chaos
+
+Wed Aug 31 09:23:12 2011 -0700 Ira Weiny
+1080fd7cc004d5ef186ebdb5a66b73343ae08361
+
+	* add to fabricconf
+
+** Version: 1.5.8-5chaos
+
+Wed Aug 31 09:27:14 2011 -0700 Ira Weiny
+e05601a61149680c19e852d69b25bcefbf230167
+
+	* tag 1.5.8-5chaos
+
+Wed Aug 31 09:23:12 2011 -0700 Ira Weiny
+25d3bd01def9c0f3824fda8493d243d679d7a889
+
+	* add to fabricconf
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+3672e50c43ee8b939b0aeae7f8d5fcd225d89e91
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+8173029113fd57d85c352e7e5289fb385b052d4a
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+ad73af596485064a51f79be48bfcb04008610de2
+
+	* infiniband-diags: add libibfabricconf
+
+** Version: 1.5.8-4chaos
+
+Wed Aug 31 09:13:25 2011 -0700 Ira Weiny
+b5111b4a70425817272511b0786d8551283a3a44
+
+	* tag 1.5.8-4chaos
+
+Tue Aug 30 22:37:31 2011 -0700 Ira Weiny
+3e14ea66e7ae3ba1c4156a123e9263d6747e1108
+
+	* add to fabricconf
+
+** Version: 1.5.8-3chaos
+
+Tue Aug 23 21:42:56 2011 -0700 Ira Weiny
+d414a4afdd07de048b8c5e7d48bd8a27e4d116c8
+
+	* Messed up the merge; new tag 3chaos
+
+** Version: 1.5.8-2chaos
+
+Tue Aug 23 21:35:31 2011 -0700 Ira Weiny
+5414e2f99da51ffe517d7001beef8db7804f426b
+
+	* tag 1.5.8-2chaos
+
+Tue Aug 23 21:27:15 2011 -0700 Ira Weiny
+b08260639e2b350ae26cd79af912d9ccf382a2ff
+
+	* infiniband-diags: ibqueryerrors add "check" capabilities against ibfabricconf file
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+4335917bcb4b31da25a3548461e5d2899203b187
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Wed Apr 27 10:43:34 2011 -0700 Ira Weiny
+1093495b10a269d63bc5cc8e2ddd09ecde42f2fe
+
+	* infiniband-diags: add libibfabricconf
+
+Wed Jul 13 17:08:01 2011 -0700 Ira Weiny
+49d047e8735adfba8c78ba4e0342dc96ffbb1bc8
+
+	* infiniband-diags: iblinkinfo "check" capabilities against ibfabricconf file
+
+Fri Feb 25 15:13:33 2011 -0800 Ira Weiny
+131752b844249aefeb5f66427d3a501169ed39e6
+
+	* Add META for chaos build bot
+
+** Version: 1.5.13
+
+Mon Jan 16 11:03:45 2012 -0800 Ira Weiny
+49c2002a18f108adec98c87d8dda39e9f5d71958
+
+	* bug fix release 1.5.13
+
+Thu Sep 29 11:02:21 2011 -0700 Albert Chu
+4f3199639402b274df36a182a6beaf65607f5a9e
+
+	* support --switches-only and --cas-only options in iblinkinfo
+
+Wed Jan 11 23:39:45 2012 -0800 Ira Weiny
+9544ea6de80040daaf1f79e7c7aec91c0bc097a6
+
+	* ibswitches: fix output when switch names have "base" or "enhanced" in them
+
+Tue Jan 10 12:22:58 2012 -0800 Hal Rosenstock
+783cb78217ac55cc3994f00cbb51afe457222674
+
+	* infiniband-diags/configure.in: Fix typo
+
+Fri Dec 2 11:52:27 2011 -0800 Ira Weiny
+6f7ebf037c054b30e92bf925d9f5ca02081b829a
+
+	* infiniband-diags: add config file option for Mellanox ExtPortInfo queries
+
+Thu Oct 13 15:35:59 2011 -0700 Ira Weiny
+18c12c54d5c0f0eef7b22657578efd62d58a6a95
+
+	* infiniband-diags: add a general config file
+
+Fri Dec 2 11:50:31 2011 -0800 Ira Weiny
+5d597dbb902f28f300d719cfb9280dd3641b1d01
+
+	* infiniband-diags: move is_mlnx_ext_port_info_supported to common code
+
+Fri Dec 2 13:38:17 2011 -0800 Ira Weiny
+973ac38e451659cca0e4eb2603996d32fcd7f803
+
+	* infiniband-diags: fix printing of extended speeds when port is down
+
+Thu Dec 1 11:33:09 2011 -0800 Hal Rosenstock
+10984ee69f9032628c99a9b812cf014545eca82a
+
+	* infiniband-diags/perfquery.c: Fix reset for PortExtendedSpeedsCounters
+
+Thu Dec 1 08:21:12 2011 -0800 Hal Rosenstock
+ae736e8a5f2b012be2fd89508af10517e621aedb
+
+	* infiniband-diags/perfquery.c: Fix display of PortExtendedSpeedsCounters
+
+** Version: 1.5.12
+
+Mon Nov 7 08:57:08 2011 -0800 Ira Weiny
+dc864aedf1ea2d8954cd59d43bdeea657949c572
+
+	* big fix release
+
+Mon Nov 7 08:47:43 2011 -0800 Ira Weiny
+1dcda5868b9ef1af1cea49ee1d385efd0782c7f6
+
+	* infiniband-diags: check_lft_balance.pl add -C/-P options
+
+Mon Nov 7 07:42:19 2011 -0800 Ira Weiny
+8edda35e923dac056c12e2420c24b0e13c47c707
+
+	* check_lft_balance.pl: Add extra check when using -e heuristic flag in check_lft_balance.pl
+
+Wed Oct 12 17:17:08 2011 -0700 Albert L.Chu
+3abf9438be6793a0b345313714ba615868b725ca
+
+	* Add -e heuristic flag to check_lft_balance.pl to detect common scenarios where unbalanced routing will occur.
+
+Wed Oct 12 15:43:01 2011 -0700 Albert L.Chu
+da2b17cf9b2bf99f3054d7fad7a495adeb1d2777
+
+	* Update check_lft_balance.pl to work with newer infiniband-diag tools
+
+Wed Oct 26 14:24:46 2011 -0700 Ira Weiny
+f13d08c94391cc7728ae1ce17709e18132c3ad9a
+
+	* infiniband-diags: clean up build
+
+** Version: 1.5.11
+
+Tue Nov 1 20:43:13 2011 -0700 Ira Weiny
+309830fce7009636943f6d8e6f7bc95b64bb6424
+
+	* update bug fix version
+
+Mon Oct 31 22:48:12 2011 -0700 Ira Weiny
+42734f2d75225e8f1f6d40f1e6adba5c4bed69b7
+
+	* infiniband-diags: ibqueryerrors: don't exit on reset error
+
+Wed Oct 26 11:15:03 2011 -0700 Ira Weiny
+555d32155271b8ca5a420832c2a2502753b99fd1
+
+	* infiniband-diags: iblinkinfo flag ports which were not scanned
+
+Wed Oct 12 16:55:10 2011 -0700 Ira Weiny
+c811954b7e729d82153700dd3552f304adf22bf5
+
+	* infiniband-diags: saquery: use ib-node-name-map file
+
+** Version: 1.5.10
+
+Thu Oct 13 15:53:13 2011 -0700 Ira Weiny
+fe2cdbb8f613432363739338426f1219276c9d41
+
+	* bug fix release
+
+Thu Oct 13 15:28:50 2011 -0700 Ira Weiny
+a1706839ef0dfdec915acc03dad2fcdb7edac61d
+
+	* infiniband-diags: iblinkinfo: fix error message
+
+Wed Oct 12 17:28:57 2011 -0700 Ira Weiny
+a3ccb9f7550f9a590ea7a8e0eece91ac0eb4dc6b
+
+	* infiniband-diags: fix installation of error_thresholds file
+
+Tue Sep 27 18:15:12 2011 -0700 Marcus R Epperson
+77341960a239d32a81babab39fd5c3a00567a2c5
+
+	* infiniband-diags/src/ibqueryerrors.c: don't increment bad_ports for port ALL
+
+Tue Sep 27 18:15:11 2011 -0700 Marcus R Epperson
+c467942593871891b482e9cc5c0ab23271834b27
+
+	* infiniband-diags/src/ibqueryerrors.c: fix segv due to CA port 0 reference
+
+Sun Sep 11 01:10:32 2011 -0700 Alex Netes
+1222d7346f7b43e0d0cd000d2a85eb5f9b62cdfc
+
+	* infiniband-diags/scripts/ibcheckport.in: ignore lid/sm lid checks on non zero port switches
+
+Thu Sep 22 13:37:23 2011 -0700 Hefty, Sean
+3d873ba5a7495eaa8afa86195ac2eff1481da553
+
+	* RE: [PATCH v2] ib-diags: Add cast to fix build on windows
+
+Tue Aug 16 13:40:32 2011 -0700 Ira Weiny
+5ba0caf35bf96c17b0f795e787292afc82116b8b
+
+	* Update AUTHORS and make README release notes.
+
+Thu Sep 1 01:47:39 2011 +0000 Hal Rosenstock
+d7f9ad0651276578b2c2ce22dd32496a419f484e
+
+	* infiniband-diags: Fix cap_mask extended link speed supported endian checks
+
+Wed Aug 31 15:26:42 2011 +0000 Hal Rosenstock
+1e62d09ae5d7e4d43089deea07ceb94f8dfd49a0
+
+	* infiniband-diags/ibqueryerrors.c: Add support for FDR10
+
+Wed Aug 31 17:08:50 2011 -0700 Ira Weiny
+95a84b7cc30aae53e4212e6138b95b515287b151
+
+	* infiniband-diags/iblinkinfo.c: Add support for FDR10
+
+Wed Aug 31 17:07:29 2011 -0700 Ira Weiny
+ce6c56fa2165078e9f653428e26368f5393dd081
+
+	* infiniband-diags: Add support for FDR10 to ibnetdiscover
+
+Wed Aug 31 17:06:43 2011 -0700 Ira Weiny
+c8542da6a0c00ab463f8b7a066219baa1afcb43c
+
+	* infiniband-diags: Add FDR10 support to libibnetdisc
+
+Wed Aug 31 15:26:53 2011 +0000 Hal Rosenstock
+1344cb3feacafc462440dabfa5997c5205486d83
+
+	* infiniband-diags/ibstat.c: Add support for FDR10
+
+Mon Aug 29 21:18:31 2011 +0000 Hal Rosenstock
+3133743b5ea6a7d81b7d70e8a83ce4eb28fec8e6
+
+	* infiniband-diags/ibnetdiscover.c: Fix cap_mask endian for extended link speeds
+
+Wed Aug 31 15:26:28 2011 +0000 Hal Rosenstock
+0020ee448d908011f5f68f1e1d297f1abe58b376
+
+	* infiniband-diags/ibportstate: Add support for FDR10
+
+Wed Aug 31 10:38:08 2011 -0700 Albert Chu
+2100e88e994709789207e010f22a6f7a06afeaa7
+
+	* fix manpage typos
+
+Tue Aug 23 16:12:39 2011 -0700 Ira Weiny
+510c0e0d164ca93af5c263074dea04065fee99fa
+
+	* infiniband-diags: ibqueryerrors Clean up exit codes
+
+Wed Jul 6 18:50:27 2011 -0700 Ira Weiny
+0c220a760d9e42581d326899b8bbbafa16799c06
+
+	* infiniband-diags: add human readable output for data counters
+
+Thu Aug 18 14:47:26 2011 -0700 Ira Weiny
+8bc3e398a656a175a29daa61d461e5fa0ad76c56
+
+	* infiniband-diags: move get_msg to common code
+
+Fri Aug 19 16:53:42 2011 +0000 Hal Rosenstock
+6d819a447ce87825c5c6c84723793c7ab9971f3f
+
+	* infiniband-diags/man/ibportstate.8: Update for fdr
+
+Tue Aug 16 13:44:44 2011 +0000 Hal Rosenstock
+ae7695abf3916f3d434dd62c5bacfc5250c36c32
+
+	* infiniband-diags/ibnetdiscover.c: Changes for extended link speeds
+
+Tue Aug 16 13:44:37 2011 +0000 Hal Rosenstock
+2e77e728c219bc55d88be10015b641158e1e61b2
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Changes for extended link speeds
+
+Tue Aug 16 11:13:59 2011 +0000 Hal Rosenstock
+fa92836fcbe1e4255ff9d6bb8cb3a842fa43e38f
+
+	* infiniband-diags/ibqueryerrors.c: Changes for extended link speeds
+
+Tue Aug 16 10:28:39 2011 +0000 Hal Rosenstock
+d7bb3c119f3a20410937c4a83bb01b8afaf30298
+
+	* infiniband-diags/iblinkinfo.c: Changes for extended link speeds
+
+Tue Aug 16 09:14:39 2011 +0000 Hal Rosenstock
+6aab8ab5db478cc46e01c6bc8cfceb32c7e1b42d
+
+	* infiniband-diags/ibportstate.c: Changes for extended link speeds
+
+Tue Aug 16 00:37:15 2011 +0000 Hal Rosenstock
+b550a953e5f8ff7637054377c2f2fde014198f9b
+
+	* infiniband-diags/perfquery: Add support for extended link speeds
+
+Tue Aug 16 00:18:51 2011 +0000 Hal Rosenstock
+a76827fc6b9562c43940bac49d6a9cb9d40df979
+
+	* infiniband-diags/saquery: Add extended link speed support for PortInfoRecord queries
+
+Mon Aug 15 23:54:33 2011 +0000 Hal Rosenstock
+678ec2f9fc14f60038cd77e46d15040b1b159fd4
+
+	* infiniband-diags/smpquery: Add support for extended link speeds
+
+Fri Aug 5 20:44:39 2011 +0000 shefty
+a817e38e5275dcf75404af19b8592c03f4822118
+
+	* ibnetdisc: Fix build for windows
+
+Fri Aug 5 16:59:08 2011 -0700 Ira Weiny
+65818eabe526aee176fc7129e2b5c1b264ba0a3b
+
+	* infiniband-diags: make library dependancies explicit
+
+Wed Aug 3 13:09:00 2011 -0700 Ira Weiny
+6f87728b6f0e230a8706842695a8388a9083b508
+
+	* infiniband-diags: update check for latest dump function in libibmad
+
+Sat Jul 23 11:02:52 2011 +0000 Hal Rosenstock
+d85a6a88f35bae0182c116298ef57cc224bb02dd
+
+	* infiniband-diags/smpquery: Add Mellanox extended portinfo query
+
+Wed Aug 3 17:58:04 2011 +0000 Hal Rosenstock
+c80dc802054484883a92f96fc9ede9f2a9c076df
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Remove compile warning
+
+Thu Jul 14 17:10:52 2011 -0700 Albert L.Chu
+aa80e79a008717bc40145e06a7f693ae5c592179
+
+	* perfquery: support many optional performance counters, including congestion control counters
+
+Tue Jul 26 12:18:02 2011 +0000 Hal Rosenstock
+ae82553337eaab6140582ef782cbd11e32cb1401
+
+	* infiniband-diags/saquery.c: PortInfoRecord now has an options field
+
+Wed Jul 20 10:01:26 2011 -0700 Ira Weiny
+0ee2db536f7e04678664ac51c0f940fa76cbac1c
+
+	* infiniband-diags: ibqueryerrors fix null threshold_str
+
+Thu Jul 14 14:27:07 2011 -0700 Ira Weiny
+1274813595ceaf4c6cc0726e0aa157111ce4ce19
+
+	* infiniband-diags: convert ib[linkinfo|queryerrors] to use PortGUIDs
+
+Thu Jul 14 16:05:30 2011 -0700 Ira Weiny
+ac291237eec71b758401bab4b8d9ec51b6387e79
+
+	* infiniband-diags: libibnetdisc Allow a DR Path partial fabric query starting at a CA
+
+Thu Jul 14 14:25:41 2011 -0700 Ira Weiny
+f3e0901c7dd69f5d5b81f80a9d1c675898569f6b
+
+	* infiniband-diags: libibnetdisc add port interface
+
+Thu Jun 9 22:18:28 2011 -0700 Ira Weiny
+89b6a7b026e85e6ddfa8d47dde951f7accd5fff3
+
+	* infiniband-diags: move core saquery functionality to ibdiag_common
+
+Thu Jun 2 00:13:38 2011 -0700 Ira Weiny
+80628857886b0b26182fcf4e5d17f3c72a90d8b1
+
+	* infiniband-diags: saquery; remove "result" global
+
+Tue Jul 12 11:34:36 2011 -0700 Ira Weiny
+c06655b88bc1b88f3aa42be4d1306b4fa42e3b47
+
+	* infiniband-diags: change perl install to vendorlib
+
+Tue Jun 28 17:50:37 2011 -0700 Ira Weiny
+dee28c9a36941f6c2f8ae69f4a574984254afeb4
+
+	* infiniband-diags: configure.in; check for more recent function in libibmad
+
+Tue Jul 12 11:35:04 2011 -0700 Ira Weiny
+1098eac2138a533e5fdbdfffbe4837763b78ba37
+
+	* infiniband-diags: Add sysconfdir to spec for config files
+
+Thu Jul 7 09:50:12 2011 -0700 Hal Rosenstock
+c8a3e7bf94498459aad16cd298268e7767e9e9ed
+
+	* infiniband-diags: Initial changes for extended speed support in libibmad
+
+Wed Jul 6 14:32:08 2011 -0700 Ira Weiny
+0138f443fc02c3c650a496db851777221b37e74c
+
+	* infiniband-diags: Remove reference to OpenSM from COPYING
+
+Wed Jun 1 21:49:57 2011 -0700 Ira Weiny
+46b1ba489d6ed3bde6a60c95d07233b67439e4f8
+
+	* infiniband-diags: add package requires to spec file.
+
+Sun May 29 18:01:31 2011 -0700 Ira Weiny
+291a922cbcf246e15f0b71ef5d467c6e8bebb6d2
+
+	* infiniband-diags: test for libosmcomp with a function that is used in the code
+
+Mon Jun 20 06:00:56 2011 -0700 Hal Rosenstock
+e9d099eda47f77d456996ce2fc385423ba19cbc0
+
+	* infiniband-diags/ibnetdiscover.c: Fix typo in help
+
+Thu Jun 16 13:52:43 2011 -0700 Hal Rosenstock
+25fad278d4b8a808da5fe0e2ae7042ba18e74fdc
+
+	* infiniband-diags/ibqueryerrors.c: Fix typo in help
+
+Wed Jun 8 05:47:34 2011 -0700 Hal Rosenstock
+22c5087c091b895507882eec85d6b57b641e637f
+
+	* infiniband-diags/libibnetdisc/ibnetdisc_cache.c: Fix a couple of memory leaks
+
+Wed Jun 8 05:47:15 2011 -0700 Hal Rosenstock
+2a75c3e874e0d5edaaf84085f94fc65cd7c5a5be
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Fix possible overrun of path
+
+Wed Jun 8 05:57:55 2011 -0700 Hal Rosenstock
+3364bcd41ec12c357c0510ac86a0cbb0313ca2d6
+
+	* infiniband-diags/ibportstate.c: Fix sizeof
+
+Fri May 13 22:28:55 2011 -0700 Ira Weiny
+1004b7f967df8a09e82d986124d1881b94dcb370
+
+	* infiniband-diags: perfquery; Support PortCountersExtendedNoIETF
+
+Thu May 12 17:31:15 2011 -0700 Ira Weiny
+5ef9bfa5d30baca408f310630de55aa1f0ecfc33
+
+	* infiniband-diags: perfquery; print cap_mask for information
+
+Fri May 27 10:52:05 2011 -0700 Hal Rosenstock
+82849a8212253c7c91ec6ce3ef15655e1c29b5b1
+
+	* infiniband-diags/saquery.c: Fix SA_ERR_UNKNOWN define
+
+Wed May 25 05:30:06 2011 -0700 Hal Rosenstock
+ca54411f41b9192918c971a6a58b373e11e47919
+
+	* infiniband-diags/configure.in: Support override for IBPATH
+
+Tue May 24 11:26:33 2011 -0700 Hal Rosenstock
+1a2ec7c386ae0ee749ac7b66ed0337b9fe1e1f5f
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Better error message
+
+Thu Apr 28 02:09:36 2011 -0700 Eli Dorfman
+87a30707bb36164a11dd1dd24087ca6bd3a333d1
+
+	* infiniband-diags/vendstat: Fixed general info query
+
+Wed Apr 27 01:07:59 2011 -0700 Ira Weiny
+1e406cb50f406a769afbbf806f984775a10dac4d
+
+	* infiniband-diags: ibqueryerrors; add --counters option
+
+Tue Apr 26 22:59:15 2011 -0700 Ira Weiny
+33a76020297553a5fad0f480e41f6ee9d86f12c7
+
+	* infiniband-diags: ibqueryerrors --data; show/clear PortCountersExtended when supported
+
+Tue Apr 26 22:18:27 2011 -0700 Ira Weiny
+214bb92d11e93c76276db471ce88423d32c531a5
+
+	* infiniband-diags: ibqueryerrors; use #defines for CapabilityMask
+
+Mon Apr 25 12:39:12 2011 -0700 Ira Weiny
+3387935ce91193fc7a3d7cdd9adea124f71a7640
+
+	* infiniband-diags: ibqueryerrors; add ibcheckerrors like summary
+
+Wed Apr 27 10:43:01 2011 -0700 Ira Weiny
+cbe10407a14e57c8febe6e039ae617737f0b6e0f
+
+	* infiniband-diags: ibqueryerrors; add error thresholds
+
+Thu Apr 28 07:47:16 2011 -0700 Hal Rosenstock
+53ac239ede48d6a1df8ed1f048cebe2eb2dc38e4
+
+	* infiniband-diags/perfquery.c: Use ib_types.h defines for CapabilityMask
+
+Wed Apr 27 12:48:15 2011 -0700 Hal Rosenstock
+42b5389f870c192627c22470298f8f97764b5979
+
+	* infiniband-diags/ibnetdiscover.c: Eliminate blank line when sysimgguid is 0
+
+Wed Apr 27 11:17:46 2011 -0700 Hal Rosenstock
+d5d44d167696eeffcb31e941ded9da76566dde6d
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Handle calloc failure
+
+Wed Apr 27 10:08:03 2011 -0700 Ira Weiny
+32c0166f2f3afe68a599b107133ea6e6c6e72edd
+
+	* infiniband-diags: fix "dist" target and subsequent rpm building
+
+Mon Apr 25 19:55:22 2011 -0700 Marcus Epperson
+5f9facd634ed8f95d493c78dec5c1bc12795fbee
+
+	* infiniband-diags/ibnetdiscover: Make --ports option use remap_node_name()
+
+Thu Apr 21 14:47:03 2011 -0700 Ira Weiny
+085432de49bcf6ebbcb927e2cac53da32cc9be94
+
+	* infiniband-diags: improve backwards/standalone compatibility
+
+Sun Apr 17 03:06:21 2011 -0700 Ira Weiny
+a398a098d0c21f0993cd3b8e3cd7485d87d6dff8
+
+	* infiniband-diags: iblinkinfo; remove non-supported -c option from man page
+
+Tue Mar 29 17:48:41 2011 -0700 Ira Weiny
+a8c7126ff8cafc828ddbfe3708d25861e5440056
+
+	* infiniband-diags: saquery, clean up error code/return types
+
+Wed Apr 13 09:10:34 2011 -0700 Ira Weiny
+ef2c2d6732c2f4e92a30e33e1bb4911eddd65223
+
+	* infiniband-diags: saquery, properly free mad in get_and_dump_any_records
+
+Sat Apr 9 15:22:02 2011 +0000 Hal Rosenstock
+6df1fdd5aeb16fe17f08b5693b79326e8d78c7d2
+
+	* infiniband-diags: Make sure buffers are set to zero before calling xxx_query_via
+
+Fri Apr 1 18:38:50 2011 +0000 Hal Rosenstock
+a57e627722a5cad227baaae8de22b0af1438008d
+
+	* infiniband-diags.spec.in: Remove duplication of ibdiscover.pl
+
+Thu Mar 17 17:34:52 2011 -0700 Ira Weiny
+9f91f2a277ade5875af43beb9ae246b9534d8279
+
+	* infiniband-diags: saquery; clean up name/lid processing
+
+Mon Apr 26 14:27:32 2010 -0400 Hal Rosenstock
+1ee5bfabda30ae61ac869c380bbfe4bce3d7de1c
+
+	* infiniband-diags/saquery: Add GUIDInfoRecord support
+
+Tue Mar 22 15:11:45 2011 -0700 Jason Gunthorpe
+7596207a1810dd7c5168469b0c3afd86aca8ae50
+
+	* Fix ibdatacounters
+
+Tue Mar 22 14:25:59 2011 -0700 Jason Gunthorpe
+568a1175a1089ebe8ee2d9b6e57086398219ba38
+
+	* Fix missing $IBPATH in ibdatacounts
+
+Mon Feb 14 15:17:15 2011 -0800 Tamir Ronen
+a6abfa00de4e45cedde3616e03de37b3a3430bf2
+
+	* add support for ibnetdiscover grouping for Mellanox switches
+
+Wed Apr 21 17:04:02 2010 -0700 Albert Chu
+450de0f8196a855bfa1f6da7310dc399088a38a5
+
+	* support --filterdownports in iblinkinfo
+
+Tue Apr 20 10:13:05 2010 -0700 Albert Chu
+c9adf42231d0bb1fc09d361c828bbb54b3f3b2f2
+
+	* Add lid and node description diff options for --diffcheck in iblinkinfo
+
+Tue Apr 20 09:53:53 2010 -0700 Albert Chu
+20af5c37bbdb21482f2f35a0ad087e143a207c4b
+
+	* support --diffcheck in iblinkinfo
+
+Mon Apr 19 10:36:54 2010 -0700 Albert Chu
+1950038c3f71bb1eaecb77516f2022c13189fdcc
+
+	* add --diff support to iblinkinfo
+
+Fri Jul 30 14:26:39 2010 -0700 Ira Weiny
+d58cb634194c80b91bac8caf6ab34d7a1b7408fc
+
+	* ibnetdisc.c: Fix partial scan of the fabric.
+
+Mon Feb 14 10:36:13 2011 -0800 Jason Gunthorpe
+d60d71eeb9890e932472c415164b1ff400d73b12
+
+	* The shell scripts use bashism, so use bash directly.
+
+Mon Feb 14 11:56:21 2011 +0200 Alex Netes
+ff57b27e8ec02f4f92e50cbda5caa4b8e6035823
+
+	* infiniband-diags: package versions update
+
+Mon Feb 14 11:53:59 2011 +0200 Alex Netes
+6edf9877048fd050361fbccdfce69fc2c73b1b06
+
+	* infiniband-diags: update shared library versions
+
+Thu Feb 3 18:25:19 2011 +0200 Alex Netes
+b1e4531e2d10a8404cc7873c6f899494cef236c4
+
+	* Makefile: ChangeLog and version generation script path fix
+
+Wed Dec 22 11:47:07 2010 -0800 Ira Weiny
+b260cb4f276b756ded39455969028bcdcd49f60e
+
+	* Further timeout paramater verification (Was: [PATCH] infiniband-diags: Verify timeout value specified to diagnostics)
+
+Wed Dec 15 11:47:09 2010 -0800 Ira Weiny
+298998c77dad10630608374ed1915b506008e79b
+
+	* infiniband-diags: Verify timeout value specified to diagnostics
+
+Tue Aug 3 10:40:56 2010 -0700 Ira Weiny
+8ab2e41e866c27f2ce605fa0bc16b52cd96babf9
+
+	* libibmad/fields.c: Change all PortCounter names to match the Specification
+
+Wed Oct 27 08:47:07 2010 -0400 Hal Rosenstock
+07b4b1afa21a6b4157a69e82b95ad1bc709326c8
+
+	* infiniband-diags/iblinkinfo.c: Limit some queries to switches
+
+Wed Oct 27 09:06:36 2010 -0400 Hal Rosenstock
+0d7e988df53e6ebf1b86d24cebab308527c811ac
+
+	* infiniband-diags/saquery.c: In dump_one_mcmember_record, fix flow label endian
+
+Tue Sep 14 11:10:16 2010 -0400 Hal Rosenstock
+3d00c3eb9ae7019dbb8d9e4c10fdc54af9855dd2
+
+	* infiniband-diags/ibtracert: Eliminate direct route (-D) option
+
+Mon Oct 4 12:16:43 2010 +0200 Yevgeny Kliteynik
+c58dcaa92c3cce03f03a5d4e6fc6e5197ed9674d
+
+	* ibstat.c: fix core dump if wrong port phys state is reported
+
+Thu Oct 7 16:33:01 2010 -0600 Jason Gunthorpe
+f5178760dcdaeecaad9f98a28ed2d32c74908704
+
+	* Fix autotools to include the necessary M4 files
+
+Sun Sep 5 11:30:37 2010 +0300 Eli Dorfman (Voltaire)
+782fd92025d3c97d8822e95be239edd7553c7b80
+
+	* inifiband-diags: Support Voltaire switch ISR4200
+
+Sun Sep 5 11:28:57 2010 +0300 Eli Dorfman (Voltaire)
+5578a9c0b4b8d614880840305badfc81ef5a33d9
+
+	* infiniband-diags: Do not exit when unexpected node found
+
+Sat Sep 4 14:15:33 2010 +0300 Sasha Khapyorsky
+843d2bb428f5e9fda3628252abcedd69300ee9c0
+
+	* management: packages versions update
+
+Sat Sep 4 14:13:06 2010 +0300 Sasha Khapyorsky
+3eabf4227a7267c52e7be496ffdfb857018c6c83
+
+	* management: update shared library versions
+
+Wed Aug 25 14:08:02 2010 -0400 Hal Rosenstock
+c02bdb17ef04162968e88379b5ab86f10935ba9b
+
+	* infiniband-diags/ibnetdiscover: Fix handling of CA ports in recv_port_info
+
+Thu Aug 26 16:14:16 2010 +0300 Doron Shoham
+843a0072a86afe85e053dceb402c2d62bb38e002
+
+	* ibnetdiscover: add '-f' flag to show full information (ports' speed and width).
+
+Sun Aug 1 20:26:11 2010 +0300 Sasha Khapyorsky
+a387f265398c671e9067e055bbebaa634fb4aa49
+
+	* infiniband-diags/ibstat: convert to PRIx64 macros GUID printing
+
+Mon Jul 26 11:40:30 2010 -0700 Hefty, Sean
+732bac4c01d9e6f2da203ad1a2df241cc5d70cab
+
+	* libibnetdisc: fix cast in unmarshall16
+
+Wed Jun 16 07:05:42 2010 -0400 Hal Rosenstock
+30309edcc97a452ca38cb3f3e8ae278c2a811618
+
+	* infiniband-diags/perfquery.8: Add some missing counters to description
+
+Thu May 6 13:49:55 2010 -0700 Ira Weiny
+074ef7c2578b8837428ea12bffb7803336a113eb
+
+	* ibqueryerrors.c: Optimize by querying AllPortSelect first
+
+Thu Jun 10 18:03:03 2010 +0300 Eli Dorfman (Voltaire)
+35a3ce2a8d9374e0f10f56faf8c4d86e30e38299
+
+	* fix MFT record dump
+
+Wed Apr 21 11:19:44 2010 -0700 Al Chu
+9151e22daf3f7c0ff478bc0af77d1281efa52e75
+
+	* support diffing lids and nodedesc on remoteports in ibnetdiscover
+
+Tue Apr 20 15:30:40 2010 -0700 Al Chu
+d84c9d4ea679a13e64952cf4f45862b6a90c5074
+
+	* support diffing nodedesc on remoteports in ibnetdiscover
+
+Mon Apr 19 11:43:34 2010 -0700 Al Chu
+5763f49eb3d5ba3ba33a05b34790c28d1d7ff727
+
+	* add ibcacheedit tool
+
+Mon Apr 19 11:43:15 2010 -0700 Al Chu
+08512b831eaf13f4c8e8b2d4a00b660ade8efa32
+
+	* support libibnetdisc caching no-overwrite flag
+
+Mon Apr 19 11:43:07 2010 -0700 Al Chu
+38181cf26e31a93b48e91576cc360e3d3de85e98
+
+	* make libibnetdisc default behavior to overwrite a cache
+
+Wed Jun 2 13:15:31 2010 -0700 Hefty, Sean
+e6ae86f02337167843d9e3b1011e27cb26ab8fd0
+
+	* ib/mgmt: fix build under windows stack
+
+Wed Jun 2 09:05:19 2010 -0400 Hal Rosenstock
+e8f783c5a65d1f3452b84f3a321c448c226d2bf7
+
+	* infiniband-diags/ibnetdiscover.c: Cosmetic changes
+
+Wed Jun 2 09:04:15 2010 -0400 Hal Rosenstock
+cbcde100c7eb9387aad69811f969240471b99668
+
+	* infiniband-diags/libibnetdisc/chassis.c: In group_nodes, set fabric->chassis
+
+Wed Jun 2 09:02:54 2010 -0400 Hal Rosenstock
+d6ddf46c171b2f8e38a910e75b2ff503d149450b
+
+	* infiniband-diags/libibnetdisc/chassis.c: In group_nodes, pass on all nodes
+
+Tue May 25 13:32:18 2010 -0700 Ira Weiny
+c09b93cfe52854ff8e8f2aab5177ef2c0b34e93f
+
+	* libibnetdisc: move ibmad_port out of smp_engine
+
+Mon May 24 15:45:08 2010 -0400 Hal Rosenstock
+37b6c70f7f607dd41170fee967859400ce16d553
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: Fix compile warns on 32 bit archs
+
+Mon May 24 21:53:15 2010 +0300 Sasha Khapyorsky
+076189da8896da13a8f7eb9786768120ce1ed017
+
+	* infiniband-diags/vendstat: allow multiple config space records
+
+Mon May 24 21:53:15 2010 +0300 Sasha Khapyorsky
+dc7b66e6fb3353fcb4ecf4e98453f11163282d4b
+
+	* infiniband-diags/vendstat: add config space access options
+
+Mon May 24 20:37:29 2010 +0300 Sasha Khapyorsky
+1db6d9db939d76888568624d530293936c05a25f
+
+	* infiniband-diags/vendstat: code simplifications
+
+Sat May 22 18:00:16 2010 +0300 Sasha Khapyorsky
+210775cb6cd383a19a5dadb42a9da97d83aaf118
+
+	* management: packages versions update
+
+Sat May 22 17:52:50 2010 +0300 Sasha Khapyorsky
+9c01c858ed5e6f0d1602315633206964e797ea07
+
+	* management: update shared library versions
+
+Sun Apr 25 14:04:07 2010 +0300 Eli Dorfman (Voltaire)
+92b4f4be3a69f95de4157c46132f1f0caeca929e
+
+	* opensm: Always set enabled speed and width
+
+Tue May 11 15:36:08 2010 -0700 Ira Weiny
+ae0675b483b7e8834b5163c15eead36162709b66
+
+	* ibnetdisc: Separate calls to umad and mad layer to avoid race condition on response MAD's
+
+Tue Apr 27 14:35:29 2010 +0200 sebastien dugue
+21ec4a345a6aff6993989b0e86620e62e1f4caf5
+
+	* libibnetdisc: Add grouping for Voltaire's ISR4700 switch
+
+Thu May 6 13:34:46 2010 -0500 Mike Heinz
+3eb3622ba70363c9975f3bb5a608e437508cbcd2
+
+	* RE: [PATCH] management: adding mad_dump_fields to libibmad
+
+Thu May 6 13:30:02 2010 -0500 Mike Heinz
+0176eec5b554dc9bb7a121482afe51e43b410de8
+
+	* RE: [PATCH] management: adding mad_dump_fields to libibmad
+
+Mon Apr 19 18:08:19 2010 +0300 Sasha Khapyorsky
+1a4b90a74be9ae47d51485e2ed29a18b1a1e26eb
+
+	* libibnetdisc: fix indentations
+
+Wed Apr 14 15:48:01 2010 -0700 Al Chu
+116e64efe8dd4e91a264778996f401cfb57a3497
+
+	* check for duplicate port guids in libibnetdisc cache
+
+Wed Apr 14 15:47:49 2010 -0700 Al Chu
+a4a7f4707734bf72ff5177397da661f0583ea158
+
+	* fix libibnetdisc cache error path memleak
+
+Wed Apr 14 10:48:03 2010 -0700 Al Chu
+e8cd82856a6cca259f0592bb4a6233eb0146d053
+
+	* fix libibnetdisc portguid hashing corner case
+
+Fri Apr 16 19:31:43 2010 +0300 Sasha Khapyorsky
+97161a8523e5e94da9f6bfc3fb555daf35fb3c7c
+
+	* libibnetdisc: remove not needed num_smps_outstanding counter
+
+Fri Apr 16 15:14:00 2010 +0300 Sasha Khapyorsky
+eea29a4b4d0fdd75c75595ffa2317fffc872dbf6
+
+	* libibnetdisc: remove not needed process_smp_queue() call
+
+Fri Apr 16 19:31:43 2010 +0300 Sasha Khapyorsky
+2c89899269aff81dce048ae9a6a7a5d17c1aad10
+
+	* libibnetdiscover: more outstanding MADs counting fix
+
+Fri Apr 16 15:10:30 2010 +0300 Sasha Khapyorsky
+a9989e08fbb9e69dc7d69ad7c96d289b01d22e16
+
+	* libibnetdisc: fix memory leak in case of send_smps() failure
+
+Fri Apr 9 04:48:15 2010 +0300 Sasha Khapyorsky
+c22a907d93a8eadde12f5af75a7c571454880986
+
+	* libibnetdisc: config struct for ibnd_discover_fabric()
+
+Tue Apr 13 20:41:59 2010 +0300 Sasha Khapyorsky
+60514dcb474325d3b8a99007efbe3ee522ede710
+
+	* libibnetdisc: don't query CA ports not connected to a fabric
+
+Tue Apr 13 19:54:45 2010 +0300 Sasha Khapyorsky
+0914ffdf6538c271d5de12a6db945796e03851c6
+
+	* libibnetdisc: don't try to cross discovery over CA
+
+Tue Apr 13 19:30:23 2010 +0300 Sasha Khapyorsky
+001dc72c15ee5329bba9966018c4ab84d436ce9b
+
+	* libibnetdisc: fix outstanding SMPs countung
+
+Tue Apr 13 17:54:38 2010 +0300 Sasha Khapyorsky
+7ff1e266c3f48c8f0bdf59b9e606ec538726ba3a
+
+	* libibnetdisc: add \n at end of error messages
+
+Tue Apr 13 15:48:30 2010 +0300 Sasha Khapyorsky
+a17e36656a53ca9363ef6b6b3ffb58a434c0f70c
+
+	* infiniband-diags/ibnetdiscover: cleanups
+
+Wed Apr 7 10:06:43 2010 -0700 Al Chu
+1b60fb0afd6383e94d0d626dbd10a12136f6b635
+
+	* support lid and nodedesc diffchecks in ibnetdiscover
+
+Wed Apr 7 10:06:32 2010 -0700 Al Chu
+f6d4848d3c7462c4140a4050e61b96bf9efb6924
+
+	* support --diffcheck in ibnetdiscover
+
+Wed Apr 7 10:05:38 2010 -0700 Al Chu
+90df93c4ec0e6bec20bef88de4c8bce3e0284362
+
+	* support --diff in ibnetdiscover
+
+Fri Apr 9 10:24:50 2010 -0700 Al Chu
+ee9cd9d43ef94454d93c77988efb0c3f0ec45d9e
+
+	* fix libibnetdisc corner case when user tries to re-cache a loaded cache
+
+Sat Apr 10 02:43:24 2010 +0300 Sasha Khapyorsky
+937eaaccc0f3a32a861333d5018e3fb8e35feb68
+
+	* libibnetdisc: no backward NodeInfo queries
+
+Sat Apr 10 02:16:40 2010 +0300 Sasha Khapyorsky
+b5c7dc59cebfcea80a7a853ace8d7e8316f0b689
+
+	* infiniband-diags/ibnetdiscover: report number of used MADs
+
+Sat Apr 10 02:07:07 2010 +0300 Sasha Khapyorsky
+c690e85eb3822b557bf0fefcf53f03ff403d8cfb
+
+	* libibnetdisc: keep total number of used SMPs
+
+Sat Apr 10 01:01:44 2010 +0300 Sasha Khapyorsky
+4f55f7cd7e8d45ca49c3e107607d5758c6ba3448
+
+	* libibnetdisc: restore hops limited discovery
+
+Sat Apr 10 00:14:27 2010 +0300 Sasha Khapyorsky
+baae94d9af69e246038f970a5b30ae6d8126aed8
+
+	* libibnetdisc: restore show_progress functionality
+
+Fri Apr 9 03:35:29 2010 +0300 Sasha Khapyorsky
+85e417e33d777cc515040b561eb6a5e3511e09b7
+
+	* libibnetdisc: code cleanups
+
+Tue Feb 2 14:06:03 2010 -0800 Ira Weiny
+f518fb5a780fcbec37b54803508abdc9e60e6ac3
+
+	* libibnetdisc: add ibnd_set_max_smps_on_wire call
+
+Fri Jan 22 17:33:30 2010 -0800 Ira Weiny
+089f028dcd5cf4a121a02bec80f3ca54c2e55494
+
+	* libibnetdisc: Convert to a multi-smp algorithm
+
+Tue Mar 9 12:41:15 2010 +0200 Yevgeny Kliteynik
+1226619d64fb4d6bbedba7d04ede5df497057fb6
+
+	* infiniband-diags/ibstat.c: print link layer for RoCEE support
+
+Tue Mar 9 12:37:38 2010 +0200 Yevgeny Kliteynik
+a6cc34bfbc10a93c823668b10bcc39191f044a81
+
+	* infiniband-diags/ibstatus: add link_layer for RoCEE support
+
+Thu Mar 4 15:01:44 2010 -0600 Mike Heinz
+b0caed9bb5f0d1fe80d0c66519bccaaa852e4dbd
+
+	* Perfquery can be too noisy.
+
+Thu Mar 18 18:35:34 2010 -0700 Ira Weiny
+30b8c9067ca388f9291e6298a65c077a568d2981
+
+	* infiniband-diags: Ignore PortInfo data on down port.
+
+Tue Feb 2 17:43:20 2010 -0800 Ira Weiny
+156cd056ab5ef0e69053f5bf324e1835cc67c6d9
+
+	* libibnetdisc: fix typo in man page for ibnd_show_progress
+
+Wed Feb 10 09:32:05 2010 -0500 Hal Rosenstock
+74d69f75fc9bdc72a604a05b9511b5d2dac256f7
+
+	* infiniband-diags/vendstat: Indicate general info for IS4 as well as IS3
+
+Mon Jan 25 08:32:45 2010 -0500 Hal Rosenstock
+17adabc46e41157ea8983ffc52ae16c34d29922c
+
+	* infiniband-diags/ibqueryerrors.c: Fix typo in counter name
+
+Tue Jan 19 15:47:12 2010 +0200 Sasha Khapyorsky
+ce85937be777a9686f58e37bdbbadc0f612bab0f
+
+	* infiniband-diags/iblinkinfo,ibqueryerrors: code refactoring
+
+Mon Jan 18 21:35:51 2010 -0800 Al Chu
+256269defbd56c5bc475f65488267db6e3f5c6b6
+
+	* support --load-cache in iblinkinfo and ibqueryerrors
+
+Tue Jan 12 20:56:20 2010 +0200 Sasha Khapyorsky
+6afc4b05e85c2864c48868a95d82da063676358d
+
+	* ibqueryerrors.c: more readable details dump function
+
+Thu Dec 31 14:10:54 2009 -0500 Hal Rosenstock
+f1d70f4a2a9d6f1d267c7f20b6fdcbd3a64e48a8
+
+	* infiniband-diags/ibqueryerrors: Add support for optional PortRcvErrorDetails counter
+
+Sat Jan 16 20:29:29 2010 +0200 Sasha Khapyorsky
+5d4f4bda8f0e96a407e4b5de9d38798b051604a5
+
+	* infiniband-diags: indentation fixes
+
+Fri Jan 15 10:23:16 2010 -0800 Al Chu
+3d5c94091ce0fc7da8ebf79affac67d1fc92b75b
+
+	* support --cache and --load-cache options in ibnetdiscover
+
+Fri Jan 15 10:23:13 2010 -0800 Al Chu
+01b8045f28f6c1fd6a4dd170e8a89b85e7ff1ad2
+
+	* add libibnetdisc caching to libibnetdiscover
+
+Thu Jan 14 09:13:24 2010 -0500 Hal Rosenstock
+cd383d54dba7e43a1f2de77382c6c31187571491
+
+	* infiniband-diags/perfquery: Add support for PortSamplesControl counter
+
+Wed Jan 13 15:23:18 2010 -0500 Hal Rosenstock
+c259589b1f75e4a6c8d9ea16e8ee0f71c828ac75
+
+	* infiniband-diags/ibportstate.8: Add new supported ops
+
+Thu Dec 31 11:58:34 2009 -0500 Hal Rosenstock
+eae275ce547dd148d7526974b601ccdaa03f9cd7
+
+	* infiniband-diags/perfquery: Add support for optional PortRcvErrorDetails counter
+
+Thu Nov 5 11:56:56 2009 -0800 Ralph Campbell
+b8bbcef89b68865f3fc522a2973131442ca06581
+
+	* infiniband-diags/ibportstate: allow changes to CA portinfo parameters
+
+Tue Jan 12 11:14:15 2010 +0200 Sasha Khapyorsky
+c7589c66ff78f72cf2817e6864b9c43e49dfbd52
+
+	* infiniband-diags: -V, --version: exit with zero status
+
+Tue Dec 29 09:30:49 2009 -0500 Hal Rosenstock
+a5427f83c976ae0bbeee6b4d3f7afe38bf87ee0c
+
+	* infiniband-diags/ibqueryerrors.c: Fix output format of counters
+
+Thu Dec 24 15:14:41 2009 +0200 Sasha Khapyorsky
+a02a72e79fb350e23da731c313a281a6b0c0ca0d
+
+	* management: packages versions update
+
+Thu Dec 10 13:24:01 2009 -0800 Al Chu
+d70ab89db505c9ccaf8d0f9231cfcc6344aba038
+
+	* correct manpages for tools that are no longer scripts
+
+Thu Dec 10 11:38:38 2009 -0800 Al Chu
+2f0ba97a07db2bd307f589823fb6ffc7bbd479b7
+
+	* remove obsoleted option from iblinkinfo manpage
+
+Sun Dec 13 19:39:11 2009 +0200 Sasha Khapyorsky
+8596afb4a92181eb2055123cbcca73715a177cf7
+
+	* management: package versions bump
+
+Sun Dec 13 19:36:19 2009 +0200 Sasha Khapyorsky
+3ef00cf4084364fd3779eb673348d525122976a3
+
+	* management: update library versions
+
+Tue Nov 17 10:17:30 2009 -0800 Al Chu
+a498f70a59397120f1799645944255d2c1f57401
+
+	* splice out chassis scan specific from general scan in libibnetdiscover
+
+Tue Nov 17 10:17:20 2009 -0800 Al Chu
+8b1d334b64a7ef7451c796268332fcf15bfc882e
+
+	* use nodes/switches lists instead of nodesdist array in libibnetdiscover
+
+Tue Nov 17 10:16:14 2009 -0800 Al Chu
+d365a61048d93cc9f65a9826d9b10f107d56150e
+
+	* remove unnecessary casting in libibnetdiscover
+
+Mon Nov 23 12:04:19 2009 +0200 Doron Shoham
+97f3fd404d39053f008e68d46c4baff8f4ce2fe1
+
+	* Add different print macros
+
+Fri Nov 13 09:52:16 2009 -0800 Al Chu
+0d3e5accc016609e7dfce6331d4d44252182ec16
+
+	* split out scan specific data from ibnd_node_t [attempt #2]
+
+Tue Nov 3 20:17:14 2009 -0800 Ira Weiny
+e51da7bd0efedd17f4252c09c833a280e08eb1df
+
+	* infiniband-diags/ibqueryerrors: Properly exit and clean up resources when node info query fails
+
+Tue Nov 3 20:22:38 2009 -0800 Ira Weiny
+8f8736a6a6993f718ecd47c4bf3d001f68b25229
+
+	* infiniband-diags/ibqueryerrors: Change realloc of suppressed fields to a static array
+
+Tue Nov 3 19:51:32 2009 -0800 Ira Weiny
+587a6f8ce63933ca004f5fca216f7616fd64f342
+
+	* infiniband-diags/ibqueryerrors: Fix remote node name printing
+
+Fri Nov 6 10:14:24 2009 -0800 Al Chu
+190451c0b7ff164b198d999aeaaa30016bfa7793
+
+	* fix potential segfault in ibnd_node_t destroy path
+
+Fri Nov 6 10:14:21 2009 -0800 Al Chu
+a95d8789c55bd06ae62b80c4d32f889289893efd
+
+	* consistently type lids and lmcs libibnetdisc
+
+Tue Nov 10 13:51:41 2009 -0800 Ira Weiny
+10861458f2b3034262bb9a01125704d9709cc6e1
+
+	* infiniband-diags/libibnetdisc: Remove nearly duplicate "get_node_info" function
+
+Tue Nov 10 14:01:37 2009 -0800 Ira Weiny
+8ad91fd22ae4b0d1bfd504218a02899d3263b576
+
+	* infiniband-diags/libibnetdisc: clean up PortInfo queries
+
+Thu Nov 12 19:20:39 2009 +0200 Sasha Khapyorsky
+ccf687f2949256973153c38f5e34a31ecf47337d
+
+	* infiniband-diags/ibqueryerrors: minor improvements
+
+Tue Nov 3 13:58:03 2009 -0800 Ira Weiny
+8d673b478e78d5f0e4ff606f55c19f942cc8db4c
+
+	* infiniband-diags/ibqueryerrors: Reformat the output of the xmtdiscard details.
+
+Fri Nov 6 15:32:25 2009 -0500 Hal Rosenstock
+3a3734befe391e891ae18bbb925897fe6edb4a46
+
+	* infiniband-diags/saquery.c: Change lids and port numbers to decimal
+
+Fri Nov 6 10:59:00 2009 -0500 Hal Rosenstock
+e11ee0b20b01fabe91f482eb91a90e5849b824c5
+
+	* infiniband-diags/ibsendtrap.c: Add support for SysImageGuid changed trap (145)
+
+Fri Nov 6 17:54:48 2009 +0200 Sasha Khapyorsky
+b363af1580ac214dfa24662285a0b4d6a5d2fecf
+
+	* libibnetdisc: remove man page of removed API
+
+Mon Nov 2 11:33:17 2009 -0800 Al Chu
+2cc2bf56e95ba43cf1b8bdc7c2953e71976de331
+
+	* remove ibnd_update_node
+
+Tue Nov 3 17:03:15 2009 -0800 Ira Weiny
+3d44880d512c76f3494037a1973ffdf45205964d
+
+	* infiniband-diags/ibnetdisc.h: Clarify "ports" member of ibnd_node_t with more descriptive comment
+
+Wed Nov 4 09:42:19 2009 -0500 Hal Rosenstock
+b61a2910d09a09d58a0ead85dd6db5654fb89aaa
+
+	* infiniband-diags/ibqueryerrors: Add support for PortXmitDiscardDetails
+
+Tue Nov 3 10:37:29 2009 -0800 Al Chu
+abc34ab016bb8f006d394a24c2107ec08b2fab7c
+
+	* remove unused headers in libibnetdiscover
+
+Mon Nov 2 11:40:19 2009 +0200 Eli Dorfman (Voltaire)
+84377df7ce7146b1bf6d9d702bd29d509e8b1d37
+
+	* infiniband-diags/saquery: Report SA MAD Class specific status.
+
+Sun Nov 1 21:55:47 2009 +0200 Sasha Khapyorsky
+0b1c91a77dec80e2d2c39e3f6484f095c0d41175
+
+	* management: bump package versions
+
+Sun Nov 1 21:42:56 2009 +0200 Sasha Khapyorsky
+8baf219009567aacb067764323d006cbbd9f69f7
+
+	* management: update libraries version information
+
+Mon Nov 2 02:09:14 2009 +0200 Sasha Khapyorsky
+edb6c696d5570ed77da48fda8813b1d79604261d
+
+	* management: update/add Voltaire copyright
+
+Fri Oct 30 00:49:36 2009 +0200 Sasha Khapyorsky
+929e69b5de0b131d66ab15356e2dd386b870e81c
+
+	* infiniband-diags/perfquery: merge some code
+
+Wed Sep 23 09:29:43 2009 -0400 Hal Rosenstock
+3b0b12cd867006e2e918b9a97b6721dfb5025fed
+
+	* infiniband-diags/perfquery: Add support for optional PortXmitDiscardDetails counter
+
+Thu Oct 29 23:34:27 2009 +0200 Sasha Khapyorsky
+d557de94aa4ca0f4fdaca8948d49e37cbae215e2
+
+	* libibnetdisc: some cleanups
+
+Thu Oct 29 23:11:29 2009 +0200 Sasha Khapyorsky
+80c220bd2c8fe3c8abb8b9d10a23b1377d744fbb
+
+	* libibnetdisc: rename ibnd_scan variable to scan
+
+Wed Oct 28 16:52:11 2009 -0700 Al Chu
+9e92e25de600c088034351c83088e6a4e5d8cc11
+
+	* remove 'dist' field from ibnd_node_t, which was virtually not used
+
+Wed Oct 28 16:52:09 2009 -0700 Al Chu
+29003140079845c69888622ababf200e424fdf5f
+
+	* split out ibnd_fabric_t fields that are only used during a scan
+
+Tue Oct 27 10:22:36 2009 -0700 Ira Weiny
+2d237d0b99560b44f41ce8716a39edc31abdf7e6
+
+	* infiniband-diags/ibqueryerrors: Use remap'ed node name in clear port error message
+
+Fri Oct 23 13:57:46 2009 -0400 Hal Rosenstock
+7107a106aeb0a283da875e7bbe955b3e4c28f781
+
+	* infiniband-diags/ibqueryerrors.c: Cosmetic changes
+
+Wed Oct 14 09:44:35 2009 +0530 Keshetti Mahesh
+609e037c3723bc759293ec9c343969daf236a8fc
+
+	* infiniband-diags/libibnetdisc: Removed trivial comments
+
+Fri Oct 23 18:20:59 2009 +0200 Sasha Khapyorsky
+fb9503355addb8e01b0903ba2fab21ec7f98fc1a
+
+	* infiniband-diags/ibqueryerrors.c: use common node_name
+
+Fri Oct 23 17:08:29 2009 +0200 Sasha Khapyorsky
+7a0d07dc019b206b8c98e85bf10707fa0dd8fec1
+
+	* infiniband-diags/ibqueryerrors.c: use common portid in query_cap_mask()
+
+Fri Oct 23 17:02:22 2009 +0200 Sasha Khapyorsky
+2aca4b06068a049781387d240a85f468cf9b8633
+
+	* infiniband-diags: minor cosmetic fixes
+
+Fri Sep 25 09:33:58 2009 -0700 Ira Weiny
+21b42954dceeb4924b7f4e57c37250b3bdcd7f0b
+
+	* infiniband-diags/src/ibqueryerrors: Add clear errors and counters options
+
+Wed Oct 7 10:35:25 2009 -0700 Ira Weiny
+de9d8f08fc127f09e6f3825686806f59b5c821b4
+
+	* infiniband-diags/libibnetdisc/ibnetdisc.c: fix bug in single node processing.
+
+Tue Oct 13 09:04:54 2009 -0400 Hal Rosenstock
+65f305cc51d07aa53437e961b43f69005361d0a8
+
+	* infiniband-diags/saquery.c: Modify dump_path_record
+
+Tue Sep 29 14:22:46 2009 +0200 Sasha Khapyorsky
+642160c80693b4f8fd038e04dd728da1431734dc
+
+	* infiniband-diags/ibqueryerrors: simplify node_type_to_print setup.
+
+Wed Sep 23 11:38:11 2009 -0700 Ira Weiny
+e426d5b7f495550f28b558917eae074bea75600f
+
+	* infiniband-diags/src/ibqueryerrors.c: Remove --all option and replace it with --switch, --ca, --router
+
+Wed Sep 23 14:26:55 2009 -0700 Ira Weiny
+c92b21e9a15fbdabc7f37b986cb036276f02e939
+
+	* infiniband-diags/src/ibqueryerrors.c: fix bug when attempting a sub-fabric scan
+
+Tue Sep 22 19:59:36 2009 -0400 Hal Rosenstock
+a74d1210266cc8aca0169f5a1e9b43bbf7673948
+
+	* infiniband-diags/ibportstate.c: Eliminate uninitialized variable compile warning
+
+Mon Sep 14 12:59:33 2009 +0200 sebastien dugue
+f80eefd7c31e0c511794d582d05611fb30f83be4
+
+	* infiniband-diags/ibnetdiscover: Add separator when printing chassis type
+
+Sun Sep 13 19:23:13 2009 +0300 Doron Shoham
+59d05a9509ae337b7d5786c0970dce88a4fa9b1a
+
+	* ibportstate: fixes for width option
+
+Tue Sep 8 18:11:37 2009 -0400 Hal Rosenstock
+0987cc1e8cbdc683838794429d873b07d72a7077
+
+	* infiniband-diags/ibportstate: Support changing of link width
+
+Wed Sep 16 09:12:14 2009 +0530 Keshetti Mahesh
+31710227062002f12b1c2b2ca51878f98e6d7bcb
+
+	* 'ibcheckportwidth' : Exit if LWS is 1X
+
+Tue Sep 15 17:09:29 2009 +0530 Keshetti Mahesh
+d8b07f4ca62f6167698e83a8afcef08d424ffa44
+
+	* infiniband-diags/: Cosmetic changes, mostly typos
+
+Mon Aug 31 19:45:44 2009 +0300 Sasha Khapyorsky
+fe9319b87d22f139b0c6c58c364b0c4c0974b0ba
+
+	* infiniband-diags/ibroute: minor flow optimization
+
+Sun Aug 30 12:32:07 2009 -0400 Hal Rosenstock
+127ddeb0b59f9996d45fba20175b844b466a7342
+
+	* infiniband-diags/ibroute: Add support for MulticastFDBTop
+
+Sun Aug 30 15:39:33 2009 +0300 Sasha Khapyorsky
+946624a269122d579c7bdd52dc80596c83384e7f
+
+	* libibnetdisc: fix compilation warning
+
+Wed Aug 26 09:25:00 2009 -0700 Ira Weiny
+c0d2f74c6f8ac227f9eecffd4905fe60b73e3a20
+
+	* libibnetdisc: add retract_dpath function
+
+Fri Aug 21 15:01:00 2009 -0700 Ira Weiny
+b50abf9bbca002a79aa4b80327cd42c8287ea74c
+
+	* infiniband-diags/libibnetdisc: add missing '\n' to error message
+
+Sun Aug 30 15:29:24 2009 +0300 Sasha Khapyorsky
+4e7655c49bc612215b379f3f171490c0f20be123
+
+	* infiniband-diags/perfquery: indentation fixes
+
+Wed Aug 26 12:12:23 2009 -0400 Hal Rosenstock
+7400343098e38dc9a22b80914a803a30bd6aeae0
+
+	* infiniband-diags/perfquery.c: Indicate whether PortXmitWait counter is supported
+
+Wed Aug 26 17:37:30 2009 +0300 Eli Dorfman (Voltaire)
+1ddb09cf33e08068e813f4fb7038c6addadea3b2
+
+	* Fix IB network discovery from switch node.
+
+Mon Aug 17 14:03:38 2009 -0700 Ira Weiny
+2180add45e2b95ea69d0c14eb09d609b637b0e14
+
+	* libibnetdisc: make all fields of ibnd_fabric_t public
+
+Sun Aug 16 07:02:24 2009 -0400 Hal Rosenstock
+4bf42172903fa14c6c21eea125623434bdfb3ccc
+
+	* infiniband-diags/saquery.c: Allow pkey and qkey to be hidden
+
+Sat Aug 15 09:46:24 2009 -0400 Hal Rosenstock
+12504d1532991c680212eacd3af1cbfa995c9f88
+
+	* infiniband-diags/saquery.c: Fix CHECK_AND_SET_VAL macro
+
+Thu Aug 13 19:54:00 2009 -0700 Ira Weiny
+efbce75536679fe07c4dd2f9e9cc494a26c2cd9f
+
+	* libibnetdisc: make all fields of ibnd_port_t public
+
+Sun Aug 16 13:22:09 2009 +0300 Sasha Khapyorsky
+fb94a681aaa1d56e69fe9975b07b0ca05c9be14b
+
+	* libibnetdisc: fix again typo in dump_node()
+
+Tue Aug 11 15:15:21 2009 -0700 Ira Weiny
+d6f2d1fd279f39fd0243a1e10c13ef9ed1950db2
+
+	* libibnetdisc: make all fields of ibnd_node_t public
+
+Fri Aug 14 10:52:49 2009 -0400 Hal Rosenstock
+32c65e163cf4ca64b4db4adb68afb5962d3c1d23
+
+	* infiniband-diags/saquery.c: Fix typo in option name
+
+Fri Aug 14 13:15:03 2009 +0300 Sasha Khapyorsky
+832b9162b84741f9288f0427a24c1a06493f7f60
+
+	* infiniabnd-diags: indentation fixes
+
+Fri Aug 14 04:40:54 2009 +0300 Sasha Khapyorsky
+898ffb9f282e1cc1de5a0d17ede549383a4733e7
+
+	* infiniband-diags/ibportstat.c: simplify conditions
+
+Fri Aug 14 04:36:24 2009 +0300 Sasha Khapyorsky
+ea58a37aac5158be2b8a2d7b267eef29e0469956
+
+	* infiniband-diags/ibportstate.c: consolidate flows
+
+Thu Aug 13 15:37:50 2009 +0300 Sasha Khapyorsky
+4e0fb746fa86be7badb067d5f75b92dc362885e4
+
+	* libibnetdisc: indentation fixes
+
+Thu Aug 13 15:25:50 2009 +0300 Sasha Khapyorsky
+0c033c2da354c20afe805d3f3f145b6c867180a5
+
+	* libibnetdisc/ibnetdisc.c: typo fix
+
+Wed Aug 12 16:53:20 2009 -0700 Ira Weiny
+676bd9f565fb6a8ab72cdc77c03ccf734a1b6917
+
+	* infiniband-diags/libibnetdisc: remove all IBPANIC's and clean up error handling
+
+Fri Aug 7 09:05:44 2009 -0700 Ira Weiny
+db808b6ecfab52fbeb75816092263033de96d307
+
+	* libibnetdisc: fix potential memory leak of port object
+
+Wed Aug 5 10:29:31 2009 +0300 Sasha Khapyorsky
+cf5922b9bd38f545ef33963fd32896ca25f4b04e
+
+	* infiniband-diags/ibsendtrap.c: code consolidation
+
+Wed Aug 5 10:24:32 2009 +0300 Sasha Khapyorsky
+7c5b3323b29f25e6baaac7934d4f540e41b5eb11
+
+	* infiniband-diags/ibsendtrap.c: fix array size
+
+Tue Aug 4 08:50:09 2009 -0400 Hal Rosenstock
+4b78754846dfe7ebd0ee86d074b4c6662d657e7f
+
+	* infiniband-diags/ibsendtrap.c: Add support for link_speed_enabled_change trap
+
+Mon Aug 3 16:39:57 2009 -0400 Hal Rosenstock
+395d4d003d63fa5005c4418bf3c6055ca80705be
+
+	* infiniband-diags/ibsendtrap.c: Fill in capability mask on trap 144
+
+Mon Aug 3 15:22:56 2009 +0300 Sasha Khapyorsky
+9d60102edae3f9dbfe20686aa6df34e1219e9504
+
+	* infiniband-diags/man: break long lines
+
+Sun Aug 2 20:15:32 2009 -0400 Hal Rosenstock
+17b317ae81ec6999c608f81b422159bc4194fe11
+
+	* infiniband-diags/ibnetdiscover.8: Add max hops option
+
+Sun Aug 2 10:55:37 2009 +0300 Sasha Khapyorsky
+fbc728662320140a66db48bded71c7e1a3d94949
+
+	* infiniband-diags/ibnetdiscover: remove not used var
+
+Mon Jul 27 10:13:01 2009 -0700 Al Chu
+dfbb9603f8f87c5709573f6f031da256153f9e02
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:59 2009 -0700 Al Chu
+3eb0af51f36c75691afbd46e1a8eca2d86143cf3
+
+	* fix libibnetdisc API consistency and bugs
+
+Sat Aug 1 02:59:50 2009 +0300 Sasha Khapyorsky
+5d06b65f612802565e7fc7cf1bf8fc84f3d96806
+
+	* bibnetdisc/ibnetdisc.c: fix parameter incompatibility warning
+
+Mon Jul 27 10:12:51 2009 -0700 Al Chu
+8092614f5309ed111516dde50bd3390a611d155b
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:41 2009 -0700 Al Chu
+3fa0a9d8db3430fa7e21b1d528db85ab6833639b
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:36 2009 -0700 Al Chu
+47323f3b253593863a3862c18b3ffb4c0aa42e89
+
+	* fix libibnetdisc API consistency and bugs
+
+Mon Jul 27 10:12:32 2009 -0700 Al Chu
+a150500a3451689bf0eb82203762e8dad4c07522
+
+	* fix libibnetdisc API consistency and bugs
+
+Thu Jul 30 18:40:12 2009 -0700 Ira Weiny
+ab70ff96ebf87a63c0dc1aaeb947ababb2125d5e
+
+	* infiniband-diags/libibnetdisc: fix DBGFLAGS variable
+
+Mon Jul 20 08:58:47 2009 -0400 Hal Rosenstock
+a6fbe5f00a3331bf79fc28c37f3d648ec0bb3cc5
+
+	* infiniband-diags/ibtracert.c: Fix linearcap test in switch_lookup
+
+Tue Jul 7 15:24:26 2009 -0700 Al Chu
+b0e2e5c901f342c7813ac91486e474afd2a65204
+
+	* libibnetdisc cleanup patches
+
+Thu Jul 16 09:32:38 2009 -0400 Hal Rosenstock
+5dd30ca90a66cd77d6653deefedffc0cbeac651f
+
+	* infiniband-diags/ibroute.c: Fix typo in IBWARN message
+
+Thu Jul 16 09:31:58 2009 -0400 Hal Rosenstock
+b26200734f13cdb2c7d2f1e4d7acc39599b849e7
+
+	* infiniband-diags/ibtracert.c: Fix comparison to SwitchInfo.MulticastFDBCap in switch_mclookup
+
+Tue Jul 14 13:28:52 2009 -0400 Hal Rosenstock
+7937993a10638a8d57b80506f040a6cd1ec0413f
+
+	* infiniband-diags/README: Update saquery dependencies
+
+Tue Jul 14 04:26:20 2009 +0300 Sasha Khapyorsky
+c91986c7f354065c42ce70f2dc9fee59d1c73bce
+
+	* infiniband-diags/libibnetdisc: add man pages to EXTRA_DIST
+
+Thu Jul 9 15:39:15 2009 -0400 Hal Rosenstock
+ba92f994d43a360cb7fa47d6976e370e9471a005
+
+	* infiniband-diags/ibroute.c: Fix format and typo in printf
+
+Tue Jul 7 06:43:57 2009 +0300 Sasha Khapyorsky
+579be1dbd8096f4b42faae75c4070057a614a105
+
+	* libibnetdisc/Makefile.am: add internal.h to SOURCES list
+
+Wed Jun 24 18:22:14 2009 -0700 Ira Weiny
+3123b272c1d3a7e06223bedd5a9cdcc2be7cfa61
+
+	* iblinkinfo, ibqueryerrors: clean up ibdiag_process_opts call
+
+Tue Jun 23 13:29:19 2009 -0700 Ira Weiny
+c2a119da5ef4f2c99c07a5e7230812ab038717da
+
+	* ibprintca.pl: fix corner case: print switch information for CA's found at the end of the cache file.
+
+Wed Jun 24 17:52:37 2009 -0700 Ira Weiny
+314008b45efea52c471e5e0ec86dadc47cba698f
+
+	* ibqueryerrors: optomize -D operation
+
+Thu Jun 18 14:07:13 2009 -0700 Ira Weiny
+2df69c8f20a57ac4ccc501f447fc70e7e3dc8cb4
+
+	* iblinkinfo: optomize -D operation
+
+Thu May 14 17:24:29 2009 -0700 Ira Weiny
+9da2a098863c6633bd9d4a7f48446593904e77a8
+
+	* ibqueryerrors: fix custom opts string
+
+Thu May 14 17:23:22 2009 -0700 Ira Weiny
+ab82af39c6b7376739d7c813cd6dba7522405745
+
+	* iblinkinfo: convert to ibdiag_process_opts
+
+Thu May 14 16:39:52 2009 -0700 Ira Weiny
+1b6b85aba85ed0a9249ffcb33ee3c4c9d262ee11
+
+	* iblinkinfo: remove unused file pointer.
+
+Thu May 14 15:52:42 2009 -0700 Ira Weiny
+5d6a05b24c6116759a45e4a7fa5632b940682bd0
+
+	* iblinkinfo, ibqueryerrors: prevent core when switch is not found
+
+Wed May 13 09:30:20 2009 -0700 Ira Weiny
+8022ccc98bc83cb59a08cc8ce3a621a80cd7ed91
+
+	* ibnetdiscover: only report max hops discovered when requested
+
+Thu Jun 4 11:08:27 2009 -0700 Ira Weiny
+443ef9a59d4447d7753e0dc7ddeaec167932c8c8
+
+	* Move _with_node_name_map rpm spec option from infiniband-diags to opensm.
+
+Mon Jun 8 13:03:01 2009 +0300 Eli Dorfman (Voltaire)
+76f74f789656dac2707f0f34933b76955cbac368
+
+	* infiniband_diags/ibportstate.c perform reset in a single mad
+
+Wed Jun 3 17:12:56 2009 +0300 Eli Dorfman (Voltaire)
+9d832c6596bf1ad50814aa3533f4e8706a03404f
+
+	* infiniband-diags: Do not change port state on SubnSet
+
+Fri May 29 15:31:12 2009 -0400 Hal Rosenstock
+dbb68b43fd64ae30f013e929dc9e06c9a9c9ee12
+
+	* infiniband-diags/ibdiag_common.c: Eliminate compile warning on x86_64 archs
+
+Wed May 27 11:08:10 2009 -0700 Sean Hefty
+4348825c9a1f964f17d0d06eeefc600b81de0a3f
+
+	* ib-mgmt/libibnetdisc: fix typecast warning
+
+Sun May 10 14:30:13 2009 +0300 Doron Shoham
+71a382ef541de82fe1aec80dcc6aac0a972859b3
+
+	* saquery: fix -c arguement
+
+Wed May 6 09:53:03 2009 -0700 Ira Weiny
+3917867db504d6aefbe7ca27bcbd3ac5507c8a55
+
+	* Clean up printing of switch heading when printing "down links" only.
+
+Wed May 6 09:51:14 2009 -0700 Ira Weiny
+ce9635bda568014f391a6bd2aa165115004c4161
+
+	* Fix 2 formatting diff's from old ibqueryerrors.
+
+Tue Apr 28 16:38:38 2009 -0700 Ira Weiny
+e5c1b9659adf803bd01bf908a52be5ea374e1307
+
+	* Modify '-S' option of iblinkinfo and ibqueryerrors to do a limited scan of the
+
+Wed May 6 09:33:47 2009 -0700 Ira Weiny
+c6f03b72633aff494ac0572ae7bf051d854fff90
+
+	* Add combined routing support to libibnetdisc
+
+Mon May 4 15:49:49 2009 -0700 Sean Hefty
+750c7d1ee5c4850a9533dbd003e6873d1e0a8c53
+
+	* ib-mgmt: fixup ibsendtrap for windows
+
+Fri May 1 22:47:51 2009 +0300 Sasha Khapyorsky
+4f784b38fb9628e35a2a0b1378b6e530206f7aff
+
+	* ibstat.c: use htohl() for 32-bit capmask conversion
+
+Mon May 4 15:17:32 2009 -0400 Hal Rosenstock
+03b311f8a46a7d9c88c176480de807e29866107b
+
+	* infiniband-diags/ibnetdiscover.c: Cosmetic formatting changes
+
+Mon May 4 12:58:09 2009 +0200 Nicolas Morey-Chaisemartin
+984b98326378702e50dffb854cc72853274cd700
+
+	* infiniband-diags: Added libibnetdiscover to .spec file
+
+Mon Apr 27 14:17:53 2009 -0400 Hal Rosenstock
+0b33c91abdb02403764ca2e4d889a1d14b2d4bac
+
+	* infiniband-diags/saquery.c: Display attribute ID in hex rather than decimal
+
+Mon Apr 27 12:59:05 2009 +0200 Nicolas Morey-Chaisemartin
+bfc1992705db38f2fda331d3cd0ce4acd48aa277
+
+	* management: Fixed custom_release in SPEC files
+
+Mon Apr 27 14:50:26 2009 -0700 Ira Weiny
+24741af2301ae8aa2772a35c405212ede4c0a6c8
+
+	* ibqueryerrors: switch_guid_str is required for the string resolve function.
+
+Sun Apr 26 17:05:13 2009 +0300 Sasha Khapyorsky
+186fa39842b64785eb572a69ddeddc5613419782
+
+	* management: bump package versions
+
+Sat Apr 25 20:10:59 2009 +0300 Sasha Khapyorsky
+bbee6691e502306397f7be2593293a0baaa90c40
+
+	* ibdiag_common: remove duplicated ibdebug variable
+
+Sat Apr 25 20:10:59 2009 +0300 Sasha Khapyorsky
+76e4fb8b76d1ab240728c5c7bfa7d94a4d803469
+
+	* ibdiag_common: remove duplicated ibdebug variable
+
+Sat Apr 25 19:51:06 2009 +0300 Sasha Khapyorsky
+466fbe3e786598904e7cad9cb99abe7ea81f69f5
+
+	* infiniband-diags: remove not used ibnetdiscover.h
+
+Sat Apr 25 14:36:43 2009 +0300 Sasha Khapyorsky
+0d0c89063dfe8d5ef8ec9ac836e48c8a7d1008bb
+
+	* infiniband-diags: cosmetic fixes
+
+Thu Apr 23 10:57:10 2009 -0700 Ira Weiny
+bff90d580d150cab5f741400fce88ce244cd1ddf
+
+	* Convert ibqueryerrors.pl to C and use new ibnetdisc library.
+
+Wed Apr 22 18:54:46 2009 -0700 Ira Weiny
+5d5734e58b6f73bb1ab7810a63c7ca32b7dfb5cf
+
+	* libibnetdisc: change ibnd_discover_fabric to receive ibmad_port
+
+Sat Apr 25 15:00:13 2009 +0300 Sasha Khapyorsky
+0d1e27e38285e242d438ff6a658363821e583135
+
+	* ibnetdiscover: fix types to avoid portability castings
+
+Tue Apr 21 12:06:42 2009 -0700 Sean Hefty
+b0b97a684d0133c30571b4e16bc0d31a56bdc446
+
+	* ib-mgmt/ibn3 branch: libibnetdisc add windows support
+
+Tue Apr 21 12:02:18 2009 -0700 Sean Hefty
+3ef7d3de4ebcd6519899b51e4b1b17c0007c180b
+
+	* ib-mgmt/ibn3 branch: diags updated for continued windows support
+
+Thu Apr 23 10:57:10 2009 -0700 Ira Weiny
+51401a3ed834f5369dc0c98f134db75a2b6e8ee0
+
+	* Convert ibnetdiscover to use new ibnetdisc library
+
+Thu Apr 23 10:57:10 2009 -0700 Ira Weiny
+339cf92d36a47c2c50727d5ab1c3fd03c409d3fc
+
+	* clean up iblinkinfo conversion
+
+Fri Apr 3 15:42:54 2009 -0700 Ira Weiny
+392a032eda0243931d2b82b8bc8174293ba11e44
+
+	* Convert iblinkinfo.pl to C and use new ibnetdisc library.
+
+Fri Apr 3 15:42:51 2009 -0700 Ira Weiny
+a626de1abde7223348ed88474e168c3e68f86565
+
+	* Create a new library libibnetdisc
+
+Sun Apr 19 06:32:41 2009 -0400 Hal Rosenstock
+a9acc85489ea27649d726f338a044cc989d5b173
+
+	* infiniband-diags/man/vendstat.8: Indicate IS4 config group config not persistent across IS4 reboot
+
+Sat Apr 18 09:11:36 2009 -0400 Hal Rosenstock
+34fe5e885707ccf06fb77086a849d0d73a485ae4
+
+	* infiniband-diags/ibsendtrap.c: Set producer type according to node type
+
+Thu Apr 16 09:01:45 2009 -0400 Hal Rosenstock
+668fb55fc9cb98c1242ff1f7e7305fd6d9c2362e
+
+	* infiniband-diags/man/vendstat.8: Fix PortXmit/RcvDataSL examples
+
+Wed Apr 15 19:38:30 2009 +0300 Sasha Khapyorsky
+8b8a9f0cf5cdae9a0d2552d4d8e5742d10ba385d
+
+	* infiniband-diags/perltidy.sh: option to format a single file
+
+Fri Apr 3 16:02:49 2009 -0700 Ira Weiny
+e34a45c85df471dc11a43107dabe1cf6186bf422
+
+	* Fix ibidsverify.pl to use the correct cache file
+
+Wed Apr 15 09:05:18 2009 -0400 Hal Rosenstock
+02e69153449f8ed17b3b98a8754734f9a5058d7d
+
+	* infiniband-diags/ibsendtrap.c: Local link integrity is an "urgent" trap
+
+Tue Apr 14 15:11:18 2009 +0300 Sasha Khapyorsky
+347e4ffb4d8297ce656cc1daa6ced0e2a4bd9afe
+
+	* infiniband-diags/ibsendtrap: code consolidation
+
+Mon Mar 16 11:20:38 2009 +0200 Julia Volynsky
+441ece311d51c8a30d27a7b45dc176c98fd23534
+
+	* Added send trap for trap 129 (local link integrity)
+
+Wed Apr 8 11:04:45 2009 -0400 Hal Rosenstock
+6c2a373455e37c3488bc0f90e8ab0b3a6ffa1f16
+
+	* infiniband-diags/vendstat: Update man page and examples for PortXmit/RcvDataSL counter support
+
+Tue Mar 24 03:09:15 2009 +0200 Sasha Khapyorsky
+c73f168ca22d40cabb3bb88e827bfb077080cf05
+
+	* infiniband-diags/vendstat.c: code moving
+
+Thu Mar 19 14:27:25 2009 +0200 Or Gerlitz
+c10e955f68414381d81c5400559281cbf14e1283
+
+	* ib-diag/vendstat: counter-group-info & config-counter-group vendor mads
+
+Fri Mar 20 18:12:22 2009 -0500 Hal Rosenstock
+fc3d02c9871820f35a34b331046b1fa81b055291
+
+	* infiniband-diags/perfquery.8: Fix typo in short option for PortXmitDataSL counters
+
+Fri Mar 13 15:37:18 2009 -0500 Hal Rosenstock
+71113b0100ad0236abdc1bfa4868a89b47387880
+
+	* infiniband-diags/perfquery.c: Label PortXmit/RcvDataSL counters in headings
+
+Thu Mar 12 11:38:56 2009 -0500 Hal Rosenstock
+9e2416c1e1bf0b95db675844e7d4592db8cb1115
+
+	* infiniband-diags/perfquery.8: Extended counters are now -x rather than -e
+
+Wed Mar 11 08:29:19 2009 -0500 Hal Rosenstock
+90ef4ffcf239cd82e88a5cbccefb60356be8d250
+
+	* infiniband-diags/vendstat.c: Add missing mad_rpc_close_port call
+
+Tue Mar 10 17:50:01 2009 -0500 Hal Rosenstock
+21478a728ef32a4863866c18e52b64306a86ec73
+
+	* infiniband-diags/perfquery.c: Fix some memory leaks on exit
+
+Tue Mar 10 15:50:23 2009 -0500 Hal Rosenstock
+680bafcf16c7b34c58a20af4b08350d07767dc81
+
+	* infiniband-diags/perfquery.8: Update man page for PortXmit/RcvDataSL
+
+Wed Mar 11 12:43:47 2009 +0200 Sasha Khapyorsky
+52c956f91512ded86a2c072074d07269d870128b
+
+	* libibmad: add mad_rpc_class_agent() call
+
+Mon Mar 9 13:53:21 2009 -0700 David A. McMillen
+05d7a879e3e59675a80c8250a1f53c53cf1766ee
+
+	* infiniband-diags/ibnetdiscover: Apply --node-name-map remapping to names printed by --ports option
+
+Mon Mar 9 18:01:02 2009 +0200 Or Gerlitz
+c236d1f91b9e6cccc3c30aec2dfcf050f0ac792a
+
+	* infiniband-diags/perfquery: add srcport param
+
+Fri Feb 20 14:45:29 2009 -0800 Ira Weiny
+9ef2ac0417237d757875a31572274be3f9a90f08
+
+	* infiniband-diags: convert ibnetdiscover to "new" ibmad interface
+
+Thu Feb 19 18:53:10 2009 -0800 Ira Weiny
+37a39ee80e8d59ed3c3ee1f0d6dddddbed20708a
+
+	* infiniband-diags: Convert perfquery, saquery, sminfo, smpquery, and vendstat to "new" ibmad interface
+
+Thu Feb 19 18:24:56 2009 -0800 Ira Weiny
+a76c09bc5779dad91e44e862ba48bf9ad63455e7
+
+	* infiniband-diags: Convert mcm_rereg_test to "new" ibmad interface
+
+Thu Feb 19 18:14:49 2009 -0800 Ira Weiny
+b34db7fbae6f36db0d426019df64a289b894a293
+
+	* infiniband-diags: Convert ibsysstat to "new" ibmad interface
+
+Thu Feb 19 17:58:36 2009 -0800 Ira Weiny
+20a6a5bbd9b0faed3d36a4e02cc00a576df08d3e
+
+	* infiniband-diags: Convert ibtracert to "new" ibmad interface
+
+Thu Feb 19 17:53:30 2009 -0800 Ira Weiny
+be317ec69458e453b7c13aba7adef1bdba770d96
+
+	* infiniband-diags: Convert ibsendtrap to "new" ibmad interface
+
+Thu Feb 19 17:30:14 2009 -0800 Ira Weiny
+63205b22834d97de1135647198d26655882a4a34
+
+	* infiniband-diags: Convert ibroute to "new" ibmad interface
+
+Thu Feb 19 17:27:21 2009 -0800 Ira Weiny
+37808bc670ef219c12d1aab22e30582babd5da4d
+
+	* infiniband-diags: Convert ibportstate to "new" ibmad interface
+
+Fri Mar 6 10:48:08 2009 -0800 Ira Weiny
+481279ff94de844a99ecd7c88f11365bad495c8d
+
+	* infiniband-diags: Convert ibaddr to "new" ibmad interface
+
+Fri Feb 27 13:46:53 2009 -0500 Hal Rosenstock
+45131fc051fc69fb3190a895345c15e57bb5c13f
+
+	* opensm/infiniband-diags: Changes for C rather than C++ style comments
+
+Mon Mar 2 11:35:54 2009 +0200 Or Gerlitz
+aa877e7dbd691589bfd45ddfc032514c08831580
+
+	* infiniband-diags: update configure.in check for libibmad API
+
+Sun Mar 1 14:41:51 2009 +0200 Or Gerlitz
+08775eda007eab489247542cb492663f7aea1f63
+
+	* perfquery PortXmtDataSL/PortRcvDataSL support
+
+Sun Mar 1 14:39:48 2009 +0200 Or Gerlitz
+3116fb5902642fb8cebbfb1c2f64c5a8cb3a7eb2
+
+	* generic libibmad perf query/reset api
+
+Sat Feb 28 18:50:54 2009 +0200 Sasha Khapyorsky
+d5f23acbcbfe8ee51818ab364007d5b0a7387d01
+
+	* management: bump all package versions
+
+Fri Feb 27 10:34:19 2009 +0200 Sasha Khapyorsky
+1cb94c303b0a195d766e1d0eb39d87c18425cd4c
+
+	* infiniband-diags/ibroute: fix warning
+
+Thu Feb 26 13:08:23 2009 -0800 Sean Hefty
+bf861ff2118831d99231e2458132571ec30a01aa
+
+	* [ib-diag] saquery: add support for WinOF
+
+Thu Feb 26 12:33:49 2009 -0800 Sean Hefty
+9cb8cf81780c66e529bb275f180d1b734694031c
+
+	* [ib-diags] saquery: set correct pkey table field
+
+Thu Feb 26 12:22:04 2009 -0800 Sean Hefty
+d8b1999aee4635f6522947bb4bf036799d5869c9
+
+	* [ib-diag] ibsysstat: add support for WinOF
+
+Thu Feb 26 10:12:23 2009 -0800 Sean Hefty
+aaf13343ee26d4c5e597ddf69a8e3b2341291b98
+
+	* [ib-diag] mcm_rereg_test: add support for WinOF
+
+Thu Feb 26 10:12:19 2009 -0800 Sean Hefty
+3bc107e9c72908bbd51ebaf29389f142e3da72e9
+
+	* [ib-diag] ibsendtrap: add support for WinOF
+
+Thu Feb 26 10:11:58 2009 -0800 Sean Hefty
+02b7f2ed3e52cbaa39f1d6033a76b970b42ce949
+
+	* [ib-diag] ibtracert: add support for WinOF
+
+Thu Feb 26 10:10:58 2009 -0800 Sean Hefty
+9b59ad68b2b1976d5c1111531f3f3aacf867d2ab
+
+	* [ib-diag] ibroute: add support for WinOF
+
+Thu Feb 26 09:48:58 2009 -0800 Sean Hefty
+f3cf4703a3c421657ccd2a6a0a5cc6807bf5dd2f
+
+	* [ib-diag] ibnetdiscover: add support for WinOF
+
+Fri Feb 20 16:59:38 2009 -0500 Hal Rosenstock
+8f526856100acd3206ae7c268bb0cadc9c6a7088
+
+	* infiniband-diags/saquery.c: Convert more LID prints to unsigned decimal
+
+Wed Feb 18 12:19:32 2009 -0500 Hal Rosenstock
+1f6243a43bb429a50e3453178e9b456763cc78ef
+
+	* infiniband-diags/smpdump.c: Release umad resources on exit
+
+Wed Feb 18 10:55:37 2009 -0500 Hal Rosenstock
+cf6e7dcf310786a51deac8191df5a4307c2d5a3d
+
+	* infiniband-diags/smpdump.c: Fix usage examples
+
+Sun Feb 22 06:19:44 2009 -0600 David McMillen
+b75064b33c4faa157a0efb52d6498fa905fed4ff
+
+	* infiniband-diags/src/ibnetdiscover.c missing LID information on --ports
+
+Wed Feb 18 10:00:21 2009 -0800 Sean Hefty
+99225e635ae4a1abeb4f33185c394bc6f40d5db9
+
+	* smpquery: add support for WinOF
+
+Tue Feb 17 16:05:45 2009 -0800 Sean Hefty
+d82c0b8f7bad0f618ddcc19644f196e4fc6e8879
+
+	* ibping: add support for WinOF
+
+Tue Feb 17 14:36:20 2009 -0800 Sean Hefty
+7dbf78d97d95da1ad7769b8ed97496f0f56f55c2
+
+	* smpdump: add support for WinOF
+
+Tue Feb 17 14:35:40 2009 -0800 Sean Hefty
+799a70838ebae1519f6cdc6980327988a3e59057
+
+	* ibstat: add support for WinOF
+
+Tue Feb 17 14:33:09 2009 -0800 Sean Hefty
+61fb971b57dffbc10f83f51e28b4a67fb0c581cb
+
+	* ibportstate: add support for WinOF
+
+Tue Feb 17 14:32:38 2009 -0800 Sean Hefty
+518d5459663cb7367afac4e2255aa759d48b9889
+
+	* perfquery: add support for WinOF
+
+Tue Feb 17 14:32:05 2009 -0800 Sean Hefty
+43524e038a5fd95339fd5c43e2fedc32ac76c8f4
+
+	* ibaddr: add support for WinOF
+
+Tue Feb 17 14:31:31 2009 -0800 Sean Hefty
+0524c25610ea927053d7bf1144d1b06e7b969a80
+
+	* vendstat: add support for WinOF
+
+Tue Feb 17 14:30:54 2009 -0800 Sean Hefty
+43e6dfa72170309ef5f20100ec1119abdb2e2327
+
+	* sminfo: add support for WinOF
+
+Sat Feb 14 17:19:02 2009 +0200 Sasha Khapyorsky
+8219070572684307a500347ca0220e1b79640a5b
+
+	* infiniabnd-diags/common: wrap debug macros with do {} while (0)
+
+Wed Feb 11 18:37:24 2009 +0200 Sasha Khapyorsky
+68daa74daf262ee17cabf3a019348c7def662e3c
+
+	* infiniband-diags: some code consolidation
+
+Wed Feb 11 04:53:46 2009 +0200 Sasha Khapyorsky
+f2920cc66f525850f61d4ceaf87e05db8fab17cf
+
+	* infiniband-diags/saquery: fix types and some cleanup
+
+Wed Feb 11 02:11:30 2009 +0200 Sasha Khapyorsky
+ce8e82d5d53e698bf3ca41eb7295b8a19038dc72
+
+	* infiniband-diags/saquery: remove osm vendor layer
+
+Thu Feb 5 17:00:02 2009 -0700 Hal Rosenstock
+f13f0a25f22e1c9f2ad0e10bda830b83d0edcb80
+
+	* infiniband-diags/perfquery: Change option name for extended counters
+
+Thu Feb 5 20:18:10 2009 +0200 Sasha Khapyorsky
+6079cc21e9df4851ed5fe2a7e474642cd7b7ee78
+
+	* infiniband-diags/common: use enum MAD_DEST as ibd_dest_type type
+
+Fri Jan 30 15:51:05 2009 +0200 Sasha Khapyorsky
+5b6ba15dd1dfd5c0664cb3b4f820c10828b9add7
+
+	* infiniband-diags/saquery: merge PathRecord query functions
+
+Wed Jan 28 20:23:02 2009 +0200 Sasha Khapyorsky
+2305370eccc5891d310fa3b42c93a5257b390d18
+
+	* infiniband-diags/saquery: more params for Path and MCMember Records
+
+Wed Jan 28 20:23:02 2009 +0200 Sasha Khapyorsky
+db4dd2cbe5131ef240307cdf5df9c4031ed90376
+
+	* infiniband-diags/saquery: adding query params
+
+Thu Jan 29 14:34:45 2009 +0200 Sasha Khapyorsky
+d85205d7c14697b9777d13da39b1137f0db07636
+
+	* infiniband-diags/saquery: CHECK_AND_SET_VAL() macro
+
+Thu Jan 29 13:24:59 2009 +0200 Sasha Khapyorsky
+21de45df81e77ac214e355cf7f6861f83b2fc59f
+
+	* infiniband-diags/saquery: cosmetic
+
+Thu Jan 29 14:42:55 2009 +0200 Sasha Khapyorsky
+6d2909c11245777ce44e5b5716c6dc3c877b6a92
+
+	* infiniband-diags/saquery: fix encoding of SA queries
+
+Wed Jan 28 20:10:06 2009 +0200 Sasha Khapyorsky
+b2191875823de79245cbd6105307d98780f45d6b
+
+	* infiniband-diags/smpdump: fix SL value encoding
+
+Wed Jan 28 15:14:07 2009 +0200 Sasha Khapyorsky
+2e11ae51da524bffa49434e1aea1fc471f2a42b3
+
+	* infiniband-diags/saquery: fix backward compatibility bug
+
+Tue Jan 27 14:36:02 2009 +0200 Sasha Khapyorsky
+e478ef0b30fd7b7a889c1afb7d94553de15e4693
+
+	* infiniband-diags/ibsysstat: backward compatibility fixes
+
+Mon Jan 26 23:03:29 2009 +0200 Sasha Khapyorsky
+7d1b0a3d6aca0c5f96f3354a9e4a3ef40b25f300
+
+	* infiniband-diags/ibsysstat: use RMPP for client/server communication
+
+Mon Jan 26 16:35:51 2009 +0200 Sasha Khapyorsky
+a58765c29649fbf8ae8868e161a4285438c0bd95
+
+	* infiniband-diags/saquery: add lid parameter to NodeRecord query
+
+Mon Jan 26 10:49:43 2009 +0200 Sasha Khapyorsky
+c5f90ddff99b8d8e6a63bd8a248ff9ab1ec160b6
+
+	* infiniband-diags/smpquery: usage improvement
+
+Sat Jan 24 11:19:30 2009 +0200 Sasha Khapyorsky
+f1db964fd7316ac1900545078524f0ee5f71620a
+
+	* infiniband-diags: remove unneeded includes
+
+Sat Jan 24 10:50:50 2009 +0200 Sasha Khapyorsky
+cff14be7d5daa56c11177769ea736a654fc94869
+
+	* infiniband-diags: make get_build_version() static
+
+Sat Jan 24 10:11:08 2009 +0200 Sasha Khapyorsky
+0628026b304becf2c46ccc9ac7b30b02fafa2219
+
+	* infiniband-diags: remove argv0 global variable
+
+Sat Jan 24 00:31:01 2009 +0200 Sasha Khapyorsky
+3ccf4d576c28854a2c40237179f39185f2c1b5d3
+
+	* infiniband-diags: using common command line option processing
+
+Sat Jan 24 00:31:01 2009 +0200 Sasha Khapyorsky
+cd5a13772d750e8828e48fd1e921d972894c8d68
+
+	* infiniband-diags: command line option processing framework
+
+Sun Jan 25 11:45:03 2009 +0200 Sasha Khapyorsky
+591081b4ca2fe3d60e08545d4148e2ef68b6665e
+
+	* infiniband-diags/dump_mfts.sh: fix -D format parsing
+
+Sun Jan 25 11:45:03 2009 +0200 Sasha Khapyorsky
+26680730ec79303a32f0950dc3b6733172a9cd61
+
+	* infiniband-diags/dump_lfts.sh: fix -D format parsing
+
+Sat Jan 24 00:12:28 2009 +0200 Sasha Khapyorsky
+1fa3b32eba4218ab0fdce5a101624b007a82aad3
+
+	* infiniband-diags/ibdiag_common: cleanup argv0 prototype
+
+Sat Jan 24 00:06:11 2009 +0200 Sasha Khapyorsky
+7ea0dba08aaf94830e5ebabc83eb8ec5add689bb
+
+	* infiniband-diags/smpdump.c: use common ib definitions
+
+Thu Jan 22 22:32:34 2009 +0200 Sasha Khapyorsky
+bc4d17133d6677cec5e87079f5918e23ba81959f
+
+	* infiniband-diags: remove duplicated ibdebug prototype
+
+Thu Jan 22 15:00:58 2009 +0200 Sasha Khapyorsky
+40061e8db2192d7731f54bd12317e18def7f0062
+
+	* infiniband-diags/ibdiag_common: move get_build_version()
+
+Thu Jan 22 14:57:11 2009 +0200 Sasha Khapyorsky
+383afee5b334a83cce7030c8ce592b34439ab56e
+
+	* infiniband-diags/ibdiag_common: cosmetic
+
+Thu Jan 22 14:46:25 2009 +0200 Sasha Khapyorsky
+20bf9d37f8181acc0bac3aa8bbb41f275027c90e
+
+	* infiniband-diags/Makefile.am: use common library
+
+Thu Jan 22 14:37:11 2009 +0200 Sasha Khapyorsky
+e1ea13aa0655ab431677505823d5ba28dafff02e
+
+	* infiniband-diags/Makefile.am: merge CFLAGS
+
+Thu Jan 22 14:32:35 2009 +0200 Sasha Khapyorsky
+4318758cbb23f3e8a7136cc0efcc9345f590a982
+
+	* infiniband-diags/Makefile.am: kill -rpath
+
+Tue Jan 20 13:29:25 2009 +0200 Sasha Khapyorsky
+c002711719cc7e83210d4a8b3fe05f349e9d8bb2
+
+	* infiniband-diags/perfquery.c: fix typo
+
+Tue Jan 13 16:56:57 2009 +0200 Eli Dorfman (Voltaire)
+7dd16a49f1934d9912a7699bde63744b961564ff
+
+	* infiniband-diags support PortXmitWait get and set
+
+Mon Jan 5 14:31:07 2009 +0200 Sasha Khapyorsky
+69743b5082ed4bc11e211ae3081dbbb4f2feae81
+
+	* infiniband-diags/perfquery: indentation fixes
+
+Mon Dec 22 02:26:31 2008 +0200 Sasha Khapyorsky
+7e2d9e40c5d0d4d52056d6c17d65c3c9161aff79
+
+	* management: remove libibcommon dependencies
+
+Mon Dec 22 00:24:30 2008 +0200 Sasha Khapyorsky
+c01c74074db2e9c170f67969c020363fb3500f41
+
+	* management: move sysfs()_* function to libibumad
+
+Sun Dec 21 17:28:25 2008 +0200 Sasha Khapyorsky
+916e7571b49953360bc28fc53e0e1345c7fd5f3f
+
+	* infiniband-diags/ibstat,smpdump: kill unused includes
+
+Thu Dec 18 23:45:42 2008 +0200 Sasha Khapyorsky
+0a7b21b279f6221b9e0629c9d23c1185ab323948
+
+	* infiniband-diags/saquery: minor indentation fixes
+
+Sat Dec 13 22:46:56 2008 +0200 Sasha Khapyorsky
+656614a4a7a92765db698fa2c5a8a87f905473c3
+
+	* infinabd-diags: convert type uint -> unsigned int
+
+Fri Dec 12 17:30:25 2008 +0200 Sasha Khapyorsky
+75990408ac7cc42fede93581543caa7d63984de3
+
+	* infiniband-diags/saquery: PortInfoRecord query
+
+Fri Dec 12 16:11:52 2008 +0200 Sasha Khapyorsky
+07d702886ff10bc984e2cb1a0b509d67579ecee6
+
+	* infiniband-diags/saquery: separate queries and commands
+
+Wed Dec 10 19:50:35 2008 +0200 Sasha Khapyorsky
+4e858dc99c87fe68a2edfcdf0886fa5ae33dd6e1
+
+	* infiniband-diabs/saquery: unify SA queries processors
+
+Wed Dec 10 16:12:44 2008 +0200 Sasha Khapyorsky
+7fd2c792e433f53630f4055c0816f142296d8670
+
+	* infiniband-diags/saquery: indentation fixes
+
+Sat Dec 13 19:46:15 2008 +0200 Sasha Khapyorsky
+f0ce6ce0c60165e80003c3e62ea07d399e7c8e06
+
+	* management: bump all package versions
+
+Sun Dec 7 00:16:36 2008 +0200 Sasha Khapyorsky
+bbf5ee9cfbc23930530d105799c7fc8f6bf892fd
 
 	* management: update package versions
 
 Wed Nov 26 12:51:30 2008 +0200 Sasha Khapyorsky
-a92a5e56d353706c6a47038aceaafa1c991aec2d
+ed48f26b346d449a14927463edd7a4b2da9ec3ac
 
 	* infiniband-diags/grouping: add 10G IP router devid
 
-** Version: infiniband-diags-1.4.3
-
 Tue Nov 18 06:20:46 2008 +0200 Sasha Khapyorsky
-dd5aa2cebc760f239b965c87388ffe9b0401c5d2
+cbd77598741234f36af5f7ab6bd1915951151967
 
 	* management: update versions
 
 Sun Nov 16 11:37:31 2008 -0700 Hal Rosenstock
-0cc9ca1a5f9ced7d6673d6c2d503375034cf629e
+abeb73d092aa649b9f4b9ba1c967276be4b3b15b
 
 	* infiniband-diags/ibstat.c: Use UMAD_MAX_DEVICES define
 
 Sun Nov 16 14:23:10 2008 +0200 Sasha Khapyorsky
-b38e9df37b422201e128b9d974feb2551e3227be
+4949d1fc818c6d5e09c7e5507ed3d7d879dcccbf
 
 	* infiniband-diags/ibstat.c: remove casting
 
 Fri Nov 14 14:54:06 2008 -0800 Ira Weiny
-75cc7a2547da09e57b882718dfac28e0ff19435e
+485d94520e2aa762f6d7f878e6372bf2397f56fe
 
 	* Fix max parameter passed to umad_get_cas_names
 
-** Version: infiniband-diags-1.4.2
-
 Sun Oct 19 20:53:23 2008 +0200 Sasha Khapyorsky
-6556babd612d54e0cb2a7428099cc7d18d58ae16
+46f65ae24efbbe01e50d192df5aad52ce2d3e1af
 
 	* management/*/configure.in: bump all versions
 
 Wed Oct 8 12:28:44 2008 +0200 Sasha Khapyorsky
-307665fd72c00e1f404d8d921b47c2ec7fe04214
+bfe012a31e6661439aa605449ec06f6e660f85d8
 
 	* management: update Voltaire copyright
 
 Sun Oct 19 08:54:32 2008 -0600 Hal Rosenstock
-088606c588fb0bce51bac9fe0cee559485ddeb8c
+8daa6f9b0cc008fc9d8b3b87c3c1e8b3b30c5497
 
 	* infiniband-diags/saquery.8: Update saquery man page
 
 Sun Oct 19 08:54:30 2008 -0600 Hal Rosenstock
-e38190c2f13e7e8fac9e1ef93d489ee2c2e5cd9d
+9def498100790ad773d7a94123f33217fa7acd8c
 
 	* infiniband-diags/saquery: Support MFTRecord
 
 Sun Oct 19 01:13:15 2008 +0200 Sasha Khapyorsky
-64a25be1dae6819ef82a783c49433e645ad296bb
+32fa8fcc642590f37a8c8197dc87886f1be3dfea
 
 	* infiniband-diags/saquery: add LFT Record handling
 
 Fri Oct 17 13:04:39 2008 -0400 Doug Ledford
-45518277eff7957087fb5cfde35f54e45f4a142b
+2d556cd0fcc73fdb63e0cc5dfe979b7598378ac8
 
 	* Trivial: update usage info for ibaddr.c in infiniband-diags-1.4.1
 
 Wed Oct 8 12:28:44 2008 +0200 Sasha Khapyorsky
-d5590dba6e80f66455b2407176df177f79849227
+1b6e86e26f819ea40ca23bd0837ff71b84ab3e16
 
 	* management: add Voltaire copyright
 
 Sat Oct 11 22:02:38 2008 +0200 Sasha Khapyorsky
-fe87c79ca2699a7b4c0c88c3926e7377b981e2be
+80b3f33f1dede4d201146beb969a95459aaf2049
 
 	* infiniband-diags/perfquery: fix constant size warning
 
 Fri Oct 10 16:03:05 2008 -0700 Al Chu
-9892269e734342909503359737e0bd1bff46b302
+54f611b91bd7999378d3bddcb06f8e5614b5f396
 
 	* infiniband-diags/perfquery: if -a is specified loop through ports if required and aggregate output
 
 Fri Oct 10 15:58:20 2008 -0700 Al Chu
-c3059721f199b8e718710627f17a8855d8cf82b1
+12b8d91501e1088619aac720ee12f6be1aaaf836
 
 	* perfquery code cleanup
 
 Fri Oct 10 16:35:43 2008 -0700 Al Chu
-5ae14377a6b9bad68d2ec77086ac1897623b9464
+01f93e42ccc6c9953197641eb04b236a54d1d7be
 
 	* infiniband-diags/perfquery: if --loop_ports is specified always loop through all ports if desired
 
 Fri Oct 10 15:57:45 2008 -0700 Al Chu
-a2b18dead3869a7e2c266762857d9e4695631ff7
+e7b0a62d9afd5a5958a7aea50a1114577e5f6ada
 
 	* infinibanf-diags/perfquery: remove single port CA AllPortSelect workaround
 
 Fri Oct 10 15:57:02 2008 -0700 Al Chu
-77ac0f852492c5609dd9d3c455d2f4a7f7e735c3
+c77bfecaaf332c6e48ebe93a4561db9bb10005c9
 
 	* infiniband-diags/perfquery: error out if AllPortSelect is not supported
 
 Fri Oct 10 15:56:54 2008 -0700 Al Chu
-85a93ef902b5a0698b8133f9779bec5ddfd5be54
+3e83004adec8fb54b4a39e04870c646a222f9084
 
 	* tweak notes about port 255 in perfquery manpage
 
 Fri Oct 10 15:56:46 2008 -0700 Al Chu
-5bb40c443b0d07ed3be3348c8a2f43fe03e91ee4
+d7730efcb0f152f42439508a96be43af8ef84c88
 
 	* infiniband-diags/ibclearerrors: specify -a in call to perfquery
 
 Wed Oct 8 17:40:52 2008 -0700 Al Chu
-dfb16406bf375aa9d1313379240d82c69b3e0ae7
+88fe58c5987874f876a647fb1580f8dec8b7f5f3
 
 	* infiniband-diags/perfquery: fix comments
 
 Wed Oct 8 17:40:51 2008 -0700 Al Chu
-61f46ef3a1125748603797923be6df6195d63786
+0ee221d5c169096cba8f5c9841d71a2d631d976d
 
 	* infiniband-diags/perfquery: support ehanced port 0 with --loop-ports
 
 Mon Sep 29 14:25:01 2008 -0600 Hal Rosenstock
-1786eb01cf738ee059838a0c9d7112ba44d69db4
+7193fae14dbd197ebc0679aa44184376c387fe7f
 
 	* infiniband-diags/ibsysstat.c: Fix a couple of latent bugs
 
 Tue Oct 7 15:54:05 2008 -0700 Al Chu
-c828f5bc00e452cb70ceb9913793dca4a4b2445f
+c56710398f5c90d7c28d0f9d83eef0531518fb30
 
 	* add --loop_ports option to perfquery
 
 Tue Oct 7 15:38:51 2008 -0700 Al Chu
-c6d360bf29e557b8c08fd10465969610751ebe55
+b6d240c2e30128f15e51af75c1678e7442b3db9e
 
 	* add more detail to error message on perfquery workaround
 
 Tue Oct 7 15:38:27 2008 -0700 Al Chu
-bdcae9dff01b3dfade5b33a4d5bbb267cbc7e4a8
+d2409b5673e1e9608054462c12224bf90bd155f6
 
 	* use 0xff vs. 255 consistently in perfquery
 
 Tue Oct 7 15:38:17 2008 -0700 Al Chu
-2503f2506176a1fa104a88d1272ac4851de6e5f1
+adbbf1e9e88ec646f36e0f06326a2e8ff4fc8c9f
 
 	* add clarification in perfquery manpage
 
 Wed Sep 24 16:59:23 2008 +0300 Jack Morgenstein
-abce33c5d8cf70adb55c166648a384acf2b2c531
+8e6f693a356cd76669efc28009207307b78b5155
 
 	* infiniband-diags: eliminate compiler warnings
 
 Sat Sep 13 04:07:54 2008 +0300 Sasha Khapyorsky
-fcf80bd8bcd5bc1bc31f7a4c1016d6b52c04ad48
+372998d988c22c1fbfbc44465c56f9d995c6b513
 
 	* infiniband-diags/ibtracert: fix port by direct path resolving
 
 Fri Sep 12 22:07:56 2008 +0300 Sasha Khapyorsky
-d5ea43abb524028bedfcb1fd2cd26d1ebeed9064
+f959ff0a5c134761d04c427502539449bb85961e
 
 	* man/ibtracert: remove non-existing -e option
 
 Fri Sep 12 22:03:42 2008 +0300 Sasha Khapyorsky
-5d1d1b0a52c5ee86406ddf75a83335e83e66d878
+251ddae270fb411db838cb04cbe82faaa194bd38
 
 	* infiniband-diags/ibclearcounters: remove unrelated -N option
 
 Fri Sep 12 21:49:19 2008 +0300 Sasha Khapyorsky
-3052cdf05393185a704f0df1a1dd60b6c98f1a6a
+ad37a027ceac3923378dca830130a5de73456503
 
 	* man/ibnetdiscover: cleanup non-existing options
 
 Fri Sep 5 15:47:16 2008 -0700 Ira Weiny
-c162d3fb8fadb0ce93901c3e19fc5c7274bf0a1b
+8a09e0bfdf2aa9e5f939247bfe7a18f6656f9a6b
 
 	* ibnetdiscover.c: continue processing other ports even if smpquery fails on one port
 
 Mon Aug 18 15:46:51 2008 -0700 Ira Weiny
-ffd5eded83d3ff5e83e742f069ae4c579f5edbe7
+cf7517aafac9a7fbd441edb08e00151b62cad091
 
 	* Fix some missing node name map substitutions
 
 Thu Jul 24 07:05:05 2008 +0300 Sasha Khapyorsky
-30aec68c3d36491ddf0366473d9bab306c1b8edf
+be288b2384a6ace9dff1fe39d95c9fe97afa89f6
 
 	* infiniband-diags/src/ibaddr.c: remove unused variables
 
 Thu Jul 10 17:44:08 2008 -0700 Ira Weiny
-d05a70dc0727abd45bb4b0d63f4bf2dd55b09bd5
+10f82e3df67d5000c029caa218097f174724b9c5
 
 	* infiniband-diags/src/ibaddr.c: convert GID prints to use inet_ntop
 
 Thu Jul 24 07:00:51 2008 +0300 Sasha Khapyorsky
-3af7f1c03d3a5a02f6449055789adfe3591d0446
+779d2b88d7bca5e5799ad613c8fd14b295dbcfe7
 
 	* infiniband-diags/saquery: remove unused variable
 
 Thu Jul 10 17:44:07 2008 -0700 Ira Weiny
-54e5019b471a97391ccc6870457df9c924151eb9
+2fd9b7f64327d1bdb10bebbace3b9e4740edfa52
 
 	* infiniband-diags/src/saquery.c: convert GID prints to use inet_ntop
 
-** Version: infiniband-diags-1.4.1
-
 Tue Jul 8 07:22:02 2008 +0300 Sasha Khapyorsky
-2f3df5655164d7cca3b8fefdaca40da6c1b47d9e
+e43349f373da5275259d095df21696d666feab7f
 
 	* management: bump management versions
 
 Mon Jul 7 14:12:58 2008 -0700 Hal Rosenstock
-39229a521b8f455acc23ebd9ed93d5eb6fa8e499
+ab61af409d8d99f56d4bd8b04e46110da224d7d7
 
 	* infiniband-diags/mcm_rereg_test.c: Cosmetic formatting change
 
 Sun Jul 6 23:07:38 2008 +0300 Sasha Khapyorsky
-54de7d74303519cf2bca3089cbeca366ccbfc542
+91671f93e01d199d8ff9f0047b79910317f174ec
 
 	* management: revert configure.in update configure.in on 'make dist'
 
 Mon Jun 30 15:11:29 2008 -0700 Al Chu
-d054ca23d2e34ee47f0654b1554abb3156bc6367
+66862733a42d0d425306a866cb6856cc83e31c0a
 
 	* Fix regenerate cache corner case.
 
 Sun Jun 29 17:20:23 2008 +0300 Sasha Khapyorsky
-9fa29ad5eddabf3824232bcf629d218bb6fe1ddf
+b1178b0dbcaaa15edb8d5dbc54cfbb5d00ee4005
 
 	* infiniband-diags: fix snprintf() usage
 
 Thu Jun 12 22:38:02 2008 +0300 Sasha Khapyorsky
-7e0b9202c8bff67bb993cbb31ca8e5a5851de244
+60e7e24ecd223ab4ad37b3399e37638b09e46655
 
 	* infiniband-diags/saquery: split print_multicast_group_records() function
 
 Tue Jun 10 13:18:03 2008 -0700 Ira Weiny
-158e67973dead82709db3434d1ec709607fa923d
+8e33e60e86f5d01d3db519df6f6866f0e73a0b61
 
 	* infiniband-diags/src/saquery.c: fix potential core dump
 
 Tue Jun 10 11:12:31 2008 -0700 Hal Rosenstock
-b9d46c1dfbce751f6d3b2056c3dfc69b1e3315d0
+bbeed16b0a5d5d00d4ea7986ff4ee874d45e0623
 
 	* infiniband-diags/saquery.c: In print_multicast_group_records, only query NodeRecords when needed
 
 Sun Jun 8 13:17:50 2008 -0700 Hal Rosenstock
-55ecb093dd9afd3f1697145cb5fe5454786d3502
+2e5e1e6ea1b4e3dcacce899399f1979d6e879d53
 
 	* infiniband-diags/saquery.c: In dump_results, use query_result rather than query_svc_rec
 
 Thu Jun 5 19:12:51 2008 -0700 Ira Weiny
-496b83de4c4175ef3f8e4517708e1cbb8ee782f3
+7ab6e63cf28eaaa8dac4dcd0a55dff1f7a92695f
 
 	* infiniband-diags/src/ibnetdiscover.c: Fix the PortInfo data on the port we discover a switch on.
 
 Sun Jun 8 07:14:42 2008 +0300 Sasha Khapyorsky
-ced317ba22763ecfe72874acb8e3ec4ebd96fc6e
+98dcc64c4628c5335f1f0a41532de9caffd0f5c0
 
 	* infiniband-diags/man/saquery: add --smkey option to the man page
 
 Thu May 22 16:50:39 2008 +0300 Sasha Khapyorsky
-9347232959b1683ed1fd8072e89876174ed89c46
+ac99fcb8367da5baf8078b6012aeb41a9ffe92f5
 
 	* saquery: --smkey command line option
 
 Thu Jun 5 12:51:53 2008 -0700 Hal Rosenstock
-698b2f60a7066b36c25b4be1fafb13f8e4767c23
+9ea58ce81448c61db2a79e719f5b9bb056c1ba5f
 
 	* infiniband-diags/ibsendtrap.c: Support CA and port num
 
 Thu Jun 5 12:51:49 2008 -0700 Hal Rosenstock
-3f4f1a476a2ff2afe63d4d9a21a4d82525bb45ad
+3a0ccf24cf3e83ca13cf70e015d167be70675ced
 
 	* infiniband-diags/mcm_rereg_test.c: Handle error when guid file not found
 
 Tue Jun 3 06:01:28 2008 -0700 Hal Rosenstock
-f644a54e2774321b5ad4fa519305eadcfaef290b
+1562103b9f3ce6aee323c6ae5dc4fc37c2f03197
 
 	* infiniband-diags/saquery.c: Update for change to osm_mad_pool_init API
 
 Thu May 29 06:22:52 2008 -0700 Hal Rosenstock
-cb86ea31a7d6de7021668cbafddbfe5b2f8af201
+7b08c94b4113e3951c5f73e52d49360dfcf440e5
 
 	* management: Support separate SA and SM keys as clarified in IBA 1.2.1
 
 Sun Jun 1 19:48:17 2008 +0300 Sasha Khapyorsky
-4f221a0f9332af596450f63bd4a947051efd09ff
+327fb32649f89740bbfb215882c860d0b42ba422
 
 	* infiniband-diags/scripts/*.pl: prevent some zero exists on errors
 
 Sun Jun 1 19:47:22 2008 +0300 Sasha Khapyorsky
-e59718b4022b4bbaff73038b1b30a28a129297ae
+89544a6d93b76d344ac897a6812ce59bddd2c331
 
 	* infiniband-diags/scripts/*.pl: exit 2 on usage errors
 
 Wed May 21 16:48:28 2008 -0700 Matthias Blankenhaus
-fa9860edcd845804200ffa0477337d1b5a7ad907
+95a60ca0020e76753d5d6b359939a3162aad1426
 
 	* saquery: port selection problem
 
 Wed May 28 17:59:41 2008 -0700 Ira Weiny
-21ca85589225f145bbbc4f6ddb9ad968869b0dc8
+90df7e65ee4ae6528984bb9fd8b81132a4e79598
 
 	* infiniband-diags/scripts/ibprint[ca|switch|rt].pl: allow printing of multiple matches but print warning to user that multiple matches were found
 
 Wed May 28 17:57:19 2008 -0700 Ira Weiny
-c2aac5b5bc0ae9b533713e3f89bb89e632b5f978
+a061013fab2ad036b312112934dd935143a8b3bb
 
 	* infiniband-diags/scripts/ibprint[ca|switch|rt].pl: fix printing by name
 
 Thu May 1 15:50:45 2008 -0700 Ira Weiny
-a07137b53905eb6a9052905db88cc476270e2e26
+4ec25884064a0a5c1e9bcd02188bf1b857449a2a
 
 	* infiniband-diags/scripts/iblinkinfo.pl: fix printing of switch name when port 1 is down.
 
 Sun May 11 15:37:11 2008 +0300 Yevgeny Kliteynik
-afd0a2c761418524b88aeb86cb7cc898ca869fbd
+34f90df7e623b9eea858dae1171584457074a558
 
 	* infiniband-diags/Makefile.am: fix location of ibdiag_version.h
 
-** Version: infiniband-diags-1.4.0
-
 Thu Apr 3 20:07:55 2008 +0300 Sasha Khapyorsky
-6fe887c1561bea3d62d54ec7b13259de07bf3e8a
+7ecfb0746d6e11bf1510fc79fed5e9bf1ea97341
 
 	* management: bump all versions
 
 Sat Mar 29 14:51:00 2008 +0300 Sasha Khapyorsky
-1085a97296d9981433bafd03dd7329fb02918ab0
+e364674d7a6bf4288e26709fdbbe0f387f6cfd8a
 
 	* infiniband-diags: pass valid VLArb table size to dump func
 
 Tue Mar 25 13:35:25 2008 -0700 Hal Rosenstock
-23313e7dcaab3d6f93770a971efdf2366d2efb24
+6efbae44e1537838d38f0dd88018ca980554b88c
 
 	* infiniband-diags/vendstat.c: Fix port xmit wait handling
 
 Tue Mar 25 13:54:48 2008 +0200 Dotan Barak
-b78f726d9a91bcfad80841e94c2f1e8214a54afe
+04dd90f7cb0cb23d181bd77d4424ef6d62597a56
 
 	* management: Remove extraneous semicolon from several files
 
 Mon Mar 24 08:54:31 2008 -0700 Hal Rosenstock
-a46bf97cc1b28a7e754e3f2ae26c51a2ba2fff99
+fe928d2d08a113f85ef4fbf812af35064a3fe82c
 
 	* infiniband-diags/ibping.c: Remove extraneous semicolon
 
 Mon Mar 24 02:18:42 2008 +0000 Sasha Khapyorsky
-39c886df1f433a059996ee5ecea056ef9e48cf02
+44c58ef9a9fa8c9b0362e5a047c7a7ca80f57999
 
 	* infiniband-diags/ibsendtrap.c: indentation fixes
 
 Fri Mar 21 15:51:19 2008 -0700 Ira Weiny
-4c41ce7384585f21046d0d2ea0b0844e4b9ef966
+56814f52b7a590f1e6fa941661d0315eb56c8fe6
 
 	* Add mcm_rereg_test to test-utils option.
 
 Mon Mar 24 02:00:08 2008 +0000 Sasha Khapyorsky
-0467b0bf8bedb737d0cd7af8e4ce81fd4f5182c4
+2670e10e9969c6a2fdc281d119c6d82d59d61829
 
 	* infiniband-diags/ibsendtrap.c: add include files
 
 Fri Mar 21 15:51:17 2008 -0700 Ira Weiny
-ca07c3e9e2c93c1eebcfe8d0a14130bb1ecfe284
+bd49fb360158eb5809fc6507d1aa1423158fa296
 
 	* Add an optional test utility 'ibsendtrap'
 
 Fri Mar 21 15:51:15 2008 -0700 Ira Weiny
-d136e9ccab1941f8c2c4e04470a9da5f4fa4914d
+41591a1ab4567e4aee7afca7503d2e4a66b34048
 
 	* infiniband-diags/scripts/set_nodedesc.sh: enhance to be able to set names other than hostname and to provide feedback on the names assigned
 
 Thu Mar 20 20:01:33 2008 +0000 Sasha Khapyorsky
-7e1d5f987082e910335a75d054df29ac434b75f9
+63cc3c0b45d8b99d57db2d360facc20a2fc638cd
 
 	* saquery: trivial: remove empty line
 
 Thu Mar 20 12:00:49 2008 +0200 Yevgeny Kliteynik
-707f5e33f9b0b1d3b75616195ebc0d498a34db6c
+d2bde9575485384d8a6c94410f646f9c09c42cc1
 
 	* infiniband-diags/saquery: print SL in MCast groups
 
 Thu Mar 20 11:50:36 2008 +0200 Yevgeny Kliteynik
-ec49c62943b725c04139811965c708ca92c0f33d
+bc4041a177d7c243d4ce7623e6cf3ad249727e34
 
 	* infiniband-diags/Makefile.am: fix 'make install'
 
 Thu Mar 13 14:51:31 2008 -0700 Albert L. Chu
-75054484a23c8116e96992fcfce33e13c101613e
+4512462cd8b21de965b9988a246349f4469080d4
 
 	* add router support to check_lft_balance.pl
 
 Tue Mar 11 04:41:34 2008 -0700 Hal Rosenstock
-188e5b435308ddd001c1d9bcb49efb9ddd1a8ae7
+c195fac07db10d1842264b36b8f9c9f9280863c4
 
 	* infiniband-diags: Fix install of IBswcountlimits.pm script
 
 Thu Mar 6 18:30:37 2008 -0800 Ira Weiny
-05829e73b4cb34ffee22a93123fe7cba102a18a9
+872ec30a11b7396ed6d95c4de5f4eea76a880601
 
 	* Rename ib_gid_t in mad.h to mad_gid_t to prevent name collision with ib_types.h
 
 Sun Mar 2 10:53:41 2008 -0800 Albert Chu
-55b291048ab8646c0a63cd223aae90ca63393e86
+72dfdeca12c17debb440339babf7f022dae5e8fe
 
 	* check_lft_balance script
 
 Mon Mar 3 11:02:06 2008 -0800 Ira Weiny
-405f631bfe98306eacd3594c8146eb33ac059102
+5930ed33e4820778ae59e9208c9f6d4e0ae826ef
 
 	* Update documentation for guid format
 
 Mon Mar 3 10:59:23 2008 -0800 Ira Weiny
-5b64468efaa22fcf6458f2d0a50909186ba2e6d9
+14de5552507c2307fe6c73e22d125d5d04d047f1
 
 	* infiniband-diags/scripts/ib[linkinfo][queryerrors].pl: report switch not found
 
 Mon Mar 3 10:58:33 2008 -0800 Ira Weiny
-4f140d7402a0f0cf07e04035d61e317bdd2744e0
+1c833d172b06a741ce26c55de87931149a021d8a
 
 	* Fix bug which prevented some GUIDs from being found due to formating issues.
 
 Fri Feb 29 11:34:58 2008 -0800 Ira Weiny
-6be802f9b38f4731ee2a5f2949e8b2fdab8f5440
+cf9ce22d02c6e3ee21a0bd592279752fbed0c092
 
 	* infiniband-diags/scripts/ibprintswitch.pl: fix printing of ports
 
 Thu Feb 28 15:21:10 2008 -0800 Ira Weiny
-e6c207d81cbbcd571e8123a70846a7fb65ca649a
+fd389c5989017d04b962276b48d33aa6ab82663d
 
 	* Create script to automate perltidy command
 
 Tue Feb 12 16:33:21 2008 -0800 Jeremy Brown
-c994885813dc1160e9ce9252f2015fb9b3ee6e13
+9b82613dd0cce2b5299adc9b578f35bdbb67de02
 
 	* ibstatus - small script change
 
 Mon Feb 11 20:17:54 2008 +0200 Sasha Khapyorsky
-124ab2fefb1dcdfc009ce89634a8f4f489c3a791
+8579e3deb9020dd038f2b01ab8dfcc9ce20e67dc
 
 	* management: bump versions in master branch
 
 Thu Jan 31 20:03:04 2008 +0200 Sasha Khapyorsky
-798e8d88937d60e1454f058db2f4c705b41ec9df
+7d3bd9adbb163ea108f6890e34680a3413a51b35
 
 	* infiniband-diags: perl scripts formatting
 
 Wed Jan 30 16:05:50 2008 -0800 Timothy A. Meier
-6972276aab52479428a0f689907bcb40d95ca2ec
+55e569deee08be6c5cec6afa28844efaacc5df06
 
 	* opensm: diags bug fix in iblinkinfo.pl
 
 Wed Jan 30 14:03:50 2008 -0800 Tim Meier
-7c89dabe933d36dca1b6e7d7f1a11437a44bbaee
+45f9c2140c44c421c6cb2e25db48d07be6daf43b
 
 	* opensm: diags better error checking for DR option
 
 Wed Jan 30 14:03:50 2008 -0800 Tim Meier
-ce528a1f172ee87b48f97db375d3227ba5ecaf9b
+d1eb43f7e41736d803001d994621112253691e8b
 
 	* infiniband-diags: formatting some perlscripts
 
 Sun Jan 27 08:01:40 2008 -0800 Hal Rosenstock
-976fb99a31b97aee5cea16ecce6b1bafba137950
+a8d47f30da9490c3fae599b484d19bbe0b335cbe
 
 	* management: Update License: field in management spec files
 
 Sun Jan 27 09:31:25 2008 -0800 Hal Rosenstock
-d5ce419e2cff4c788e43aaecbf05a6c6662af26a
+16272fceb91d29b1716c81836c171a642d0cbc64
 
 	* infiniband-diags: Add missing COPYING file
 
 Sat Jan 26 22:45:09 2008 +0200 Sasha Khapyorsky
-c789beb503e0a9ad5e41be2893d66be5f4b66ea6
+986e59353da4fe5bbeee83b958cf317eec838183
 
 	* infiniband-diags: remove trailing whitespaces
 
 Thu Jan 24 18:50:38 2008 -0800 Ira K. Weiny
-6a973296ece09cbfa20954af43d8aa59a44206ae
+00257a079e8d639a001d8b836010f6b4cf4c642d
 
 	* infiniband-diags/scripts/iblinkinfo.pl: Fix switch to switch output with new
 
 Thu Jan 24 15:20:31 2008 -0800 Tim Meier
-b244f8dc9ef4c9761e89057569c4ad5e599aa497
+5eae6ab79ab30e3ab3d0d65a05bd1c3085bf9307
 
 	* opensm: update man pages for diags DR support
 
 Thu Jan 24 14:49:02 2008 -0800 Tim Meier
-604e74d3e935c6fe6f7393a892b8bf3bffab3112
+3dde3917a4f1a0710bbbeae29ee6c5477b76490c
 
 	* opensm: diags add DR path support to some utils
 
 Sun Jan 20 20:18:24 2008 +0000 Sasha Khapyorsky
-9b093e04dedb54c78d74d0567e85b3a59f88badd
+8626bfe8b1682512d5175b16f2f7744ba7175dbd
 
 	* infiniband-diags/saquery: code consolidation
 
 Sun Jan 20 19:54:33 2008 +0000 Sasha Khapyorsky
-f559875dfdbacb17221042c77aa4c8b9554ff75b
+ce5943ba4cacd6c2d8791a21d8fdebdc91dd0b98
 
 	* infiniband-diags/saquery: usage field to struct query_cmd
 
 Fri Jan 18 16:37:22 2008 -0800 Ira Weiny
-c9ccc473cb622f9b0e0a2d1a5492749d3c185484
+aeee7ee3283c6715a7cb2d9bc261bee11d617b3e
 
 	* infiniband-diags/scripts/ibprintca.pl: fix regex when searching for node by name
 
 Fri Jan 18 16:37:18 2008 -0800 Ira Weiny
-8ec0449937ae309a08bdfe7dced141f38a0dfbb7
+d681ab1613217cca52cd761143654091769e4b3f
 
 	* infiniband-diags/scripts/ibprintrt.pl: fix regex when searching for router by name
 
 Fri Jan 18 16:37:10 2008 -0800 Ira Weiny
-ddf4390479fa543b3e73f307e3c1573c46d96af7
+39761738830b335bb37e6231d093b9fcd72b7517
 
 	* infiniband-diags/scripts/ibprintswitch.pl: fix regex when searching for switch by name
 
 Fri Jan 18 17:01:10 2008 -0800 Ira Weiny
-462b55ffe4f35c8f327e950b7a0ba219cb880422
+d25693819e1ece5fda6423d4be9d53036b5e4948
 
 	* Update perl script man pages for -C and -P options
 
 Fri Jan 18 16:37:36 2008 -0800 Ira Weiny
-50d08db966b60c2d3daa899b342267a7b6937ea3
+e9a17075ba00937d60025a345b7eb2a900dd8fd1
 
 	* Add -C <ca_name> and -P <ca_port> to ibprint[ca|rt|switch].pl
 
 Fri Jan 18 16:37:28 2008 -0800 Ira Weiny
-a90a2d8e42b9444f023b9da080539af82e803e6f
+6f1d1dc3ead6fdd2315f2e925bdb5b66ddfa0bd5
 
 	* infiniband-diags/scripts/iblinkinfo.pl: clean up output format
 
 Fri Jan 18 14:38:12 2008 -0800 Ira Weiny
-178a7ad3d568ef6bbee668e4f1e29d049d4a3b59
+606a2e2cbaef7350e2809fe9195232689e3e9c1e
 
 	* infiniband-diags/scripts/IBswcountlimits.pm: clean up long lines
 
 Fri Jan 18 14:37:56 2008 -0800 Ira Weiny
-d23475aa4465e6cd8ac60871becdaec7bd1bc31f
+42109662b63e13c1e49afaf8e8e171b7a7cf247f
 
 	* infiniband-diags/scripts/IBswcountlimits.pm: Fix comment
 
 Wed Jan 16 21:16:25 2008 +0000 Sasha Khapyorsky
-fa983b2413934a86658da3e5a03413341819dcf4
+1abaf688b3d7e5c53ab320e11167076626ebbc32
 
 	* infiniband-diags/infiniband-diags.spec.in: add Obsoletes rule
 
 Tue Jan 15 17:16:25 2008 +0000 Sasha Khapyorsky
-9d38e597194d9109d48c45add71a2006366a8604
+fa584067ae4a7a0d56670ed67a56f4b223d60741
 
 	* infiniband-diags/configure.in: complib doesn't have opensm dependencies anymore
 
 Thu Jan 10 03:48:16 2008 +0200 Sasha Khapyorsky
-7bb2045bd9f659f8466a4494f4ec983f0edbf96a
+62155ca6bfd4478ff70dae2f38002f08be5d18ac
 
 	* infiniband-diags/saquery: support for VLArb and PKey Table Records
 
 Wed Jan 9 23:31:59 2008 +0200 Sasha Khapyorsky
-a099d621cf7c90b5e4c8741c22a64a94baa96e77
+e7ad26383fa8c7771da7df4ed1e196069f5743b4
 
 	* infiniband-diags/saquery: support ports with LinkRecord query
 
 Wed Jan 9 21:59:02 2008 +0200 Sasha Khapyorsky
-6756299ca62e2faafe7b6872ed536bd7223d5de0
+efaec253c4c3c57bf77362f84b29cbd3a4f66e61
 
 	* infiniband-diags/saquery: support for SL2VLTableRecord attribute
 
 Wed Jan 9 05:43:17 2008 +0200 Sasha Khapyorsky
-1e3f6d3ce5a1d1fb97559066207c20db1ac926d7
+d6d902f39837292d623a7617ff9273e936bbd0e9
 
 	* infiniband-diags/saquery: attribute names support
 
 Mon Jan 7 04:52:47 2008 +0200 Sasha Khapyorsky
-7d7dd1e173aad973e5e8fecf3b5a9f67d02ce375
+c03c2c3370fb30aca72e12657d5ca145bdfca689
 
 	* infiniband-diags: update version according to the tree state
 
 Mon Jan 7 04:32:24 2008 +0200 Sasha Khapyorsky
-c67a97b238958cf19de7013f54c027311bcde470
+c479145850752d46221b7e2d6a132ca5ce628674
 
 	* infiniband-diags: remove not needed anymore __BUILD_VERSION_TAG__
 
 Mon Jan 7 04:25:37 2008 +0200 Sasha Khapyorsky
-a4d09ecf39c32cf59460a1569c4ab8a8ae013560
+db0ca96adfec3080443ca03a75e572f6ab492e8e
 
 	* infiniband-diags: use common build version
 
 Mon Jan 7 01:40:19 2008 +0200 Sasha Khapyorsky
-c374d319d67bbc77eb885131f5136446dcc51865
+78258492afdb8d274f063670ffb9c7485a44f964
 
 	* management/*/Makefile.am: update configure.in version on 'make dist'
 
 Sun Jan 6 21:33:44 2008 +0200 Sasha Khapyorsky
-5a03b648b03235ff3ab311d61e93766d8d6bd924
+3868f7190a8d8a94d012b04f1bd1b483aedb0023
 
 	* management/*/Makefile.am: fix ChangeLog generation rule
 
 Thu Jan 3 04:20:57 2008 -0800 Hal Rosenstock
-d1470d92223f94fb3f60d5a6f549ed91e1d9d627
+b8e575f8f72c6a922117d41450c561f8f6e0c9f1
 
 	* infiniband-diags/man/ibnetdiscover.8: Add newly added ports report option
 
-** Version: infiniband-diags-1.3.5
-
 Thu Jan 3 09:44:46 2008 +0200 Sasha Khapyorsky
-97d199fc80d87dcc57865cbc06755baf9c8265a4
+738a86c5e64decc2b1d3882a0a986be77eb9ed5b
 
 	* management: bump versions
 
 Thu Jan 3 10:52:38 2008 +0200 Sasha Khapyorsky
-0cdb81012d451b27346711bc724c458dd3e01a20
+d1785f3aa8228e2dc5459afecd3d9349d69f3c5e
 
 	* infiniband-diags/dump_lfts.sh: fix switch DR Path parser
 
 Thu Jan 3 10:52:38 2008 +0200 Sasha Khapyorsky
-df191bed4f3437fa454e9e80faea601953dfec1a
+0ad9eaec6d2f2fa68dfd5713f199fbb3753b0437
 
 	* infiniband-diags/dump_lfts.sh: adopt DR Path parser
 
 Tue Dec 25 09:06:00 2007 +0200 Erez Strauss
-f9870eeac88e224f51e69bf9e5710b825e8d9ccd
+0b1d918fe0f7298b9a900d9ce08fb5d5fb463eda
 
 	* ibnetdiscover - ports report
 
 Fri Dec 21 18:32:28 2007 +0200 Sasha Khapyorsky
-0e72223889cf34ad6808792e95d4e660b472a86f
+15d6199f680e509038e20d0b338884108d35e3a3
 
 	* manangement: kill __WORDSIZE macro checks
 
 Thu Dec 13 02:09:07 2007 +0200 Sasha Khapyorsky
-f12a2ec1b41e4d670814a883b849c2e0cfdeae6c
+fb3b1e753d527faa08f863a55f7f8392fb01f2ed
 
 	* infiniband-diags/scripts: fix perfquery usage
 
 Thu Dec 13 01:57:37 2007 +0200 Sasha Khapyorsky
-0624c79cc91e800414d0813cb6b060db13bd1f47
+6ab573fc99065007dea0f460bbc374f1eca086ac
 
 	* infiniband-diags/ibcheckerrors: fix port errors count
 
 Tue Dec 11 03:55:20 2007 +0000 Sasha Khapyorsky
-3a9e90568ad06c7efbd150b1c341d14d83811ea1
+0e2ab5e8bd7242dcb28063018ee13e2c0352e21e
 
 	* infiniband-diags/ibcheckerrors: for CAs query only single ports
 
 Tue Dec 4 01:22:12 2007 +0200 Sasha Khapyorsky
-0aff2384cab4bd2e749193d92bc3155576d399b9
+aafcba658fbfaf97eede499de78b20b00f3a4819
 
 	* infiniband-diags/man: add -x option to saquery man page
 
 Mon Dec 3 19:50:44 2007 +0200 Sasha Khapyorsky
-d56fd87901b709379f2e762e0bfd13e98a247229
+b4193760335915df74256cd4dae744996f75b9bb
 
 	* infiniband-diags/saquery: allow empty src and/or dst with --src-to-dst option
 
 Mon Dec 3 19:33:10 2007 +0200 Sasha Khapyorsky
-24d6d60f327968b0eb0dcd44657405ba81b0157e
+3dccb526d62ef839f4d5bb527ea64504a745a07b
 
 	* infiniband-diags/saquery: LinkRecord query support
 
 Mon Dec 3 19:28:43 2007 +0200 Sasha Khapyorsky
-4b8fc481c6154fe61768df54ab2d4924b02cd463
+9af21edccd6d79cf0754f7ffcb4cbb0fdb71435b
 
 	* infinibad-diags/saquery: move lid resolving functions
 
 Mon Dec 3 19:24:27 2007 +0200 Sasha Khapyorsky
-c15f6491f3e1102c18670ae87b4fb884ab913e8f
+ad5628bd4c23b97921901e1c3831c44b37710f97
 
 	* infiniband-diags/saquery: add get_any_records() function
 
-** Version: infiniband-diags-1.3.4
-
 Tue Nov 20 00:04:13 2007 +0200 Sasha Khapyorsky
-6b8a7c5ebb648a6aa054c7ec69a9e804e772f416
+b0d9a6a768064891dec5c89f3e62ee6192c25ac8
 
 	* infiniband-diags: version 1.3.4
 
 Fri Nov 16 16:32:22 2007 -0700 Rolf Manderscheid
-c487cf9ad0fd133feaa28047b7902aea124db2aa
+af3f61cffeaa9d0d333c7ff6203bc5cfa406fbb4
 
 	* PATCH diags: add saquery option to get path records by GIDs
 
 Thu Nov 15 13:05:15 2007 +0200 Sasha Khapyorsky
-aff6477df60d26a4c710cbec2d49cecb89b754c2
+20695d724fbec0505556f294597296bd696cef2c
 
 	* infiniband-diags/ibtracert: print lids in decimal form
 
 Thu Nov 15 00:17:45 2007 +0200 Sasha Khapyorsky
-6e5056e36c6a5df755731628afc781f707b0ebb2
+c97a2026b62aaaa4fc67ff026abd0f9c3a7a97db
 
 	* infiniband-diags: remove utf-8 characters from sources and man pages
 
-** Version: infiniband-diags-1.3.3
-
 Tue Nov 6 19:09:16 2007 +0200 Sasha Khapyorsky
-dcad36c34e71a25d328e8c2c6fc7862751b24a34
+a192c1c6ebf253569a52129e1bf5974db0fbaae9
 
 	* infiniband-diags: version 1.3.3
 
 Thu Nov 1 19:29:02 2007 -0700 Ira K. Weiny
-7f11165e66ea42660d4103c05df166024d5ceed4
+ccb098b5f3ca59cb88d643aca24b012cfe583f03
 
 	* Change node name map implementation to use qmap in memory storage
 
 Sat Nov 3 14:58:36 2007 -0700 Hal Rosenstock
-a95cd8ff78c5436dc33f26828aa480dbed6f9c75
+7d4d4a6495a830ca338ea91b649e686f3a5ab769
 
 	* infiniband-diags/grouping.c: For Xsigo grouping, fix seg fault when no peer port
 
 Thu Nov 1 20:15:08 2007 -0700 Ira Weiny
-0c17ee47ce432099d5ae6b3ae186e867637fd2d9
+0e003f0eaa7c78e7a452437c5977aec9bc2281f2
 
 	* Move nodenamemap out of infiniband-diags into libosmcomp
 
 Fri Nov 2 20:55:22 2007 +0200 Sasha Khapyorsky
-e032988e75abbd9d6007136254dfc14bab2ec9b4
+599db496b60dd369141e39f3beb0be0aa63ab0eb
 
 	* infiniband-diags/man/smpquery: fix typo
 
 Thu Nov 1 20:15:02 2007 -0700 Ira Weiny
-a1e6f04f116333dee2cbe8dd9f3589995297ec20
+360f999d6485bce8bde53ae0fee7a202b07a641e
 
 	* Change switch map function names to reflect the new functionality of a simple node name map.
 
 Thu Nov 1 20:14:56 2007 -0700 Ira Weiny
-59fb2fdb567b5b78e033475bb87491f68792260e
+160bf41e1ae206ea89f23681cc0c9fbc5fe813f4
 
 	* use lookup_switch_name for all node types.
 
 Thu Nov 1 20:15:18 2007 -0700 Ira Weiny
-7502b025c3f94f59d327b9ef46be3900a74b0db5
+022d2f1084db70b615a284939d98e04a2a9e7b10
 
 	* infiniband-diags/src/smpquery.c : special case situation where nodename len is >= 32
 
 Thu Oct 25 11:43:17 2007 -0700 Ira Weiny
-d9d8255b392e72e2f0fd33c561637bfa015379cc
+782933071981177d04931a4230a95665e728a57e
 
 	* infiniband-diags/configure.in: fix comment
 
 Tue Oct 23 14:08:09 2007 -0700 Hal Rosenstock
-e2f29cdcc3c71891fe33135c741a94565087a1e5
+8d7a5a0fecf564301669608085f9bccd56e61666
 
 	* infiniband-diags/sminfo: Fix activity count display
 
 Tue Oct 23 06:05:44 2007 -0700 Hal Rosenstock
-b8dcfc321de09ac445fb239b59790d5a48cec137
+3d0fe12820b662304953fba895b9262a0233cdad
 
 	* infiniband-diags/scripts: Eliminate some duplicated messages
 
 Tue Oct 23 11:03:32 2007 +0200 Yevgeny Kliteynik
-5f492db6bc022ea4e5e94c224e271bdd0c82c3b9
+5b233eff723c309f700950fc004a536a98e2a1bb
 
 	* osm: QoS - adding CPI:CapabilityMask2 and turning on QOS_SUPPORTED bit
 
 Fri Oct 19 11:11:36 2007 -0700 Ira Weiny
-069413f3c0d0e657d1a0cec0bfc0b50a4d41b446
+d219fae95e053409f97117f38b7e7675c0ececdb
 
 	* infiniband-diags: Formalize BuildRequires for rpmbuild
 
 Tue Oct 16 16:30:57 2007 -0700 Hal Rosenstock
-1ad759c3d840a2c5ea0639e7ef9d9de7fd39b122
+b4d808b08ed07f68cdd185cd155049a292f876d8
 
 	* infiniband-diags/scripts: Updated for perfquery support of no AllPortSelect option
 
 Tue Oct 16 16:25:37 2007 -0700 Hal Rosenstock
-199f20e5c02a41aea674c5efd5b147eefc13f0b9
+05bc2ced372d8b31f36c8803c50982e628aee269
 
 	* infiniband-diags/perfquery.c: Support PMAs which don't support AllPortSelect option
 
 Sun Oct 14 20:11:37 2007 +0200 Sasha Khapyorsky
-a6631765dc920cbecdaf74bc57d35e1a9a45eefa
+66866e09c1da86ec5e6c8f011a42acd7ddc4d3d7
 
 	* libibcommon,infiniband-diags: move get_build_version() to diags
 
 Fri Oct 12 06:30:57 2007 -0700 Hal Rosenstock
-f7f9b89b221f226be0592af23fd1e28b0cf6a715
+0648a3e39bcf983116e34c88b7477d564004ff0a
 
 	* infiniband-diags/perfquery.c: Fix issues when checking PerfMgt:ClassPortInfo.CapabilityMask
 
-** Version: infiniband-diags-1.3.2
-
 Thu Sep 20 19:41:12 2007 +0200 Sasha Khapyorsky
-4864ac0e838199065002b6896d0096ff670a9cf4
+a9e9021fdbc306d7d4b6bce1f69904e9c17eb6cb
 
 	* infiniband-diags: update version to 1.3.2
 
 Thu Sep 20 18:04:12 2007 +0200 Sasha Khapyorsky
-eda4ed05438c494e4e529441458b46e1c87dbcd3
+dfd2c903eeae56aed470bbfb6f6e59cd5331e328
 
 	* management/*/*.spec.in: change Source field to OFA paths
 
 Wed Sep 19 03:37:03 2007 +0200 Sasha Khapyorsky
-a0364d5bf62bcda019ef3c1c74cd51583fda632d
+9176134f1a979ca880f7413b3a81c8e1f72d527b
 
 	* management/*/configure: RELEASE and TARBALL for spec files
 
 Wed Sep 19 03:42:52 2007 +0200 Sasha Khapyorsky
-5abefe48a7553251238b1f8cb123a2a200b4d147
+f971305587c9d44ddb20542d2a46af7be0838bfb
 
 	* management/*/Makefile.am: generate ChangeLog files when distributed
 
 Wed Sep 19 03:28:43 2007 +0200 Sasha Khapyorsky
-08b7f02ea643b45e42534c61f58fae5b3348bb06
+01af39b2b79c7457b39ebeae829de74829fa024f
 
 	* management/*/Makefile.am: clean dist-hook target
 
 Wed Sep 19 02:00:08 2007 +0200 Sasha Khapyorsky
-07b65d1277d2d4a6ac6240ba5c7c3c691292001c
+a435c184928ad672dad014ed8c9d41d6194b12d0
 
 	* management/*/*.spec.in: don't run autogen.sh
 
 Wed Sep 19 12:39:44 2007 +0200 Sasha Khapyorsky
-61db22fe367266955af97c3cdb402a5ce3fc4c55
+803fec08da4b069c47e3e0684d878437f455d9b4
 
 	* management/*/Makefile.am: fix include paths
 
 Wed Sep 19 06:36:00 2007 +0200 Sasha Khapyorsky
-ce8ff1a1b269be80bba9badd7b2cdd9dc51e78ab
+53de3e14348eff17e8354f2d527f13d0af284f2a
 
 	* libibmad,infiniband-diags: fix include paths
 
 Wed Sep 19 03:00:44 2007 +0200 Sasha Khapyorsky
-40ef7db43d2117456cd6aa9e97f56d5f3a29e1a1
+807865b7d12fbb58e52757638475e8fe59b657c6
 
 	* management/*/ChangeLog: trivial spacing fixes
 
 Wed Sep 19 02:05:57 2007 +0200 Sasha Khapyorsky
-063ff2ecb12fe0c94e472fad27b8c40371904113
+59bcb7ce564a940e0fad68cfd08ba360e6705507
 
 	* management/*/Makefile.am: add autogen.sh script to 'make dist'
 
 Tue Sep 18 04:31:56 2007 -0700 Hal Rosenstock
-57697c31cb165fca7cc14692e0b14bc2b4b6e062
+83a1d77451c43326cea6a47bbb0378ad434af803
 
 	* infiniband-diags/ibnetdiscover: Bump build version
 
 Tue Sep 18 00:41:21 2007 +0200 Sasha Khapyorsky
-5afb358d162f5cfe3f8390d49463e79245dbdba2
+7fbcedce265ae759f5475474333e8dbece640808
 
 	* infiniband-diags/ibnetdiscover: trivial code simplifications
 
 Thu Sep 13 17:36:34 2007 -0700 Hal Rosenstock
-ff68d1caa0a7c094f51a084c1fffac3e86c1b4e2
+12da31ea6580928639a389a644a067f4492e61e4
 
 	* ibnetdiscover: Support Xsigo chassis grouping
 
 Mon Sep 17 20:53:30 2007 +0200 Sasha Khapyorsky
-5a307143f9e6c0a6170d4be76e6d0513fe9d3622
+adfe1178860a6d552a4c65883bf43ae3dee3f828
 
 	* opensm and all: fix Source field in spec.in files.
 
 Thu Sep 6 13:22:23 2007 +0300 Sasha Khapyorsky
-f58db63ee8cfae2486da92a8b094f87c3dd4aa4c
+bea13ae0456af09e00e29716dfd33bd0e8d586f4
 
 	* infiniband-diags: use shared ibdebug var
 
 Fri Sep 7 15:21:21 2007 -0700 Ira Weiny
-cd6b9f66456baade868048f5a93d6ce0d8680255
+d1f3b1a2a4e90238ac0b9ae6d48e5289e4242e3a
 
 	* Fix regexp's for new ibnetdiscover output
 
 Fri Sep 7 15:19:25 2007 -0700 Ira Weiny
-8dbbcf4f5248259cd9d469ea3dd5ede1c7135099
+eeca1cde7278f76a7fb66b1a6794dbc9b0164dde
 
 	* infiniband-diags/src/ibdiag_common.c: do not print warning of failed default switch map open
 
 Fri Sep 7 15:19:24 2007 -0700 Ira Weiny
-64f4da18538ec678890d1977ea484533f45f6b83
+874741bffe3461c0efe8fa1aaaa9239d56344891
 
 	* infiniband-diags/src/smpquery.c: fix compiler warning
 
 Fri Sep 7 15:25:41 2007 -0700 Ira Weiny
-a8870e99349a471292ee874d6f7b2bd9a287f6d5
+05b0cd513c1caaf804d54bd344c0fc823e3b30a3
 
 	* Add -C and -P options to perl diags to be able to use alternate CA's and ports
 
 Thu Aug 30 09:24:35 2007 -0700 Ira Weiny
-f5cd4b34449ebb3dda2926b3e5dbf2b2ccc55d27
+69b63fa34ebb7870353eb1232375be9c78d74a11
 
 	* infiniband-diags/Makefile.am: clean up extra directives
 
 Thu Aug 23 14:46:48 2007 -0700 Ira Weiny
-05cae48f68250346dc02b3583044664d6ca6474e
+eb35d7d55199ce6496bbfff3522d6d37ad66ec7b
 
 	* infiniband-diags/src/smpquery.c: Add switch-map support for nodedesc query
 
 Tue Aug 21 14:44:58 2007 +0300 Yevgeny Kliteynik
-159497a11b9d01de37bbfe82e80c5e685cafdf8b
+ef8c0b37c2d7569941647555d1f1f9b0a75b3772
 
 	* osm: QoS - adding new PathRecord fields
 
 Tue Aug 14 18:06:14 2007 -0700 Ira Weiny
-f49671595a41fc18c9fa780bb71a0c9c8b08950e
+8a93339145383e48e61dcabfd0483729d930e00b
 
 	* iblinkinfo.pl: Remove annoying double quote around switch name.
 
 Thu Aug 9 19:03:32 2007 -0700 Ira Weiny
-9b2202bb79b153e51fda06860fcb8e45aaf43718
+de992988200185aaa97f17d5e49f648bb16dc3c0
 
 	* infiniband-diags/set_mthca_nodedesc.sh: change to work for all HCA's
 
 Thu Aug 9 19:03:31 2007 -0700 Ira Weiny
-dd25b7227341d94cec03dc4d3b5c603c288a79d8
+eb1a85399667b3a78e233898d91b3d3bfd8bbd5b
 
 	* infiniband-diags/set_mthca_nodedesc.sh: change to work for all HCA's
 
 Wed Aug 8 22:48:15 2007 +0300 Bernd Schubert
-83d1f5ea339704f30e26918a897f9ead5a10678e
+fdcb7763408d40261623b026a12bdbe636c805bc
 
 	* ibnetdiscover: man page improvement
 
 Tue Jul 31 19:09:54 2007 -0500 davem at systemfabricworks.com
-00621927883f14da4bb8e289d03478af89109b59
+d4a17c49fbeb6a08553b57f83ca58c35aba327de
 
 	* infiniband-diags/scripts: Fix Bug 239 Error Reporting
 
 Tue Jul 31 15:39:27 2007 -0500 davem at systemfabricworks.com
-ab4d5ad9161d9d48bc0c9fe91cac5a8cf221a377
+4fcb80fc9ac33873bd03eefdbe25609f87bdf7c2
 
 	* infiniband-diags: Add common flags -P, -C, and -t
 
 Thu Aug 2 16:10:19 2007 +0300 Yevgeny Kliteynik
-6d9161ec35df7b517b511322a2827e680f9f5187
+3518ece979a687bf14e5ec5d0f0b2d4d31230462
 
 	* osm: cosmetics - removing trailing blanks
 
 Fri Jul 20 10:12:03 2007 -0500 davem at systemfabricworks.com
-3ef34b1e7a30910256b9a5bb046492ece778d157
+50c5fdb9a45816590a8e2fb4c882327319896cad
 
 	* infiniband-diags/ibnetdiscover: Fix DDR link speed decode
 
 Fri Jul 20 10:09:50 2007 -0500 davem at systemfabricworks.com
-1f06b344e924e17ae02d5fc12145eaf19ee8a18d
+a1d599fa9ba35dd1b3a4774ab1483ba63d2420ef
 
 	* infiniband-diags/scripts: Handle new and old topology file format
 
 Thu Jul 19 07:28:09 2007 +0300 Sasha Khapyorsky
-2cd643633e2e89f7e45879c9a8066544d5a258d7
+fd158762068cb105b9b3379b48f9aa14d0ef3d18
 
 	* infiniband-diags: remove trailing whitespaces
 
-** Version: infiniband-diags-1.3.1
-
 Tue Jul 10 17:23:06 2007 -0400 Hal Rosenstock
-f70a56612537aced5262c45ba8a6e4649309c72b
+7c33825faf3927e4dfc0fe599884a1a4bbb1c183
 
 	* infiniband-diags: Updated to version 1.3.1
 
 Wed Jun 20 08:44:33 2007 -0400 Hal Rosenstock
-2129dc03a3e359a4b06886a3f9c85ff4ae8e3ed6
+25448da98b8e5bc99e6381200e438e8e47392288
 
 	* infiniband-diags: Use diag common code ib_error routine
 
 Mon Jun 18 06:58:20 2007 -0400 Hal Rosenstock
-987b30e8b5c9f3ae4979d107b1ef4f4ffb2da50c
+183a433ed832d3eff9eaddfa1028e75ccb4132bb
 
 	* infiniband-diags/src/ibtracert.c: Cosmetic change to IBWARN message
 
 Mon Jun 18 06:11:57 2007 -0400 Hal Rosenstock
-c4a826dd5ffcc9b56f0c74786b4ff9432f3decfa
+4e2bded53687ffc12cc31b82d648ef296dc6c471
 
 	* infiniband-diags/man/ibaddr.8: Improve description
 
 Thu Jun 7 09:49:16 2007 -0400 Hal Rosenstock
-382d0c07593a5076882a21e3e6731fadfc4c78c0
+40dc7d4e19ac9d7017bc8abb8ad1cca3e850c893
 
-	* infiniband-diags/scripts/ibidsverify.pl: Validate port GUID against node GUIDs
+	* infiniband-diags/scripts/ibidsverify.pl: Validate port GUID against node GUIDs Note only one port GUID can duplicate a node GUID
 
 Thu Jun 7 09:00:31 2007 -0400 Hal Rosenstock
-8b3b297d59169b0e74876dc6d853453abf4fa3a8
+0ff55b33b23afe4925fd617f8eaeb8531421d67c
 
-	* infiniband-diags/scripts/ibidsverify.pl: Normalize portguid format to be
+	* infiniband-diags/scripts/ibidsverify.pl: Normalize portguid format to be the same as nodeguid format (0x preceeding the guid)
 
 Thu Jun 7 08:55:18 2007 -0400 Hal Rosenstock
-4b0dd04ea03ad5c62ebe9c1e86f948d32d8de3e2
+8adc2f85ab9ee788b7e69a4190b18968550ac184
 
-	* infiniband-diags/scripts/ibidsverify.pl: Fix parsing of node and port GUIDs
+	* infiniband-diags/scripts/ibidsverify.pl: Fix parsing of node and port GUIDs for switches
 
 Thu Jun 7 08:38:05 2007 -0400 Hal Rosenstock
-302d1717a95bf33a83455ae6e0e3d8a2f49ae796
+762dab1bc92d195e7a09f632051947ae8051aa06
 
 	* infiniband-diags/scripts/ibidsverify.pl: Cosmetic formatting changes
 
 Tue Jun 5 15:07:43 2007 -0400 Hal Rosenstock
-d994e007156287f0794dd15b17f0dfa0782ea106
+f9e45b389c08d4033d258139dae3d064501c2ae7
 
 	* infiniband-diags/ibidsverify.pl: Support port GUID validation
 
 Tue Jun 5 15:07:08 2007 -0400 Hal Rosenstock
-f242dfb98c7ea73cbe8503061e28e6792c6a6e34
+d3732ecd9f1a17b73756b61e4d42cb9db7cc0580
 
 	* infiniband-diags/ibnetdiscover: Add port GUIDs to topology file
 
 Tue Jun 5 14:29:34 2007 -0400 Hal Rosenstock
-4bb50d9b65331103c1884ceb54d3044364586dff
+b351940ef1fcc80da83787a69c9a87af529c20ce
 
 	* infiniband-diags/man/ibnetdiscover.8: Fix a typo
 
 Tue Jun 5 14:10:32 2007 -0400 Hal Rosenstock
-8996ae8bd0343db98538993e761f70579acaf3a3
+a8fab72f6698d67e7af3af6da1d6f4ae19fd3635
 
-	* infiniband-diags/scripts/ibidsverify.pl: Generalize validate_non_zero_guid
+	* infiniband-diags/scripts/ibidsverify.pl: Generalize validate_non_zero_guid for GUID rather than NodeGUID to ready for adding PortGUID verification
 
 Tue Jun 5 13:36:11 2007 -0400 Hal Rosenstock
-fbe0ab70a78941553308f4a6054ad1c42b5cb831
+1332c73b0ccb369aaec9a4d5701e2044ff189986
 
-	* infiniband-diags/src/ibnetdiscover.c: Minor changes to minimize differences
+	* infiniband-diags/src/ibnetdiscover.c: Minor changes to minimize differences for adding port GUID into topology file
 
 Tue Jun 5 13:29:58 2007 -0400 Hal Rosenstock
-c3e9d741b149b73c01d3cdd0ca962e399fe84498
+94f0079e9b47f168f5852a35ff6c35e7ba523435
 
-	* infiniband-diags/src/ibnetdiscover.c: In get_node, set portguid to NodeInfo
+	* infiniband-diags/src/ibnetdiscover.c: In get_node, set portguid to NodeInfo PortGUID rather than NodeGUID
 
 Tue Jun 5 09:11:56 2007 -0400 Hal Rosenstock
-3ac744235eda8db4af35a599db50f5457adb305d
+6641029b5da88ee80ad5fbaa1cd52d1eddae1f15
 
-	* infiniband-diags/man/ibnetdiscover.8: Added text description for
+	* infiniband-diags/man/ibnetdiscover.8: Added text description for active link width and link speed
 
 Mon Jun 4 12:10:10 2007 -0400 Hal Rosenstock
-04ba39a8da9eea069d674ad1717892d51e223485
+88db7275231eff0591b7f9b8a0158f6f5e81a81d
 
 	* ibnetdiscover: Add link width and speed to topology file output
 
 Mon Jun 4 08:33:26 2007 -0400 Hal Rosenstock
-e2d932d209b44c3302f200fca7e4ead55358e74b
+bea47292bf3e841426e0848885ee5b3d8db65f29
 
 	* infiniband-diags/src/ibnetdiscover.c: Cosmetic formatting change
 
 Sat Jun 2 05:58:01 2007 -0400 Hal Rosenstock
-ddf458c596bf6f76c0e8eee93370b5f5add51151
+1af3748277e853a55f0761e6304a7da179a16cdf
 
 	* infiniband-diags/man/ibnetdiscover.8: Add topology file format section
 
 Fri Jun 1 23:30:36 2007 -0400 Hal Rosenstock
-c228c1482bccd3a5a5f4d4b24e9b7c899dcecb76
+041fbe3708c74298ecf698e65ba9c51e27e28a7a
 
 	* infiniband-diags/man/ibnetdiscover.8: Add grouping information
 
 Fri Jun 1 19:36:08 2007 -0400 Hal Rosenstock
-ffe687edd1a3b283b45cbb731b957eafc07e4578
+160e22380610dbcb25466eaba2a3eee1ab64735a
 
 	* infiniband-diags/ibnetdiscover: Fix list by nodetype operations
 
 Fri Jun 1 15:52:26 2007 -0400 Hal Rosenstock
-ac006797463f7c92f1063ef8f5135f8db83231e4
+f6fa70500e4590d9cbf3f8ff3a9b2ef4f28cba79
 
 	* infiniband-diags/man/ibnetdiscover.8: Cosmetic changes
 
 Fri Jun 1 15:39:23 2007 -0400 Hal Rosenstock
-434001f5cc089528a8a4887704150f0831350445
+f8b4af2d3e42f4b7b15556bb714760ba4f1f40dc
 
 	* infiniband-diags/ibnetdiscover: Add supporti for -R(outer_list) option
 
 Fri Jun 1 11:12:07 2007 -0400 Hal Rosenstock
-6e408400647b8005173f6cf2a859ea86a0565df2
+ff9957480ed5b975d6c0c093c00d4f20088f2aa1
 
 	* infiniband-diags/Makefile.am: Add ibidsverify
 
 Fri Jun 1 11:08:14 2007 -0400 Hal Rosenstock
-a6e068d911bcbfdfaa0e08381cca987d71bd7a84
+84861fa8674c2daa48e788f78f1fdbfc1a8f354e
 
-	* infiniband-diags/scripts/ibidsverify.pl: Add initial version of ibidsverify.pl
+	* infiniband-diags/scripts/ibidsverify.pl: Add initial version of ibidsverify.pl script
 
 Fri Jun 1 11:05:29 2007 -0400 Hal Rosenstock
-cf9de8a5777d28b131fa169b5c9613f0aa21e1c7
+403dc8cd132d8acb27b4950a6c6dd023c0cee0b5
 
 	* infiniband-diags/scripts/IBswcountlimits.pm: Fixed typo and other cosmetic changes
 
 Fri Jun 1 09:18:18 2007 -0400 Hal Rosenstock
-57ed02cf529bbd51bfec69b14dd4b5be6bc98013
+e381c6a96b70fccbc17472d7d2362de95bdb28da
 
 	* infiniband-diags/scripts/iblinkinfo.pl: Cosmetic formatting change
 
 Fri Jun 1 08:22:35 2007 -0400 Hal Rosenstock
-31706f2c67e889ece29c182da695fcac1477fb07
+bcaebf3d1c860aab92678f68ea2a67f3c8cd7faf
 
 	* infiniband-diags/scripts/ibqueryerrors.pl: Cosmetic change
 
 Fri Jun 1 08:12:04 2007 -0400 Hal Rosenstock
-def0e28c62b523986ea0e728f08c28774b42b40f
+d39af4afab4957f4e5d38004546f1a5245e86b62
 
 	* infiniband-diags/man/ibidsverify.8: Add man page for ibidsverify.pl script
 
 Thu May 31 12:33:39 2007 -0400 Hal Rosenstock
-7e1de26737a976d8caed4cc8a777cb8912281e89
+343e890726faa50c61aae171f45cd0f382e07dbd
 
-	* management/*.spec: Remove *.spec files from management git repo
+	* management/*.spec: Remove *.spec files from management git repo as committed files. They are generated files.
 
 Thu May 31 11:41:16 2007 -0400 Hal Rosenstock
-f95d24b405eb9da8d9c32b088107aec1fd94acf7
+d01f5e1398e971e4cb6a32dcd1ccfe2fcc975283
 
-	* management/*.spec: Latest daily versions of .spec files
+	* management/*.spec: Latest daily versions of .spec files (prior to removing these due to build changes)
 
 Thu May 31 08:19:16 2007 -0400 Hal Rosenstock
-57cf01dadae4128e93cbd826f5f8942da0be777c
+913311ad7451f461e55b15e96890bf67cb83a945
 
-	* infiniband-diag/man/(ibprintca ibprintswitch ibprintrt).8: Add description
+	* infiniband-diag/man/(ibprintca ibprintswitch ibprintrt).8: Add description of list capability to man pages
 
 Thu May 31 06:34:52 2007 -0400 Hal Rosenstock
-bee435ac8e7c87d98fa61842447e0b7e145ca92d
+a8c7e71e332ee9f387a251513c8bc14de5200daf
 
 	* infiniband-diags: Add ibdatacounters
 
 Thu May 31 06:30:56 2007 -0400 Hal Rosenstock
-4dfb000eea846fa8b771a07d5aa037bc876ec776
+b1c72b6d21c5363fe3f47bf8fb1e0bcff4355519
 
-	* infiniband-diags/ibdatacounters: Add script and man page for subnet wide
+	* infiniband-diags/ibdatacounters: Add script and man page for subnet wide data counters
 
 Thu May 31 06:19:07 2007 -0400 Hal Rosenstock
-96c4081f5fd2f71d065ba1f8e0e6b836f6f1819b
+152d8bbba98aa8b6544a0f822802c1afd95a8dd6
 
 	* infiniband-diags/configure.in: Change IBSCRIPTPATH from bindir to sbindir
 
 Wed May 30 17:24:23 2007 -0400 Hal Rosenstock
-520481d0ee8efd843fb37b8bd810a83ffb862380
+90ef0643c4d9ee3ffbff5a4465dc3c5603c71ebf
 
 	* infiniband-diags/(Makefile.am configure.in): Add ibrouters and ibprintrt.pl
 
 Wed May 30 17:18:45 2007 -0400 Hal Rosenstock
-1965910937d8a9234ad29d8a20593e078dd321aa
+01ff4ad34a92182e237d039ae080328523103967
 
-	* infiniband-diags: Add scripts and man pages for display of IB routers
+	* infiniband-diags: Add scripts and man pages for display of IB routers (ibrouters.in, ibprintrt.pl, ibrouters.8, ibprintrt.8)
 
 Wed May 30 17:14:04 2007 -0400 Hal Rosenstock
-4b5109f567c4bea99f39f367d74932462aea167d
+ad1acd658f8b824fb4278119bd04351e9e517350
 
-	* infiniband-diags/scripts/ibprintca.pl: Fix bug introduced in last commit
+	* infiniband-diags/scripts/ibprintca.pl: Fix bug introduced in last commit which caused compilation error
 
 Wed May 30 13:36:29 2007 -0400 Hal Rosenstock
-70a0fc4bcd88d9628d49248984e0351b3ed16b28
+a3305b761e0828a26f4ae02407f39c75b462e6d0
 
 	* infiniband-diags/scripts/ibqueryerrors.pl: Add GUID to output line for ports
 
 Wed May 30 13:25:16 2007 -0400 Hal Rosenstock
-822d47411cb00b556ee6538f42e1aa50e6e2e414
+c521a155f3e62065fea3b06008b577d13e5208ba
 
-	* infiniband-diags/scripts/(ibcheckerrs ibcheckport ibcheckportstate
+	* infiniband-diags/scripts/(ibcheckerrs ibcheckport ibcheckportstate ibcheckportwidth ibdatacounts).in: Add lid and port into verbose output
 
 Wed May 30 11:18:08 2007 -0400 Hal Rosenstock
-6e205b80e9a257c9e53343d61a8b3c84d7cd377d
+459536621c993926ffbbf538c9c16d4b362a04a1
 
-	* infiniband-diags/scripts/(ibcheckerrs ibcheckport ibdatacounts).in:
+	* infiniband-diags/scripts/(ibcheckerrs ibcheckport ibdatacounts).in: Changed portnum to port in output
 
 Wed May 30 10:00:24 2007 -0400 Hal Rosenstock
-07a3845b10029a7d74d75fb4aad49dabc6b7af5b
+5a14e8fa23513799587a097ec059fb699020c470
 
-	* infiniband-diags: Updated configure.in and Makefile.am for ibdatacounts
+	* infiniband-diags: Updated configure.in and Makefile.am for ibdatacounts script and man page
 
 Wed May 30 09:55:57 2007 -0400 Hal Rosenstock
-01768eab686ce471b46bd2294c99da748c71c19d
+01952b41745424c2ddb978960504a775c55c58b6
 
 	* infiniband-diags/man/ibdatacounts.8: Cosmetic change
 
 Wed May 30 09:22:40 2007 -0400 Hal Rosenstock
-f869b25f79fac528d4a48949306740575cc84c71
+bfaff30da5769c73a5af392e218a7e404dcdd187
 
-	* infiniband-diags/ibdatacounts.(in 8): Add script to display
+	* infiniband-diags/ibdatacounts.(in 8): Add script to display only data counters and associated man page
 
 Sat May 26 15:54:58 2007 -0400 Hal Rosenstock
-f0dae399a615e5454c4a5628d71ec8fb6788e473
+a9f3b186120184df96bc8ea341e215c138071500
 
-	* infiniband-diags/scripts/IBswcountlimits.pm: Fix node description parsing
+	* infiniband-diags/scripts/IBswcountlimits.pm: Fix node description parsing for switches
 
 Sat May 26 07:47:44 2007 -0400 Hal Rosenstock
-d822781280d4e4768dea641ea3e84a7bf9862eff
+78111b4ca8d37f29703546b0f650b1c4b40aba34
 
-	* infiniband-diags/scripts/iblinkinfo.pl: Add peer port link width and speed
+	* infiniband-diags/scripts/iblinkinfo.pl: Add peer port link width and speed validation
 
 Fri May 25 19:32:38 2007 -0400 Hal Rosenstock
-2886865fbc8b24fe3e079c72f4d28b2f1d9cbe96
+caa39fc6d9732396bdbf1948bd7171fa4af5cd66
 
-	* infiniband-diags/ChangeLog: Add log entry for change to IBswcountlimits.pm
+	* infiniband-diags/ChangeLog: Add log entry for change to IBswcountlimits.pm for router support
 
 Fri May 25 19:31:35 2007 -0400 Hal Rosenstock
-4b7043b1a0ddb1e42056fa7d5b1a81b772d71e31
+c156628cb66af6273299cf25d2df3b467c3034c8
 
 	* infiniband-diags/scripts/IBswcountlimits.pm: Add support for routers
 
 Fri May 25 12:55:28 2007 -0400 Hal Rosenstock
-df284845acc64c54b3c24cd65b090f5c8548802d
+90a529b4faa74570976084c1e276d1e6f7eb298d
 
-	* infiniband-diags/ChangeLog: Add log entries for script changes
+	* infiniband-diags/ChangeLog: Add log entries for script changes to IBswcountlimits.pm and iblinkinfo.pl
 
 Fri May 25 12:52:20 2007 -0400 Hal Rosenstock
-27cf9e7978ca34acf986943f6f1753dbf7245d33
+2c146e65b010a3e8db27f6f55116f2aec168e93a
 
-	* infiniband-diags/scripts/iblinkinfo.pl: Display remote LID with peer
+	* infiniband-diags/scripts/iblinkinfo.pl: Display remote LID with peer port info
 
 Fri May 25 12:51:53 2007 -0400 Hal Rosenstock
-23314ec4e5ce47f95470d76aaa67ccb165b06fab
+df8acd9eb2589979a435996258828553136c1c1f
 
-	* infiniband-diags/scripts/IBswcountlimits.pm: Add support for rem_lid in
+	* infiniband-diags/scripts/IBswcountlimits.pm: Add support for rem_lid in get_link_ends subroutine
 
 Fri May 25 09:10:18 2007 -0400 Hal Rosenstock
-2539d125121efdbe05057082c0abc1a027a3aacd
+1d1530fb215273f91b6eaa1c783b7c8291054a43
 
-	* infiniband-diags/src/ibportstate.c: Handle peer ports at 1x that
+	* infiniband-diags/src/ibportstate.c: Handle peer ports at 1x that should be wider and 2.5 Gbps that should be faster
 
 Fri May 25 08:48:08 2007 -0400 Hal Rosenstock
-124eafc527b5b4e7c5803ebc2099c52bd8e130dc
+13490070db00c145b7f0a2225ed7ace10451bdb8
 
-	* infiniband-diags/src/ibportstate.c: Add LinkSpeed/Width related components
+	* infiniband-diags/src/ibportstate.c: Add LinkSpeed/Width related components to output
 
 Thu May 24 08:43:27 2007 -0400 Hal Rosenstock
-c9b96ed731be173c225a4ab05356580d255e5303
+9d10ef557cd6edd06780c7451d4848a3f816a6b8
 
 	* infiniband-diags/scripts/ibprintca.pl: Add support for routers
 
 Wed May 23 14:20:19 2007 -0400 Hal Rosenstock
-22d978b5bfa00ba9a411158c42afa6553f5cdc4d
+f49c6114addab8444d0961f780823c33141b883b
 
 	* infiniband-diags/scripts: Add support for IB routers in existing scripts
 
 Wed May 23 06:40:58 2007 -0400 Ira K. Weiny
-0fe47bef34b0fbb5ccfeb611b36cca5796faf44b
+4085ee4a9005f6f7cab28050a2f0d63d8794a213
 
 	* infiniband-diags/infiniband-diags.spec.in: Move commands from bin to sbin
 
 Tue May 22 15:34:45 2007 -0400 Hal Rosenstock
-d5482bd716e61da6f88795d379c44d48513d2e1d
+82aea277bb8541a297b5eef34af4208112e843ad
 
 	* Diags/man: Cosmetic changes
 
 Mon May 21 15:01:45 2007 -0400 Hal Rosenstock
-1f6d53e1db20be451719dfad627ef2e7ad797c1b
+552c82f2e6bc8eb09907e8132e0dd70ebcc9608c
 
 	* diags/man: Fixed some formatting
 
 Tue May 15 12:02:50 2007 -0400 Hal Rosenstock
-32f711a36f98962ec2c9d2a4d79e9c57321e5586
+dbbe9cb983e2e67cd5ffa0ac38a494392f930402
 
 	* infiniband-diags/Makefile.am: Move diag programs and scripts from bin to sbin
 
+Tue May 15 09:26:48 2007 -0400 Hal Rosenstock
+75f187e14908df40ab7ad0eff3e87da381b9ba74
+
+	* Merge branch 'master' of git://staging.openfabrics.org/~halr/management
+
 Mon May 14 13:31:05 2007 -0400 Hal Rosenstock
-03e1e509d8fc8cf7667ca04b0c67a11eb35fbad3
+f79504952e7817a07d0adb2359abf1cadcd31f1f
 
 	* spec summary changes
 
 Wed May 9 19:15:57 2007 -0400 Hal Rosenstock
-2d416a8130b6ee23b9938f79d77fcbda266e8f2c
+0832be7ea9b83e84083d6e859455b75fb3145fb6
 
-	* infiniband-diags/configure.in: Changes for changing from openib-diags
+	* infiniband-diags/configure.in: Changes for changing from openib-diags to infiniband-diags
 
 Thu Apr 12 16:52:49 2007 -0400 Hal Rosenstock
-f6fd8b0390f5cd16c04fbbeb65d1cdb5e082aa86
+e4d681de516743f6a0d94d679b8332c57c71528f
 
-	* Diags: Renamed openib-diags to infiniband-diags
+	* Diags: Renamed openib-diags to infiniband-diags Also, some other changes based on this (openib-diags.spec.in moved to infiniband-diags.spec.in, openib-diags.spec moved to infiniband-diags.spec, and Makefile.am changed for this)
diff --git a/Makefile.am b/Makefile.am
index c22ba5e..33b5f90 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,8 @@
+ACLOCAL_AMFLAGS = -I config
+SUBDIRS = libibnetdisc
 
-INCLUDES = -I$(top_builddir)/include/ -I$(srcdir)/include -I$(includedir) -I$(includedir)/infiniband
+INCLUDES = -I$(top_builddir)/include/ -I$(srcdir)/include -I$(includedir) \
+	-I$(includedir)/infiniband -I$(top_srcdir)/libibnetdisc/include
 
 if DEBUG
 DBGFLAGS = -ggdb -D_DEBUG_
@@ -10,116 +13,139 @@ endif
 sbin_PROGRAMS = src/ibaddr src/ibnetdiscover src/ibping src/ibportstate \
 	        src/ibroute src/ibstat src/ibsysstat src/ibtracert \
 	        src/perfquery src/sminfo src/smpdump src/smpquery \
-	        src/saquery src/vendstat
+	        src/saquery src/vendstat src/iblinkinfo \
+		src/ibqueryerrors src/ibcacheedit src/ibccquery \
+		src/ibccconfig
 
 if ENABLE_TEST_UTILS
 sbin_PROGRAMS += src/ibsendtrap src/mcm_rereg_test
 endif
 
-sbin_SCRIPTS = scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode \
-               scripts/ibcheckport scripts/ibhosts scripts/ibstatus \
-	       scripts/ibswitches scripts/ibnodes scripts/ibrouters \
-	       scripts/ibcheckwidth scripts/ibcheckportwidth \
-	       scripts/ibcheckstate scripts/ibcheckportstate \
-	       scripts/ibcheckerrors scripts/ibclearerrors \
-	       scripts/ibclearcounters scripts/ibdatacounts \
-	       scripts/ibdatacounters scripts/ibdiscover.pl \
-	       scripts/dump_lfts.sh scripts/dump_mfts.sh \
-	       scripts/set_nodedesc.sh \
-	       scripts/ibqueryerrors.pl scripts/ibswportwatch.pl \
-	       scripts/iblinkinfo.pl scripts/ibprintswitch.pl \
-	       scripts/ibprintca.pl scripts/ibprintrt.pl \
-	       scripts/ibfindnodesusing.pl scripts/ibidsverify.pl \
-	       scripts/check_lft_balance.pl
-
-src_ibaddr_SOURCES = src/ibaddr.c src/ibdiag_common.c
-src_ibaddr_CFLAGS = -Wall $(DBGFLAGS)
-
-src_ibnetdiscover_SOURCES = src/ibnetdiscover.c src/grouping.c src/ibdiag_common.c
-src_ibnetdiscover_CFLAGS = -Wall $(DBGFLAGS)
-src_ibnetdiscover_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-
-src_ibping_SOURCES = src/ibping.c src/ibdiag_common.c
-src_ibping_CFLAGS = -Wall $(DBGFLAGS)
-
-src_ibportstate_SOURCES = src/ibportstate.c src/ibdiag_common.c
-src_ibportstate_CFLAGS = -Wall $(DBGFLAGS)
-
-src_ibroute_SOURCES = src/ibroute.c src/ibdiag_common.c
-src_ibroute_CFLAGS = -Wall $(DBGFLAGS)
-
-src_ibstat_SOURCES = src/ibstat.c
-src_ibstat_CFLAGS = -Wall $(DBGFLAGS)
-
-src_ibsysstat_SOURCES = src/ibsysstat.c src/ibdiag_common.c
-src_ibsysstat_CFLAGS = -Wall $(DBGFLAGS)
+sbin_SCRIPTS = scripts/ibhosts \
+		scripts/ibswitches scripts/ibnodes scripts/ibrouters \
+		scripts/ibfindnodesusing.pl scripts/ibidsverify.pl \
+		scripts/check_lft_balance.pl \
+		scripts/dump_lfts.sh scripts/dump_mfts.sh \
+		scripts/ibstatus
+
+if ENABLE_COMPAT_UTILS
+sbin_SCRIPTS += scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode \
+		scripts/ibcheckport scripts/ibcheckportwidth scripts/ibcheckportstate \
+		scripts/ibcheckwidth scripts/ibcheckstate \
+		scripts/ibcheckerrors scripts/ibdatacounts \
+		scripts/ibdatacounters scripts/ibdiscover.pl \
+		scripts/ibswportwatch.pl \
+		scripts/ibqueryerrors.pl scripts/iblinkinfo.pl \
+		scripts/ibprintca.pl scripts/ibprintswitch.pl scripts/ibprintrt.pl \
+		scripts/set_nodedesc.sh scripts/ibclearerrors scripts/ibclearcounters
+endif
 
-src_ibtracert_SOURCES = src/ibtracert.c src/ibdiag_common.c
-src_ibtracert_CFLAGS = -Wall $(DBGFLAGS)
-src_ibtracert_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
+man_MANS = doc/man/ibaddr.8 \
+		doc/man/check_lft_balance.8 \
+		doc/man/ibcacheedit.8 \
+		doc/man/ibccconfig.8 \
+		doc/man/ibccquery.8 \
+		doc/man/dump_lfts.8 \
+		doc/man/dump_mfts.8 \
+		doc/man/iblinkinfo.8 \
+		doc/man/ibfindnodesusing.8 \
+		doc/man/ibhosts.8 \
+		doc/man/ibidsverify.8 \
+		doc/man/ibnetdiscover.8 \
+		doc/man/ibnodes.8 \
+		doc/man/ibping.8 \
+		doc/man/ibportstate.8 \
+		doc/man/ibqueryerrors.8 \
+		doc/man/ibroute.8 \
+		doc/man/ibrouters.8 \
+		doc/man/ibstat.8 \
+		doc/man/ibstatus.8 \
+		doc/man/ibswitches.8 \
+		doc/man/ibsysstat.8 \
+		doc/man/ibtracert.8 \
+		doc/man/perfquery.8 \
+		doc/man/saquery.8 \
+		doc/man/sminfo.8 \
+		doc/man/smpdump.8 \
+		doc/man/smpquery.8 \
+		doc/man/vendstat.8 \
+		doc/man/infiniband-diags.8
+
+# define this for the dist target
+compat_man_pages = man/ibdiscover.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
+		man/ibchecknet.8 man/ibchecknode.8 man/ibcheckport.8 \
+		man/ibcheckportstate.8 man/ibcheckportwidth.8 \
+		man/ibcheckstate.8 man/ibcheckwidth.8 \
+		man/ibswportwatch.8 \
+		man/ibprintswitch.8 man/ibprintca.8 man/ibdatacounts.8 \
+		man/ibdatacounters.8 man/ibprintrt.8 \
+		man/ibclearcounters.8 man/ibclearerrors.8
+
+# but only actually install them if specified
+if ENABLE_COMPAT_UTILS
+man_MANS += $(compat_man_pages)
+endif
 
-src_perfquery_SOURCES = src/perfquery.c src/ibdiag_common.c
-src_perfquery_CFLAGS = -Wall $(DBGFLAGS)
+noinst_LIBRARIES = libcommon.a
 
-src_sminfo_SOURCES = src/sminfo.c src/ibdiag_common.c
-src_sminfo_CFLAGS = -Wall $(DBGFLAGS)
+AM_CFLAGS = -Wall $(DBGFLAGS)
+LDADD = libcommon.a
 
+libcommon_a_SOURCES = src/ibdiag_common.c
+src_ibaddr_SOURCES = src/ibaddr.c
+src_ibnetdiscover_SOURCES = src/ibnetdiscover.c
+src_ibnetdiscover_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_ibping_SOURCES = src/ibping.c
+src_ibportstate_SOURCES = src/ibportstate.c
+src_ibroute_SOURCES = src/ibroute.c
+src_ibstat_SOURCES = src/ibstat.c
+src_ibsysstat_SOURCES = src/ibsysstat.c
+src_ibtracert_SOURCES = src/ibtracert.c
+src_perfquery_SOURCES = src/perfquery.c
+src_sminfo_SOURCES = src/sminfo.c
 src_smpdump_SOURCES = src/smpdump.c
-src_smpdump_CFLAGS = -Wall $(DBGFLAGS)
-
-src_smpquery_SOURCES = src/smpquery.c src/ibdiag_common.c
-src_smpquery_CFLAGS = -Wall $(DBGFLAGS)
-src_smpquery_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-
-src_saquery_SOURCES = src/saquery.c src/ibdiag_common.c
-src_saquery_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS)
-src_saquery_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-
-src_ibsendtrap_SOURCES = src/ibsendtrap.c src/ibdiag_common.c
-src_ibsendtrap_CFLAGS = -Wall $(DBGFLAGS)
-src_ibsendtrap_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-
-src_vendstat_SOURCES = src/vendstat.c src/ibdiag_common.c
-src_vendstat_CFLAGS = -Wall $(DBGFLAGS)
-
+src_smpquery_SOURCES = src/smpquery.c
+src_saquery_SOURCES = src/saquery.c
+src_ibsendtrap_SOURCES = src/ibsendtrap.c
+src_vendstat_SOURCES = src/vendstat.c
 src_mcm_rereg_test_SOURCES = src/mcm_rereg_test.c
-src_mcm_rereg_test_CFLAGS = -Wall $(DBGFLAGS)
-
-man_MANS = man/ibaddr.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
-	man/ibchecknet.8 man/ibchecknode.8 man/ibcheckport.8 \
-	man/ibcheckportstate.8 man/ibcheckportwidth.8 man/ibcheckstate.8 \
-	man/ibcheckwidth.8 man/ibclearcounters.8 man/ibclearerrors.8 \
-	man/ibhosts.8 man/ibnetdiscover.8 man/ibnodes.8 man/ibping.8 \
-	man/ibportstate.8 man/ibroute.8 man/ibstat.8 man/ibstatus.8 \
-	man/ibswitches.8 man/ibtracert.8 man/perfquery.8 man/sminfo.8 \
-	man/smpdump.8 man/smpquery.8 man/saquery.8 man/vendstat.8 \
-	man/dump_lfts.8 man/dump_mfts.8 man/ibdiscover.8 man/ibsysstat.8 \
-	man/iblinkinfo.8 man/ibqueryerrors.8 man/ibswportwatch.8 \
-	man/ibprintswitch.8 man/ibprintca.8 man/ibfindnodesusing.8 \
-	man/ibdatacounts.8 man/ibdatacounters.8 \
-	man/ibrouters.8 man/ibprintrt.8 man/ibidsverify.8 \
-	man/check_lft_balance.8
+src_iblinkinfo_SOURCES = src/iblinkinfo.c
+src_ibccquery_SOURCES = src/ibccquery.c
+src_ibccconfig_SOURCES = src/ibccconfig.c
+src_iblinkinfo_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_ibqueryerrors_SOURCES = src/ibqueryerrors.c
+src_ibqueryerrors_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_ibcacheedit_SOURCES = src/ibcacheedit.c
+src_ibcacheedit_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
 
 BUILT_SOURCES = ibdiag_version
 ibdiag_version:
-	if [ -x $(top_srcdir)/../gen_ver.sh ] ; then \
+	if [ -x $(top_srcdir)/gen_ver.sh ] ; then \
 		ver_file=$(top_builddir)/include/ibdiag_version.h ; \
 		ibdiag_ver=`cat $$ver_file | sed -ne '/#define IBDIAG_VERSION /s/^.*\"\(.*\)\"$$/\1/p'` ; \
-		ver=`$(top_srcdir)/../gen_ver.sh $(PACKAGE)` ; \
+		ver=`$(top_srcdir)/gen_ver.sh $(PACKAGE)` ; \
 		if [ $$ver != $$ibdiag_ver ] ; then \
 			cat $$ver_file | sed -e '/#define IBDIAG_VERSION /s/\".*\"/\"'$$ver'\"/' > tmp_new_version ; \
 			cat tmp_new_version > $$ver_file && rm -f tmp_new_version ; \
 		fi ; \
 	fi
 
-EXTRA_DIST = scripts include infiniband-diags.spec.in infiniband-diags.spec \
-	$(man_MANS) autogen.sh
+EXTRA_DIST = doc scripts include infiniband-diags.spec.in infiniband-diags.spec \
+	$(man_MANS) $(compat_man_pages) autogen.sh etc/*
+
+distclean-local:
+	$(top_srcdir)/doc/generate clean
 
 dist-hook:
-	if [ -x $(top_srcdir)/../gen_chlog.sh ] ; then \
-		$(top_srcdir)/../gen_chlog.sh $(PACKAGE) > $(distdir)/ChangeLog ; \
+	if [ -x $(top_srcdir)/gen_chlog.sh ] ; then \
+		$(top_srcdir)/gen_chlog.sh > $(distdir)/ChangeLog ; \
 	fi
 
 # install this to a default location.
 install-data-hook:
+	if test ! -d $(DESTDIR)/$(sysconfdir)/infiniband-diags; then \
+		$(top_srcdir)/config/install-sh -m 755 -d $(DESTDIR)/$(sysconfdir)/infiniband-diags; \
+	fi
 	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/scripts/IBswcountlimits.pm $(DESTDIR)/$(PERL_INSTALLDIR)/IBswcountlimits.pm
+	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/etc/error_thresholds $(DESTDIR)/$(sysconfdir)/infiniband-diags
+	$(top_srcdir)/config/install-sh -c -m 400 $(top_srcdir)/etc/ibdiag.conf $(DESTDIR)/$(sysconfdir)/infiniband-diags
diff --git a/Makefile.in b/Makefile.in
index fb15984..0c8f077 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
@@ -15,10 +16,12 @@
 @SET_MAKE@
 
 
+
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -39,12 +42,58 @@ sbin_PROGRAMS = src/ibaddr$(EXEEXT) src/ibnetdiscover$(EXEEXT) \
 	src/ibsysstat$(EXEEXT) src/ibtracert$(EXEEXT) \
 	src/perfquery$(EXEEXT) src/sminfo$(EXEEXT) \
 	src/smpdump$(EXEEXT) src/smpquery$(EXEEXT) \
-	src/saquery$(EXEEXT) src/vendstat$(EXEEXT) $(am__EXEEXT_1)
+	src/saquery$(EXEEXT) src/vendstat$(EXEEXT) \
+	src/iblinkinfo$(EXEEXT) src/ibqueryerrors$(EXEEXT) \
+	src/ibcacheedit$(EXEEXT) src/ibccquery$(EXEEXT) \
+	src/ibccconfig$(EXEEXT) $(am__EXEEXT_1)
 @ENABLE_TEST_UTILS_TRUE at am__append_1 = src/ibsendtrap src/mcm_rereg_test
+ at ENABLE_COMPAT_UTILS_TRUE@am__append_2 = scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibcheckport scripts/ibcheckportwidth scripts/ibcheckportstate \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibcheckwidth scripts/ibcheckstate \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibcheckerrors scripts/ibdatacounts \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibdatacounters scripts/ibdiscover.pl \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibswportwatch.pl \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibqueryerrors.pl scripts/iblinkinfo.pl \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/ibprintca.pl scripts/ibprintswitch.pl scripts/ibprintrt.pl \
+ at ENABLE_COMPAT_UTILS_TRUE@		scripts/set_nodedesc.sh scripts/ibclearerrors scripts/ibclearcounters
+
+
+# but only actually install them if specified
+ at ENABLE_COMPAT_UTILS_TRUE@am__append_3 = $(compat_man_pages)
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
 	$(srcdir)/infiniband-diags.spec.in $(top_srcdir)/configure \
+	$(top_srcdir)/doc/man/check_lft_balance.8.in \
+	$(top_srcdir)/doc/man/dump_lfts.8.in \
+	$(top_srcdir)/doc/man/dump_mfts.8.in \
+	$(top_srcdir)/doc/man/ibaddr.8.in \
+	$(top_srcdir)/doc/man/ibcacheedit.8.in \
+	$(top_srcdir)/doc/man/ibccconfig.8.in \
+	$(top_srcdir)/doc/man/ibccquery.8.in \
+	$(top_srcdir)/doc/man/ibfindnodesusing.8.in \
+	$(top_srcdir)/doc/man/ibhosts.8.in \
+	$(top_srcdir)/doc/man/ibidsverify.8.in \
+	$(top_srcdir)/doc/man/iblinkinfo.8.in \
+	$(top_srcdir)/doc/man/ibnetdiscover.8.in \
+	$(top_srcdir)/doc/man/ibnodes.8.in \
+	$(top_srcdir)/doc/man/ibping.8.in \
+	$(top_srcdir)/doc/man/ibportstate.8.in \
+	$(top_srcdir)/doc/man/ibqueryerrors.8.in \
+	$(top_srcdir)/doc/man/ibroute.8.in \
+	$(top_srcdir)/doc/man/ibrouters.8.in \
+	$(top_srcdir)/doc/man/ibstat.8.in \
+	$(top_srcdir)/doc/man/ibstatus.8.in \
+	$(top_srcdir)/doc/man/ibswitches.8.in \
+	$(top_srcdir)/doc/man/ibsysstat.8.in \
+	$(top_srcdir)/doc/man/ibtracert.8.in \
+	$(top_srcdir)/doc/man/infiniband-diags.8.in \
+	$(top_srcdir)/doc/man/perfquery.8.in \
+	$(top_srcdir)/doc/man/saquery.8.in \
+	$(top_srcdir)/doc/man/sminfo.8.in \
+	$(top_srcdir)/doc/man/smpdump.8.in \
+	$(top_srcdir)/doc/man/smpquery.8.in \
+	$(top_srcdir)/doc/man/vendstat.8.in \
 	$(top_srcdir)/include/ibdiag_version.h.in \
 	$(top_srcdir)/scripts/ibcheckerrors.in \
 	$(top_srcdir)/scripts/ibcheckerrs.in \
@@ -60,13 +109,20 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(top_srcdir)/scripts/ibdatacounters.in \
 	$(top_srcdir)/scripts/ibdatacounts.in \
 	$(top_srcdir)/scripts/ibhosts.in \
+	$(top_srcdir)/scripts/iblinkinfo.pl.in \
 	$(top_srcdir)/scripts/ibnodes.in \
+	$(top_srcdir)/scripts/ibqueryerrors.pl.in \
 	$(top_srcdir)/scripts/ibrouters.in \
-	$(top_srcdir)/scripts/ibswitches.in COPYING ChangeLog \
-	config/config.guess config/config.sub config/depcomp \
-	config/install-sh config/ltmain.sh config/missing
+	$(top_srcdir)/scripts/ibswitches.in AUTHORS COPYING ChangeLog \
+	config/compile config/config.guess config/config.sub \
+	config/depcomp config/install-sh config/ltmain.sh \
+	config/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+	$(top_srcdir)/config/ltoptions.m4 \
+	$(top_srcdir)/config/ltsugar.m4 \
+	$(top_srcdir)/config/ltversion.m4 \
+	$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -80,133 +136,155 @@ CONFIG_CLEAN_FILES = infiniband-diags.spec include/ibdiag_version.h \
 	scripts/ibcheckstate scripts/ibcheckwidth \
 	scripts/ibclearcounters scripts/ibclearerrors \
 	scripts/ibdatacounts scripts/ibdatacounters scripts/ibhosts \
-	scripts/ibnodes scripts/ibswitches scripts/ibrouters
+	scripts/ibnodes scripts/ibswitches scripts/ibrouters \
+	scripts/iblinkinfo.pl scripts/ibqueryerrors.pl \
+	doc/man/ibaddr.8 doc/man/check_lft_balance.8 \
+	doc/man/ibcacheedit.8 doc/man/ibccconfig.8 doc/man/ibccquery.8 \
+	doc/man/dump_lfts.8 doc/man/dump_mfts.8 doc/man/ibhosts.8 \
+	doc/man/ibidsverify.8 doc/man/iblinkinfo.8 \
+	doc/man/ibfindnodesusing.8 doc/man/ibnetdiscover.8 \
+	doc/man/ibnodes.8 doc/man/ibping.8 doc/man/ibportstate.8 \
+	doc/man/ibqueryerrors.8 doc/man/ibroute.8 doc/man/ibrouters.8 \
+	doc/man/ibstat.8 doc/man/ibstatus.8 doc/man/ibswitches.8 \
+	doc/man/ibsysstat.8 doc/man/ibtracert.8 doc/man/perfquery.8 \
+	doc/man/saquery.8 doc/man/sminfo.8 doc/man/smpdump.8 \
+	doc/man/smpquery.8 doc/man/vendstat.8 \
+	doc/man/infiniband-diags.8
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libcommon_a_AR = $(AR) $(ARFLAGS)
+libcommon_a_LIBADD =
+am_libcommon_a_OBJECTS = ibdiag_common.$(OBJEXT)
+libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS)
 @ENABLE_TEST_UTILS_TRUE at am__EXEEXT_1 = src/ibsendtrap$(EXEEXT) \
 @ENABLE_TEST_UTILS_TRUE@	src/mcm_rereg_test$(EXEEXT)
 am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \
 	"$(DESTDIR)$(man8dir)"
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(sbin_PROGRAMS)
-am_src_ibaddr_OBJECTS = src_ibaddr-ibaddr.$(OBJEXT) \
-	src_ibaddr-ibdiag_common.$(OBJEXT)
+am_src_ibaddr_OBJECTS = ibaddr.$(OBJEXT)
 src_ibaddr_OBJECTS = $(am_src_ibaddr_OBJECTS)
 src_ibaddr_LDADD = $(LDADD)
-src_ibaddr_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibaddr_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+src_ibaddr_DEPENDENCIES = libcommon.a
 am__dirstamp = $(am__leading_dot)dirstamp
-am_src_ibnetdiscover_OBJECTS =  \
-	src_ibnetdiscover-ibnetdiscover.$(OBJEXT) \
-	src_ibnetdiscover-grouping.$(OBJEXT) \
-	src_ibnetdiscover-ibdiag_common.$(OBJEXT)
+am_src_ibcacheedit_OBJECTS = ibcacheedit.$(OBJEXT)
+src_ibcacheedit_OBJECTS = $(am_src_ibcacheedit_OBJECTS)
+src_ibcacheedit_LDADD = $(LDADD)
+src_ibcacheedit_DEPENDENCIES = libcommon.a
+src_ibcacheedit_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(src_ibcacheedit_LDFLAGS) $(LDFLAGS) -o $@
+am_src_ibccconfig_OBJECTS = ibccconfig.$(OBJEXT)
+src_ibccconfig_OBJECTS = $(am_src_ibccconfig_OBJECTS)
+src_ibccconfig_LDADD = $(LDADD)
+src_ibccconfig_DEPENDENCIES = libcommon.a
+am_src_ibccquery_OBJECTS = ibccquery.$(OBJEXT)
+src_ibccquery_OBJECTS = $(am_src_ibccquery_OBJECTS)
+src_ibccquery_LDADD = $(LDADD)
+src_ibccquery_DEPENDENCIES = libcommon.a
+am_src_iblinkinfo_OBJECTS = iblinkinfo.$(OBJEXT)
+src_iblinkinfo_OBJECTS = $(am_src_iblinkinfo_OBJECTS)
+src_iblinkinfo_LDADD = $(LDADD)
+src_iblinkinfo_DEPENDENCIES = libcommon.a
+src_iblinkinfo_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(src_iblinkinfo_LDFLAGS) $(LDFLAGS) -o $@
+am_src_ibnetdiscover_OBJECTS = ibnetdiscover.$(OBJEXT)
 src_ibnetdiscover_OBJECTS = $(am_src_ibnetdiscover_OBJECTS)
 src_ibnetdiscover_LDADD = $(LDADD)
+src_ibnetdiscover_DEPENDENCIES = libcommon.a
 src_ibnetdiscover_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
-	$(src_ibnetdiscover_CFLAGS) $(CFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(src_ibnetdiscover_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibping_OBJECTS = src_ibping-ibping.$(OBJEXT) \
-	src_ibping-ibdiag_common.$(OBJEXT)
+am_src_ibping_OBJECTS = ibping.$(OBJEXT)
 src_ibping_OBJECTS = $(am_src_ibping_OBJECTS)
 src_ibping_LDADD = $(LDADD)
-src_ibping_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibping_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibportstate_OBJECTS = src_ibportstate-ibportstate.$(OBJEXT) \
-	src_ibportstate-ibdiag_common.$(OBJEXT)
+src_ibping_DEPENDENCIES = libcommon.a
+am_src_ibportstate_OBJECTS = ibportstate.$(OBJEXT)
 src_ibportstate_OBJECTS = $(am_src_ibportstate_OBJECTS)
 src_ibportstate_LDADD = $(LDADD)
-src_ibportstate_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibportstate_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibroute_OBJECTS = src_ibroute-ibroute.$(OBJEXT) \
-	src_ibroute-ibdiag_common.$(OBJEXT)
+src_ibportstate_DEPENDENCIES = libcommon.a
+am_src_ibqueryerrors_OBJECTS = ibqueryerrors.$(OBJEXT)
+src_ibqueryerrors_OBJECTS = $(am_src_ibqueryerrors_OBJECTS)
+src_ibqueryerrors_LDADD = $(LDADD)
+src_ibqueryerrors_DEPENDENCIES = libcommon.a
+src_ibqueryerrors_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(src_ibqueryerrors_LDFLAGS) $(LDFLAGS) -o $@
+am_src_ibroute_OBJECTS = ibroute.$(OBJEXT)
 src_ibroute_OBJECTS = $(am_src_ibroute_OBJECTS)
 src_ibroute_LDADD = $(LDADD)
-src_ibroute_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibroute_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibsendtrap_OBJECTS = src_ibsendtrap-ibsendtrap.$(OBJEXT) \
-	src_ibsendtrap-ibdiag_common.$(OBJEXT)
+src_ibroute_DEPENDENCIES = libcommon.a
+am_src_ibsendtrap_OBJECTS = ibsendtrap.$(OBJEXT)
 src_ibsendtrap_OBJECTS = $(am_src_ibsendtrap_OBJECTS)
 src_ibsendtrap_LDADD = $(LDADD)
-src_ibsendtrap_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibsendtrap_CFLAGS) \
-	$(CFLAGS) $(src_ibsendtrap_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibstat_OBJECTS = src_ibstat-ibstat.$(OBJEXT)
+src_ibsendtrap_DEPENDENCIES = libcommon.a
+am_src_ibstat_OBJECTS = ibstat.$(OBJEXT)
 src_ibstat_OBJECTS = $(am_src_ibstat_OBJECTS)
 src_ibstat_LDADD = $(LDADD)
-src_ibstat_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibstat_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibsysstat_OBJECTS = src_ibsysstat-ibsysstat.$(OBJEXT) \
-	src_ibsysstat-ibdiag_common.$(OBJEXT)
+src_ibstat_DEPENDENCIES = libcommon.a
+am_src_ibsysstat_OBJECTS = ibsysstat.$(OBJEXT)
 src_ibsysstat_OBJECTS = $(am_src_ibsysstat_OBJECTS)
 src_ibsysstat_LDADD = $(LDADD)
-src_ibsysstat_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibsysstat_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_ibtracert_OBJECTS = src_ibtracert-ibtracert.$(OBJEXT) \
-	src_ibtracert-ibdiag_common.$(OBJEXT)
+src_ibsysstat_DEPENDENCIES = libcommon.a
+am_src_ibtracert_OBJECTS = ibtracert.$(OBJEXT)
 src_ibtracert_OBJECTS = $(am_src_ibtracert_OBJECTS)
 src_ibtracert_LDADD = $(LDADD)
-src_ibtracert_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_ibtracert_CFLAGS) \
-	$(CFLAGS) $(src_ibtracert_LDFLAGS) $(LDFLAGS) -o $@
-am_src_mcm_rereg_test_OBJECTS =  \
-	src_mcm_rereg_test-mcm_rereg_test.$(OBJEXT)
+src_ibtracert_DEPENDENCIES = libcommon.a
+am_src_mcm_rereg_test_OBJECTS = mcm_rereg_test.$(OBJEXT)
 src_mcm_rereg_test_OBJECTS = $(am_src_mcm_rereg_test_OBJECTS)
 src_mcm_rereg_test_LDADD = $(LDADD)
-src_mcm_rereg_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) \
-	$(src_mcm_rereg_test_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-am_src_perfquery_OBJECTS = src_perfquery-perfquery.$(OBJEXT) \
-	src_perfquery-ibdiag_common.$(OBJEXT)
+src_mcm_rereg_test_DEPENDENCIES = libcommon.a
+am_src_perfquery_OBJECTS = perfquery.$(OBJEXT)
 src_perfquery_OBJECTS = $(am_src_perfquery_OBJECTS)
 src_perfquery_LDADD = $(LDADD)
-src_perfquery_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_perfquery_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_saquery_OBJECTS = src_saquery-saquery.$(OBJEXT) \
-	src_saquery-ibdiag_common.$(OBJEXT)
+src_perfquery_DEPENDENCIES = libcommon.a
+am_src_saquery_OBJECTS = saquery.$(OBJEXT)
 src_saquery_OBJECTS = $(am_src_saquery_OBJECTS)
 src_saquery_LDADD = $(LDADD)
-src_saquery_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_saquery_CFLAGS) \
-	$(CFLAGS) $(src_saquery_LDFLAGS) $(LDFLAGS) -o $@
-am_src_sminfo_OBJECTS = src_sminfo-sminfo.$(OBJEXT) \
-	src_sminfo-ibdiag_common.$(OBJEXT)
+src_saquery_DEPENDENCIES = libcommon.a
+am_src_sminfo_OBJECTS = sminfo.$(OBJEXT)
 src_sminfo_OBJECTS = $(am_src_sminfo_OBJECTS)
 src_sminfo_LDADD = $(LDADD)
-src_sminfo_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_sminfo_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_smpdump_OBJECTS = src_smpdump-smpdump.$(OBJEXT)
+src_sminfo_DEPENDENCIES = libcommon.a
+am_src_smpdump_OBJECTS = smpdump.$(OBJEXT)
 src_smpdump_OBJECTS = $(am_src_smpdump_OBJECTS)
 src_smpdump_LDADD = $(LDADD)
-src_smpdump_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_smpdump_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-am_src_smpquery_OBJECTS = src_smpquery-smpquery.$(OBJEXT) \
-	src_smpquery-ibdiag_common.$(OBJEXT)
+src_smpdump_DEPENDENCIES = libcommon.a
+am_src_smpquery_OBJECTS = smpquery.$(OBJEXT)
 src_smpquery_OBJECTS = $(am_src_smpquery_OBJECTS)
 src_smpquery_LDADD = $(LDADD)
-src_smpquery_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_smpquery_CFLAGS) \
-	$(CFLAGS) $(src_smpquery_LDFLAGS) $(LDFLAGS) -o $@
-am_src_vendstat_OBJECTS = src_vendstat-vendstat.$(OBJEXT) \
-	src_vendstat-ibdiag_common.$(OBJEXT)
+src_smpquery_DEPENDENCIES = libcommon.a
+am_src_vendstat_OBJECTS = vendstat.$(OBJEXT)
 src_vendstat_OBJECTS = $(am_src_vendstat_OBJECTS)
 src_vendstat_LDADD = $(LDADD)
-src_vendstat_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(src_vendstat_CFLAGS) \
-	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+src_vendstat_DEPENDENCIES = libcommon.a
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 SCRIPTS = $(sbin_SCRIPTS)
 DEFAULT_INCLUDES = -I. at am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -216,34 +294,78 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
-SOURCES = $(src_ibaddr_SOURCES) $(src_ibnetdiscover_SOURCES) \
-	$(src_ibping_SOURCES) $(src_ibportstate_SOURCES) \
+SOURCES = $(libcommon_a_SOURCES) $(src_ibaddr_SOURCES) \
+	$(src_ibcacheedit_SOURCES) $(src_ibccconfig_SOURCES) \
+	$(src_ibccquery_SOURCES) $(src_iblinkinfo_SOURCES) \
+	$(src_ibnetdiscover_SOURCES) $(src_ibping_SOURCES) \
+	$(src_ibportstate_SOURCES) $(src_ibqueryerrors_SOURCES) \
 	$(src_ibroute_SOURCES) $(src_ibsendtrap_SOURCES) \
 	$(src_ibstat_SOURCES) $(src_ibsysstat_SOURCES) \
 	$(src_ibtracert_SOURCES) $(src_mcm_rereg_test_SOURCES) \
 	$(src_perfquery_SOURCES) $(src_saquery_SOURCES) \
 	$(src_sminfo_SOURCES) $(src_smpdump_SOURCES) \
 	$(src_smpquery_SOURCES) $(src_vendstat_SOURCES)
-DIST_SOURCES = $(src_ibaddr_SOURCES) $(src_ibnetdiscover_SOURCES) \
-	$(src_ibping_SOURCES) $(src_ibportstate_SOURCES) \
+DIST_SOURCES = $(libcommon_a_SOURCES) $(src_ibaddr_SOURCES) \
+	$(src_ibcacheedit_SOURCES) $(src_ibccconfig_SOURCES) \
+	$(src_ibccquery_SOURCES) $(src_iblinkinfo_SOURCES) \
+	$(src_ibnetdiscover_SOURCES) $(src_ibping_SOURCES) \
+	$(src_ibportstate_SOURCES) $(src_ibqueryerrors_SOURCES) \
 	$(src_ibroute_SOURCES) $(src_ibsendtrap_SOURCES) \
 	$(src_ibstat_SOURCES) $(src_ibsysstat_SOURCES) \
 	$(src_ibtracert_SOURCES) $(src_mcm_rereg_test_SOURCES) \
 	$(src_perfquery_SOURCES) $(src_saquery_SOURCES) \
 	$(src_sminfo_SOURCES) $(src_smpdump_SOURCES) \
 	$(src_smpquery_SOURCES) $(src_vendstat_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
 man8dir = $(mandir)/man8
 NROFF = nroff
 MANS = $(man_MANS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
+  { test ! -d "$(distdir)" \
+    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr "$(distdir)"; }; }
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
@@ -255,6 +377,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BUILD_DATE = @BUILD_DATE@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -272,6 +395,7 @@ EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 GREP = @GREP@
+IBDIAG_CONFIG_PATH = @IBDIAG_CONFIG_PATH@
 IBSCRIPTPATH = @IBSCRIPTPATH@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -334,12 +458,14 @@ datarootdir = @datarootdir@
 docdir = @docdir@
 dvidir = @dvidir@
 exec_prefix = @exec_prefix@
+have_rst2man = @have_rst2man@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
 htmldir = @htmldir@
+ibnetdisc_api_version = @ibnetdisc_api_version@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
@@ -363,83 +489,76 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-INCLUDES = -I$(top_builddir)/include/ -I$(srcdir)/include -I$(includedir) -I$(includedir)/infiniband
+ACLOCAL_AMFLAGS = -I config
+SUBDIRS = libibnetdisc
+INCLUDES = -I$(top_builddir)/include/ -I$(srcdir)/include -I$(includedir) \
+	-I$(includedir)/infiniband -I$(top_srcdir)/libibnetdisc/include
+
 @DEBUG_FALSE at DBGFLAGS = 
 @DEBUG_TRUE at DBGFLAGS = -ggdb -D_DEBUG_
-sbin_SCRIPTS = scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode \
-               scripts/ibcheckport scripts/ibhosts scripts/ibstatus \
-	       scripts/ibswitches scripts/ibnodes scripts/ibrouters \
-	       scripts/ibcheckwidth scripts/ibcheckportwidth \
-	       scripts/ibcheckstate scripts/ibcheckportstate \
-	       scripts/ibcheckerrors scripts/ibclearerrors \
-	       scripts/ibclearcounters scripts/ibdatacounts \
-	       scripts/ibdatacounters scripts/ibdiscover.pl \
-	       scripts/dump_lfts.sh scripts/dump_mfts.sh \
-	       scripts/set_nodedesc.sh \
-	       scripts/ibqueryerrors.pl scripts/ibswportwatch.pl \
-	       scripts/iblinkinfo.pl scripts/ibprintswitch.pl \
-	       scripts/ibprintca.pl scripts/ibprintrt.pl \
-	       scripts/ibfindnodesusing.pl scripts/ibidsverify.pl \
-	       scripts/check_lft_balance.pl
-
-src_ibaddr_SOURCES = src/ibaddr.c src/ibdiag_common.c
-src_ibaddr_CFLAGS = -Wall $(DBGFLAGS)
-src_ibnetdiscover_SOURCES = src/ibnetdiscover.c src/grouping.c src/ibdiag_common.c
-src_ibnetdiscover_CFLAGS = -Wall $(DBGFLAGS)
-src_ibnetdiscover_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-src_ibping_SOURCES = src/ibping.c src/ibdiag_common.c
-src_ibping_CFLAGS = -Wall $(DBGFLAGS)
-src_ibportstate_SOURCES = src/ibportstate.c src/ibdiag_common.c
-src_ibportstate_CFLAGS = -Wall $(DBGFLAGS)
-src_ibroute_SOURCES = src/ibroute.c src/ibdiag_common.c
-src_ibroute_CFLAGS = -Wall $(DBGFLAGS)
+sbin_SCRIPTS = scripts/ibhosts scripts/ibswitches scripts/ibnodes \
+	scripts/ibrouters scripts/ibfindnodesusing.pl \
+	scripts/ibidsverify.pl scripts/check_lft_balance.pl \
+	scripts/dump_lfts.sh scripts/dump_mfts.sh scripts/ibstatus \
+	$(am__append_2)
+man_MANS = doc/man/ibaddr.8 doc/man/check_lft_balance.8 \
+	doc/man/ibcacheedit.8 doc/man/ibccconfig.8 doc/man/ibccquery.8 \
+	doc/man/dump_lfts.8 doc/man/dump_mfts.8 doc/man/iblinkinfo.8 \
+	doc/man/ibfindnodesusing.8 doc/man/ibhosts.8 \
+	doc/man/ibidsverify.8 doc/man/ibnetdiscover.8 \
+	doc/man/ibnodes.8 doc/man/ibping.8 doc/man/ibportstate.8 \
+	doc/man/ibqueryerrors.8 doc/man/ibroute.8 doc/man/ibrouters.8 \
+	doc/man/ibstat.8 doc/man/ibstatus.8 doc/man/ibswitches.8 \
+	doc/man/ibsysstat.8 doc/man/ibtracert.8 doc/man/perfquery.8 \
+	doc/man/saquery.8 doc/man/sminfo.8 doc/man/smpdump.8 \
+	doc/man/smpquery.8 doc/man/vendstat.8 \
+	doc/man/infiniband-diags.8 $(am__append_3)
+
+# define this for the dist target
+compat_man_pages = man/ibdiscover.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
+		man/ibchecknet.8 man/ibchecknode.8 man/ibcheckport.8 \
+		man/ibcheckportstate.8 man/ibcheckportwidth.8 \
+		man/ibcheckstate.8 man/ibcheckwidth.8 \
+		man/ibswportwatch.8 \
+		man/ibprintswitch.8 man/ibprintca.8 man/ibdatacounts.8 \
+		man/ibdatacounters.8 man/ibprintrt.8 \
+		man/ibclearcounters.8 man/ibclearerrors.8
+
+noinst_LIBRARIES = libcommon.a
+AM_CFLAGS = -Wall $(DBGFLAGS)
+LDADD = libcommon.a
+libcommon_a_SOURCES = src/ibdiag_common.c
+src_ibaddr_SOURCES = src/ibaddr.c
+src_ibnetdiscover_SOURCES = src/ibnetdiscover.c
+src_ibnetdiscover_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_ibping_SOURCES = src/ibping.c
+src_ibportstate_SOURCES = src/ibportstate.c
+src_ibroute_SOURCES = src/ibroute.c
 src_ibstat_SOURCES = src/ibstat.c
-src_ibstat_CFLAGS = -Wall $(DBGFLAGS)
-src_ibsysstat_SOURCES = src/ibsysstat.c src/ibdiag_common.c
-src_ibsysstat_CFLAGS = -Wall $(DBGFLAGS)
-src_ibtracert_SOURCES = src/ibtracert.c src/ibdiag_common.c
-src_ibtracert_CFLAGS = -Wall $(DBGFLAGS)
-src_ibtracert_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-src_perfquery_SOURCES = src/perfquery.c src/ibdiag_common.c
-src_perfquery_CFLAGS = -Wall $(DBGFLAGS)
-src_sminfo_SOURCES = src/sminfo.c src/ibdiag_common.c
-src_sminfo_CFLAGS = -Wall $(DBGFLAGS)
+src_ibsysstat_SOURCES = src/ibsysstat.c
+src_ibtracert_SOURCES = src/ibtracert.c
+src_perfquery_SOURCES = src/perfquery.c
+src_sminfo_SOURCES = src/sminfo.c
 src_smpdump_SOURCES = src/smpdump.c
-src_smpdump_CFLAGS = -Wall $(DBGFLAGS)
-src_smpquery_SOURCES = src/smpquery.c src/ibdiag_common.c
-src_smpquery_CFLAGS = -Wall $(DBGFLAGS)
-src_smpquery_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-src_saquery_SOURCES = src/saquery.c src/ibdiag_common.c
-src_saquery_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP $(DBGFLAGS)
-src_saquery_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-src_ibsendtrap_SOURCES = src/ibsendtrap.c src/ibdiag_common.c
-src_ibsendtrap_CFLAGS = -Wall $(DBGFLAGS)
-src_ibsendtrap_LDFLAGS = -Wl,--rpath -Wl,$(libdir)
-src_vendstat_SOURCES = src/vendstat.c src/ibdiag_common.c
-src_vendstat_CFLAGS = -Wall $(DBGFLAGS)
+src_smpquery_SOURCES = src/smpquery.c
+src_saquery_SOURCES = src/saquery.c
+src_ibsendtrap_SOURCES = src/ibsendtrap.c
+src_vendstat_SOURCES = src/vendstat.c
 src_mcm_rereg_test_SOURCES = src/mcm_rereg_test.c
-src_mcm_rereg_test_CFLAGS = -Wall $(DBGFLAGS)
-man_MANS = man/ibaddr.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
-	man/ibchecknet.8 man/ibchecknode.8 man/ibcheckport.8 \
-	man/ibcheckportstate.8 man/ibcheckportwidth.8 man/ibcheckstate.8 \
-	man/ibcheckwidth.8 man/ibclearcounters.8 man/ibclearerrors.8 \
-	man/ibhosts.8 man/ibnetdiscover.8 man/ibnodes.8 man/ibping.8 \
-	man/ibportstate.8 man/ibroute.8 man/ibstat.8 man/ibstatus.8 \
-	man/ibswitches.8 man/ibtracert.8 man/perfquery.8 man/sminfo.8 \
-	man/smpdump.8 man/smpquery.8 man/saquery.8 man/vendstat.8 \
-	man/dump_lfts.8 man/dump_mfts.8 man/ibdiscover.8 man/ibsysstat.8 \
-	man/iblinkinfo.8 man/ibqueryerrors.8 man/ibswportwatch.8 \
-	man/ibprintswitch.8 man/ibprintca.8 man/ibfindnodesusing.8 \
-	man/ibdatacounts.8 man/ibdatacounters.8 \
-	man/ibrouters.8 man/ibprintrt.8 man/ibidsverify.8 \
-	man/check_lft_balance.8
-
+src_iblinkinfo_SOURCES = src/iblinkinfo.c
+src_ibccquery_SOURCES = src/ibccquery.c
+src_ibccconfig_SOURCES = src/ibccconfig.c
+src_iblinkinfo_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_ibqueryerrors_SOURCES = src/ibqueryerrors.c
+src_ibqueryerrors_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
+src_ibcacheedit_SOURCES = src/ibcacheedit.c
+src_ibcacheedit_LDFLAGS = -L$(top_builddir)/libibnetdisc -libnetdisc
 BUILT_SOURCES = ibdiag_version
-EXTRA_DIST = scripts include infiniband-diags.spec.in infiniband-diags.spec \
-	$(man_MANS) autogen.sh
+EXTRA_DIST = doc scripts include infiniband-diags.spec.in infiniband-diags.spec \
+	$(man_MANS) $(compat_man_pages) autogen.sh etc/*
 
 all: $(BUILT_SOURCES) config.h
-	$(MAKE) $(AM_MAKEFLAGS) all-am
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
@@ -449,15 +568,15 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
-	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -473,9 +592,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
 	$(SHELL) ./config.status --recheck
 
 $(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
 
 config.h: stamp-h1
 	@if test ! -f $@; then \
@@ -487,7 +607,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
 $(srcdir)/config.h.in:  $(am__configure_deps) 
-	cd $(top_srcdir) && $(AUTOHEADER)
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
 	rm -f stamp-h1
 	touch $@
 
@@ -531,104 +651,220 @@ scripts/ibswitches: $(top_builddir)/config.status $(top_srcdir)/scripts/ibswitch
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 scripts/ibrouters: $(top_builddir)/config.status $(top_srcdir)/scripts/ibrouters.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+scripts/iblinkinfo.pl: $(top_builddir)/config.status $(top_srcdir)/scripts/iblinkinfo.pl.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+scripts/ibqueryerrors.pl: $(top_builddir)/config.status $(top_srcdir)/scripts/ibqueryerrors.pl.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibaddr.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibaddr.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/check_lft_balance.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/check_lft_balance.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibcacheedit.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibcacheedit.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibccconfig.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibccconfig.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibccquery.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibccquery.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/dump_lfts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/dump_lfts.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/dump_mfts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/dump_mfts.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibhosts.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibhosts.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibidsverify.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibidsverify.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/iblinkinfo.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/iblinkinfo.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibfindnodesusing.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibfindnodesusing.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibnetdiscover.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibnetdiscover.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibnodes.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibnodes.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibping.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibping.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibportstate.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibportstate.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibqueryerrors.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibqueryerrors.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibroute.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibroute.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibrouters.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibrouters.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibstat.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibstat.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibstatus.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibstatus.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibswitches.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibswitches.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibsysstat.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibsysstat.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/ibtracert.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/ibtracert.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/perfquery.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/perfquery.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/saquery.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/saquery.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/sminfo.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/sminfo.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/smpdump.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/smpdump.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/smpquery.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/smpquery.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/vendstat.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/vendstat.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/man/infiniband-diags.8: $(top_builddir)/config.status $(top_srcdir)/doc/man/infiniband-diags.8.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libcommon.a: $(libcommon_a_OBJECTS) $(libcommon_a_DEPENDENCIES) 
+	-rm -f libcommon.a
+	$(libcommon_a_AR) libcommon.a $(libcommon_a_OBJECTS) $(libcommon_a_LIBADD)
+	$(RANLIB) libcommon.a
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
 	@$(NORMAL_INSTALL)
 	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
-	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
-	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  if test -f $$p \
-	     || test -f $$p1 \
-	  ; then \
-	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
-	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
-	  else :; fi; \
-	done
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
 
 uninstall-sbinPROGRAMS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
-	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(sbindir)/$$f"; \
-	done
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
 
 clean-sbinPROGRAMS:
-	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
 src/$(am__dirstamp):
 	@$(MKDIR_P) src
 	@: > src/$(am__dirstamp)
 src/ibaddr$(EXEEXT): $(src_ibaddr_OBJECTS) $(src_ibaddr_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibaddr$(EXEEXT)
-	$(src_ibaddr_LINK) $(src_ibaddr_OBJECTS) $(src_ibaddr_LDADD) $(LIBS)
+	$(LINK) $(src_ibaddr_OBJECTS) $(src_ibaddr_LDADD) $(LIBS)
+src/ibcacheedit$(EXEEXT): $(src_ibcacheedit_OBJECTS) $(src_ibcacheedit_DEPENDENCIES) src/$(am__dirstamp)
+	@rm -f src/ibcacheedit$(EXEEXT)
+	$(src_ibcacheedit_LINK) $(src_ibcacheedit_OBJECTS) $(src_ibcacheedit_LDADD) $(LIBS)
+src/ibccconfig$(EXEEXT): $(src_ibccconfig_OBJECTS) $(src_ibccconfig_DEPENDENCIES) src/$(am__dirstamp)
+	@rm -f src/ibccconfig$(EXEEXT)
+	$(LINK) $(src_ibccconfig_OBJECTS) $(src_ibccconfig_LDADD) $(LIBS)
+src/ibccquery$(EXEEXT): $(src_ibccquery_OBJECTS) $(src_ibccquery_DEPENDENCIES) src/$(am__dirstamp)
+	@rm -f src/ibccquery$(EXEEXT)
+	$(LINK) $(src_ibccquery_OBJECTS) $(src_ibccquery_LDADD) $(LIBS)
+src/iblinkinfo$(EXEEXT): $(src_iblinkinfo_OBJECTS) $(src_iblinkinfo_DEPENDENCIES) src/$(am__dirstamp)
+	@rm -f src/iblinkinfo$(EXEEXT)
+	$(src_iblinkinfo_LINK) $(src_iblinkinfo_OBJECTS) $(src_iblinkinfo_LDADD) $(LIBS)
 src/ibnetdiscover$(EXEEXT): $(src_ibnetdiscover_OBJECTS) $(src_ibnetdiscover_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibnetdiscover$(EXEEXT)
 	$(src_ibnetdiscover_LINK) $(src_ibnetdiscover_OBJECTS) $(src_ibnetdiscover_LDADD) $(LIBS)
 src/ibping$(EXEEXT): $(src_ibping_OBJECTS) $(src_ibping_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibping$(EXEEXT)
-	$(src_ibping_LINK) $(src_ibping_OBJECTS) $(src_ibping_LDADD) $(LIBS)
+	$(LINK) $(src_ibping_OBJECTS) $(src_ibping_LDADD) $(LIBS)
 src/ibportstate$(EXEEXT): $(src_ibportstate_OBJECTS) $(src_ibportstate_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibportstate$(EXEEXT)
-	$(src_ibportstate_LINK) $(src_ibportstate_OBJECTS) $(src_ibportstate_LDADD) $(LIBS)
+	$(LINK) $(src_ibportstate_OBJECTS) $(src_ibportstate_LDADD) $(LIBS)
+src/ibqueryerrors$(EXEEXT): $(src_ibqueryerrors_OBJECTS) $(src_ibqueryerrors_DEPENDENCIES) src/$(am__dirstamp)
+	@rm -f src/ibqueryerrors$(EXEEXT)
+	$(src_ibqueryerrors_LINK) $(src_ibqueryerrors_OBJECTS) $(src_ibqueryerrors_LDADD) $(LIBS)
 src/ibroute$(EXEEXT): $(src_ibroute_OBJECTS) $(src_ibroute_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibroute$(EXEEXT)
-	$(src_ibroute_LINK) $(src_ibroute_OBJECTS) $(src_ibroute_LDADD) $(LIBS)
+	$(LINK) $(src_ibroute_OBJECTS) $(src_ibroute_LDADD) $(LIBS)
 src/ibsendtrap$(EXEEXT): $(src_ibsendtrap_OBJECTS) $(src_ibsendtrap_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibsendtrap$(EXEEXT)
-	$(src_ibsendtrap_LINK) $(src_ibsendtrap_OBJECTS) $(src_ibsendtrap_LDADD) $(LIBS)
+	$(LINK) $(src_ibsendtrap_OBJECTS) $(src_ibsendtrap_LDADD) $(LIBS)
 src/ibstat$(EXEEXT): $(src_ibstat_OBJECTS) $(src_ibstat_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibstat$(EXEEXT)
-	$(src_ibstat_LINK) $(src_ibstat_OBJECTS) $(src_ibstat_LDADD) $(LIBS)
+	$(LINK) $(src_ibstat_OBJECTS) $(src_ibstat_LDADD) $(LIBS)
 src/ibsysstat$(EXEEXT): $(src_ibsysstat_OBJECTS) $(src_ibsysstat_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibsysstat$(EXEEXT)
-	$(src_ibsysstat_LINK) $(src_ibsysstat_OBJECTS) $(src_ibsysstat_LDADD) $(LIBS)
+	$(LINK) $(src_ibsysstat_OBJECTS) $(src_ibsysstat_LDADD) $(LIBS)
 src/ibtracert$(EXEEXT): $(src_ibtracert_OBJECTS) $(src_ibtracert_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/ibtracert$(EXEEXT)
-	$(src_ibtracert_LINK) $(src_ibtracert_OBJECTS) $(src_ibtracert_LDADD) $(LIBS)
+	$(LINK) $(src_ibtracert_OBJECTS) $(src_ibtracert_LDADD) $(LIBS)
 src/mcm_rereg_test$(EXEEXT): $(src_mcm_rereg_test_OBJECTS) $(src_mcm_rereg_test_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/mcm_rereg_test$(EXEEXT)
-	$(src_mcm_rereg_test_LINK) $(src_mcm_rereg_test_OBJECTS) $(src_mcm_rereg_test_LDADD) $(LIBS)
+	$(LINK) $(src_mcm_rereg_test_OBJECTS) $(src_mcm_rereg_test_LDADD) $(LIBS)
 src/perfquery$(EXEEXT): $(src_perfquery_OBJECTS) $(src_perfquery_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/perfquery$(EXEEXT)
-	$(src_perfquery_LINK) $(src_perfquery_OBJECTS) $(src_perfquery_LDADD) $(LIBS)
+	$(LINK) $(src_perfquery_OBJECTS) $(src_perfquery_LDADD) $(LIBS)
 src/saquery$(EXEEXT): $(src_saquery_OBJECTS) $(src_saquery_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/saquery$(EXEEXT)
-	$(src_saquery_LINK) $(src_saquery_OBJECTS) $(src_saquery_LDADD) $(LIBS)
+	$(LINK) $(src_saquery_OBJECTS) $(src_saquery_LDADD) $(LIBS)
 src/sminfo$(EXEEXT): $(src_sminfo_OBJECTS) $(src_sminfo_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/sminfo$(EXEEXT)
-	$(src_sminfo_LINK) $(src_sminfo_OBJECTS) $(src_sminfo_LDADD) $(LIBS)
+	$(LINK) $(src_sminfo_OBJECTS) $(src_sminfo_LDADD) $(LIBS)
 src/smpdump$(EXEEXT): $(src_smpdump_OBJECTS) $(src_smpdump_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/smpdump$(EXEEXT)
-	$(src_smpdump_LINK) $(src_smpdump_OBJECTS) $(src_smpdump_LDADD) $(LIBS)
+	$(LINK) $(src_smpdump_OBJECTS) $(src_smpdump_LDADD) $(LIBS)
 src/smpquery$(EXEEXT): $(src_smpquery_OBJECTS) $(src_smpquery_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/smpquery$(EXEEXT)
-	$(src_smpquery_LINK) $(src_smpquery_OBJECTS) $(src_smpquery_LDADD) $(LIBS)
+	$(LINK) $(src_smpquery_OBJECTS) $(src_smpquery_LDADD) $(LIBS)
 src/vendstat$(EXEEXT): $(src_vendstat_OBJECTS) $(src_vendstat_DEPENDENCIES) src/$(am__dirstamp)
 	@rm -f src/vendstat$(EXEEXT)
-	$(src_vendstat_LINK) $(src_vendstat_OBJECTS) $(src_vendstat_LDADD) $(LIBS)
+	$(LINK) $(src_vendstat_OBJECTS) $(src_vendstat_LDADD) $(LIBS)
 install-sbinSCRIPTS: $(sbin_SCRIPTS)
 	@$(NORMAL_INSTALL)
 	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
-	@list='$(sbin_SCRIPTS)'; for p in $$list; do \
+	@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  if test -f $$d$$p; then \
-	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-	    echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
-	    $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \
-	  else :; fi; \
-	done
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	     } \
+	; done
 
 uninstall-sbinSCRIPTS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(sbin_SCRIPTS)'; for p in $$list; do \
-	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-	  echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(sbindir)/$$f"; \
-	done
+	@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -636,477 +872,357 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibaddr-ibaddr.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibaddr-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibnetdiscover-grouping.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibnetdiscover-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibping-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibping-ibping.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibportstate-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibportstate-ibportstate.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibroute-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibroute-ibroute.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibsendtrap-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibsendtrap-ibsendtrap.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibstat-ibstat.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibsysstat-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibsysstat-ibsysstat.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibtracert-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_ibtracert-ibtracert.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_perfquery-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_perfquery-perfquery.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_saquery-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_saquery-saquery.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_sminfo-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_sminfo-sminfo.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_smpdump-smpdump.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_smpquery-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_smpquery-smpquery.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_vendstat-ibdiag_common.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/src_vendstat-vendstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibaddr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibcacheedit.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibccconfig.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibccquery.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibdiag_common.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/iblinkinfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibnetdiscover.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibping.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibportstate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibqueryerrors.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibroute.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibsendtrap.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibsysstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ibtracert.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mcm_rereg_test.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/perfquery.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/saquery.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sminfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/smpdump.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/smpquery.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vendstat.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
-src_ibaddr-ibaddr.o: src/ibaddr.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -MT src_ibaddr-ibaddr.o -MD -MP -MF $(DEPDIR)/src_ibaddr-ibaddr.Tpo -c -o src_ibaddr-ibaddr.o `test -f 'src/ibaddr.c' || echo '$(srcdir)/'`src/ibaddr.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibaddr-ibaddr.Tpo $(DEPDIR)/src_ibaddr-ibaddr.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibaddr.c' object='src_ibaddr-ibaddr.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -c -o src_ibaddr-ibaddr.o `test -f 'src/ibaddr.c' || echo '$(srcdir)/'`src/ibaddr.c
-
-src_ibaddr-ibaddr.obj: src/ibaddr.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -MT src_ibaddr-ibaddr.obj -MD -MP -MF $(DEPDIR)/src_ibaddr-ibaddr.Tpo -c -o src_ibaddr-ibaddr.obj `if test -f 'src/ibaddr.c'; then $(CYGPATH_W) 'src/ibaddr.c'; else $(CYGPATH_W) '$(srcdir)/src/ibaddr.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibaddr-ibaddr.Tpo $(DEPDIR)/src_ibaddr-ibaddr.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibaddr.c' object='src_ibaddr-ibaddr.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -c -o src_ibaddr-ibaddr.obj `if test -f 'src/ibaddr.c'; then $(CYGPATH_W) 'src/ibaddr.c'; else $(CYGPATH_W) '$(srcdir)/src/ibaddr.c'; fi`
-
-src_ibaddr-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -MT src_ibaddr-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibaddr-ibdiag_common.Tpo -c -o src_ibaddr-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibaddr-ibdiag_common.Tpo $(DEPDIR)/src_ibaddr-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibaddr-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -c -o src_ibaddr-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
-
-src_ibaddr-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -MT src_ibaddr-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibaddr-ibdiag_common.Tpo -c -o src_ibaddr-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibaddr-ibdiag_common.Tpo $(DEPDIR)/src_ibaddr-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibaddr-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibaddr_CFLAGS) $(CFLAGS) -c -o src_ibaddr-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
-
-src_ibnetdiscover-ibnetdiscover.o: src/ibnetdiscover.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -MT src_ibnetdiscover-ibnetdiscover.o -MD -MP -MF $(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Tpo -c -o src_ibnetdiscover-ibnetdiscover.o `test -f 'src/ibnetdiscover.c' || echo '$(srcdir)/'`src/ibnetdiscover.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Tpo $(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibnetdiscover.c' object='src_ibnetdiscover-ibnetdiscover.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -c -o src_ibnetdiscover-ibnetdiscover.o `test -f 'src/ibnetdiscover.c' || echo '$(srcdir)/'`src/ibnetdiscover.c
-
-src_ibnetdiscover-ibnetdiscover.obj: src/ibnetdiscover.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -MT src_ibnetdiscover-ibnetdiscover.obj -MD -MP -MF $(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Tpo -c -o src_ibnetdiscover-ibnetdiscover.obj `if test -f 'src/ibnetdiscover.c'; then $(CYGPATH_W) 'src/ibnetdiscover.c'; else $(CYGPATH_W) '$(srcdir)/src/ibnetdiscover.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Tpo $(DEPDIR)/src_ibnetdiscover-ibnetdiscover.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibnetdiscover.c' object='src_ibnetdiscover-ibnetdiscover.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -c -o src_ibnetdiscover-ibnetdiscover.obj `if test -f 'src/ibnetdiscover.c'; then $(CYGPATH_W) 'src/ibnetdiscover.c'; else $(CYGPATH_W) '$(srcdir)/src/ibnetdiscover.c'; fi`
-
-src_ibnetdiscover-grouping.o: src/grouping.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -MT src_ibnetdiscover-grouping.o -MD -MP -MF $(DEPDIR)/src_ibnetdiscover-grouping.Tpo -c -o src_ibnetdiscover-grouping.o `test -f 'src/grouping.c' || echo '$(srcdir)/'`src/grouping.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibnetdiscover-grouping.Tpo $(DEPDIR)/src_ibnetdiscover-grouping.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/grouping.c' object='src_ibnetdiscover-grouping.o' libtool=no @AMDEPBACKSLASH@
+ibdiag_common.o: src/ibdiag_common.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibdiag_common.o -MD -MP -MF $(DEPDIR)/ibdiag_common.Tpo -c -o ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibdiag_common.Tpo $(DEPDIR)/ibdiag_common.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -c -o src_ibnetdiscover-grouping.o `test -f 'src/grouping.c' || echo '$(srcdir)/'`src/grouping.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
 
-src_ibnetdiscover-grouping.obj: src/grouping.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -MT src_ibnetdiscover-grouping.obj -MD -MP -MF $(DEPDIR)/src_ibnetdiscover-grouping.Tpo -c -o src_ibnetdiscover-grouping.obj `if test -f 'src/grouping.c'; then $(CYGPATH_W) 'src/grouping.c'; else $(CYGPATH_W) '$(srcdir)/src/grouping.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibnetdiscover-grouping.Tpo $(DEPDIR)/src_ibnetdiscover-grouping.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/grouping.c' object='src_ibnetdiscover-grouping.obj' libtool=no @AMDEPBACKSLASH@
+ibdiag_common.obj: src/ibdiag_common.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibdiag_common.obj -MD -MP -MF $(DEPDIR)/ibdiag_common.Tpo -c -o ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibdiag_common.Tpo $(DEPDIR)/ibdiag_common.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -c -o src_ibnetdiscover-grouping.obj `if test -f 'src/grouping.c'; then $(CYGPATH_W) 'src/grouping.c'; else $(CYGPATH_W) '$(srcdir)/src/grouping.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
 
-src_ibnetdiscover-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -MT src_ibnetdiscover-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibnetdiscover-ibdiag_common.Tpo -c -o src_ibnetdiscover-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibnetdiscover-ibdiag_common.Tpo $(DEPDIR)/src_ibnetdiscover-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibnetdiscover-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+ibaddr.o: src/ibaddr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibaddr.o -MD -MP -MF $(DEPDIR)/ibaddr.Tpo -c -o ibaddr.o `test -f 'src/ibaddr.c' || echo '$(srcdir)/'`src/ibaddr.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibaddr.Tpo $(DEPDIR)/ibaddr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibaddr.c' object='ibaddr.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -c -o src_ibnetdiscover-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibaddr.o `test -f 'src/ibaddr.c' || echo '$(srcdir)/'`src/ibaddr.c
 
-src_ibnetdiscover-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -MT src_ibnetdiscover-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibnetdiscover-ibdiag_common.Tpo -c -o src_ibnetdiscover-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibnetdiscover-ibdiag_common.Tpo $(DEPDIR)/src_ibnetdiscover-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibnetdiscover-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+ibaddr.obj: src/ibaddr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibaddr.obj -MD -MP -MF $(DEPDIR)/ibaddr.Tpo -c -o ibaddr.obj `if test -f 'src/ibaddr.c'; then $(CYGPATH_W) 'src/ibaddr.c'; else $(CYGPATH_W) '$(srcdir)/src/ibaddr.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibaddr.Tpo $(DEPDIR)/ibaddr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibaddr.c' object='ibaddr.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibnetdiscover_CFLAGS) $(CFLAGS) -c -o src_ibnetdiscover-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibaddr.obj `if test -f 'src/ibaddr.c'; then $(CYGPATH_W) 'src/ibaddr.c'; else $(CYGPATH_W) '$(srcdir)/src/ibaddr.c'; fi`
 
-src_ibping-ibping.o: src/ibping.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -MT src_ibping-ibping.o -MD -MP -MF $(DEPDIR)/src_ibping-ibping.Tpo -c -o src_ibping-ibping.o `test -f 'src/ibping.c' || echo '$(srcdir)/'`src/ibping.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibping-ibping.Tpo $(DEPDIR)/src_ibping-ibping.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibping.c' object='src_ibping-ibping.o' libtool=no @AMDEPBACKSLASH@
+ibcacheedit.o: src/ibcacheedit.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibcacheedit.o -MD -MP -MF $(DEPDIR)/ibcacheedit.Tpo -c -o ibcacheedit.o `test -f 'src/ibcacheedit.c' || echo '$(srcdir)/'`src/ibcacheedit.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibcacheedit.Tpo $(DEPDIR)/ibcacheedit.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibcacheedit.c' object='ibcacheedit.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -c -o src_ibping-ibping.o `test -f 'src/ibping.c' || echo '$(srcdir)/'`src/ibping.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibcacheedit.o `test -f 'src/ibcacheedit.c' || echo '$(srcdir)/'`src/ibcacheedit.c
 
-src_ibping-ibping.obj: src/ibping.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -MT src_ibping-ibping.obj -MD -MP -MF $(DEPDIR)/src_ibping-ibping.Tpo -c -o src_ibping-ibping.obj `if test -f 'src/ibping.c'; then $(CYGPATH_W) 'src/ibping.c'; else $(CYGPATH_W) '$(srcdir)/src/ibping.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibping-ibping.Tpo $(DEPDIR)/src_ibping-ibping.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibping.c' object='src_ibping-ibping.obj' libtool=no @AMDEPBACKSLASH@
+ibcacheedit.obj: src/ibcacheedit.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibcacheedit.obj -MD -MP -MF $(DEPDIR)/ibcacheedit.Tpo -c -o ibcacheedit.obj `if test -f 'src/ibcacheedit.c'; then $(CYGPATH_W) 'src/ibcacheedit.c'; else $(CYGPATH_W) '$(srcdir)/src/ibcacheedit.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibcacheedit.Tpo $(DEPDIR)/ibcacheedit.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibcacheedit.c' object='ibcacheedit.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -c -o src_ibping-ibping.obj `if test -f 'src/ibping.c'; then $(CYGPATH_W) 'src/ibping.c'; else $(CYGPATH_W) '$(srcdir)/src/ibping.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibcacheedit.obj `if test -f 'src/ibcacheedit.c'; then $(CYGPATH_W) 'src/ibcacheedit.c'; else $(CYGPATH_W) '$(srcdir)/src/ibcacheedit.c'; fi`
 
-src_ibping-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -MT src_ibping-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibping-ibdiag_common.Tpo -c -o src_ibping-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibping-ibdiag_common.Tpo $(DEPDIR)/src_ibping-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibping-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+ibccconfig.o: src/ibccconfig.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibccconfig.o -MD -MP -MF $(DEPDIR)/ibccconfig.Tpo -c -o ibccconfig.o `test -f 'src/ibccconfig.c' || echo '$(srcdir)/'`src/ibccconfig.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibccconfig.Tpo $(DEPDIR)/ibccconfig.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibccconfig.c' object='ibccconfig.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -c -o src_ibping-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibccconfig.o `test -f 'src/ibccconfig.c' || echo '$(srcdir)/'`src/ibccconfig.c
 
-src_ibping-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -MT src_ibping-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibping-ibdiag_common.Tpo -c -o src_ibping-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibping-ibdiag_common.Tpo $(DEPDIR)/src_ibping-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibping-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+ibccconfig.obj: src/ibccconfig.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibccconfig.obj -MD -MP -MF $(DEPDIR)/ibccconfig.Tpo -c -o ibccconfig.obj `if test -f 'src/ibccconfig.c'; then $(CYGPATH_W) 'src/ibccconfig.c'; else $(CYGPATH_W) '$(srcdir)/src/ibccconfig.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibccconfig.Tpo $(DEPDIR)/ibccconfig.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibccconfig.c' object='ibccconfig.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibping_CFLAGS) $(CFLAGS) -c -o src_ibping-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibccconfig.obj `if test -f 'src/ibccconfig.c'; then $(CYGPATH_W) 'src/ibccconfig.c'; else $(CYGPATH_W) '$(srcdir)/src/ibccconfig.c'; fi`
 
-src_ibportstate-ibportstate.o: src/ibportstate.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -MT src_ibportstate-ibportstate.o -MD -MP -MF $(DEPDIR)/src_ibportstate-ibportstate.Tpo -c -o src_ibportstate-ibportstate.o `test -f 'src/ibportstate.c' || echo '$(srcdir)/'`src/ibportstate.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibportstate-ibportstate.Tpo $(DEPDIR)/src_ibportstate-ibportstate.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibportstate.c' object='src_ibportstate-ibportstate.o' libtool=no @AMDEPBACKSLASH@
+ibccquery.o: src/ibccquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibccquery.o -MD -MP -MF $(DEPDIR)/ibccquery.Tpo -c -o ibccquery.o `test -f 'src/ibccquery.c' || echo '$(srcdir)/'`src/ibccquery.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibccquery.Tpo $(DEPDIR)/ibccquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibccquery.c' object='ibccquery.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -c -o src_ibportstate-ibportstate.o `test -f 'src/ibportstate.c' || echo '$(srcdir)/'`src/ibportstate.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibccquery.o `test -f 'src/ibccquery.c' || echo '$(srcdir)/'`src/ibccquery.c
 
-src_ibportstate-ibportstate.obj: src/ibportstate.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -MT src_ibportstate-ibportstate.obj -MD -MP -MF $(DEPDIR)/src_ibportstate-ibportstate.Tpo -c -o src_ibportstate-ibportstate.obj `if test -f 'src/ibportstate.c'; then $(CYGPATH_W) 'src/ibportstate.c'; else $(CYGPATH_W) '$(srcdir)/src/ibportstate.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibportstate-ibportstate.Tpo $(DEPDIR)/src_ibportstate-ibportstate.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibportstate.c' object='src_ibportstate-ibportstate.obj' libtool=no @AMDEPBACKSLASH@
+ibccquery.obj: src/ibccquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibccquery.obj -MD -MP -MF $(DEPDIR)/ibccquery.Tpo -c -o ibccquery.obj `if test -f 'src/ibccquery.c'; then $(CYGPATH_W) 'src/ibccquery.c'; else $(CYGPATH_W) '$(srcdir)/src/ibccquery.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibccquery.Tpo $(DEPDIR)/ibccquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibccquery.c' object='ibccquery.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -c -o src_ibportstate-ibportstate.obj `if test -f 'src/ibportstate.c'; then $(CYGPATH_W) 'src/ibportstate.c'; else $(CYGPATH_W) '$(srcdir)/src/ibportstate.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibccquery.obj `if test -f 'src/ibccquery.c'; then $(CYGPATH_W) 'src/ibccquery.c'; else $(CYGPATH_W) '$(srcdir)/src/ibccquery.c'; fi`
 
-src_ibportstate-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -MT src_ibportstate-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibportstate-ibdiag_common.Tpo -c -o src_ibportstate-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibportstate-ibdiag_common.Tpo $(DEPDIR)/src_ibportstate-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibportstate-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+iblinkinfo.o: src/iblinkinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iblinkinfo.o -MD -MP -MF $(DEPDIR)/iblinkinfo.Tpo -c -o iblinkinfo.o `test -f 'src/iblinkinfo.c' || echo '$(srcdir)/'`src/iblinkinfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/iblinkinfo.Tpo $(DEPDIR)/iblinkinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/iblinkinfo.c' object='iblinkinfo.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -c -o src_ibportstate-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iblinkinfo.o `test -f 'src/iblinkinfo.c' || echo '$(srcdir)/'`src/iblinkinfo.c
 
-src_ibportstate-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -MT src_ibportstate-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibportstate-ibdiag_common.Tpo -c -o src_ibportstate-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibportstate-ibdiag_common.Tpo $(DEPDIR)/src_ibportstate-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibportstate-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+iblinkinfo.obj: src/iblinkinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT iblinkinfo.obj -MD -MP -MF $(DEPDIR)/iblinkinfo.Tpo -c -o iblinkinfo.obj `if test -f 'src/iblinkinfo.c'; then $(CYGPATH_W) 'src/iblinkinfo.c'; else $(CYGPATH_W) '$(srcdir)/src/iblinkinfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/iblinkinfo.Tpo $(DEPDIR)/iblinkinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/iblinkinfo.c' object='iblinkinfo.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibportstate_CFLAGS) $(CFLAGS) -c -o src_ibportstate-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o iblinkinfo.obj `if test -f 'src/iblinkinfo.c'; then $(CYGPATH_W) 'src/iblinkinfo.c'; else $(CYGPATH_W) '$(srcdir)/src/iblinkinfo.c'; fi`
 
-src_ibroute-ibroute.o: src/ibroute.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -MT src_ibroute-ibroute.o -MD -MP -MF $(DEPDIR)/src_ibroute-ibroute.Tpo -c -o src_ibroute-ibroute.o `test -f 'src/ibroute.c' || echo '$(srcdir)/'`src/ibroute.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibroute-ibroute.Tpo $(DEPDIR)/src_ibroute-ibroute.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibroute.c' object='src_ibroute-ibroute.o' libtool=no @AMDEPBACKSLASH@
+ibnetdiscover.o: src/ibnetdiscover.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibnetdiscover.o -MD -MP -MF $(DEPDIR)/ibnetdiscover.Tpo -c -o ibnetdiscover.o `test -f 'src/ibnetdiscover.c' || echo '$(srcdir)/'`src/ibnetdiscover.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibnetdiscover.Tpo $(DEPDIR)/ibnetdiscover.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibnetdiscover.c' object='ibnetdiscover.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -c -o src_ibroute-ibroute.o `test -f 'src/ibroute.c' || echo '$(srcdir)/'`src/ibroute.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibnetdiscover.o `test -f 'src/ibnetdiscover.c' || echo '$(srcdir)/'`src/ibnetdiscover.c
 
-src_ibroute-ibroute.obj: src/ibroute.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -MT src_ibroute-ibroute.obj -MD -MP -MF $(DEPDIR)/src_ibroute-ibroute.Tpo -c -o src_ibroute-ibroute.obj `if test -f 'src/ibroute.c'; then $(CYGPATH_W) 'src/ibroute.c'; else $(CYGPATH_W) '$(srcdir)/src/ibroute.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibroute-ibroute.Tpo $(DEPDIR)/src_ibroute-ibroute.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibroute.c' object='src_ibroute-ibroute.obj' libtool=no @AMDEPBACKSLASH@
+ibnetdiscover.obj: src/ibnetdiscover.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibnetdiscover.obj -MD -MP -MF $(DEPDIR)/ibnetdiscover.Tpo -c -o ibnetdiscover.obj `if test -f 'src/ibnetdiscover.c'; then $(CYGPATH_W) 'src/ibnetdiscover.c'; else $(CYGPATH_W) '$(srcdir)/src/ibnetdiscover.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibnetdiscover.Tpo $(DEPDIR)/ibnetdiscover.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibnetdiscover.c' object='ibnetdiscover.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -c -o src_ibroute-ibroute.obj `if test -f 'src/ibroute.c'; then $(CYGPATH_W) 'src/ibroute.c'; else $(CYGPATH_W) '$(srcdir)/src/ibroute.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibnetdiscover.obj `if test -f 'src/ibnetdiscover.c'; then $(CYGPATH_W) 'src/ibnetdiscover.c'; else $(CYGPATH_W) '$(srcdir)/src/ibnetdiscover.c'; fi`
 
-src_ibroute-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -MT src_ibroute-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibroute-ibdiag_common.Tpo -c -o src_ibroute-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibroute-ibdiag_common.Tpo $(DEPDIR)/src_ibroute-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibroute-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+ibping.o: src/ibping.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibping.o -MD -MP -MF $(DEPDIR)/ibping.Tpo -c -o ibping.o `test -f 'src/ibping.c' || echo '$(srcdir)/'`src/ibping.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibping.Tpo $(DEPDIR)/ibping.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibping.c' object='ibping.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -c -o src_ibroute-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibping.o `test -f 'src/ibping.c' || echo '$(srcdir)/'`src/ibping.c
 
-src_ibroute-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -MT src_ibroute-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibroute-ibdiag_common.Tpo -c -o src_ibroute-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibroute-ibdiag_common.Tpo $(DEPDIR)/src_ibroute-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibroute-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+ibping.obj: src/ibping.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibping.obj -MD -MP -MF $(DEPDIR)/ibping.Tpo -c -o ibping.obj `if test -f 'src/ibping.c'; then $(CYGPATH_W) 'src/ibping.c'; else $(CYGPATH_W) '$(srcdir)/src/ibping.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibping.Tpo $(DEPDIR)/ibping.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibping.c' object='ibping.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibroute_CFLAGS) $(CFLAGS) -c -o src_ibroute-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibping.obj `if test -f 'src/ibping.c'; then $(CYGPATH_W) 'src/ibping.c'; else $(CYGPATH_W) '$(srcdir)/src/ibping.c'; fi`
 
-src_ibsendtrap-ibsendtrap.o: src/ibsendtrap.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -MT src_ibsendtrap-ibsendtrap.o -MD -MP -MF $(DEPDIR)/src_ibsendtrap-ibsendtrap.Tpo -c -o src_ibsendtrap-ibsendtrap.o `test -f 'src/ibsendtrap.c' || echo '$(srcdir)/'`src/ibsendtrap.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsendtrap-ibsendtrap.Tpo $(DEPDIR)/src_ibsendtrap-ibsendtrap.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsendtrap.c' object='src_ibsendtrap-ibsendtrap.o' libtool=no @AMDEPBACKSLASH@
+ibportstate.o: src/ibportstate.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibportstate.o -MD -MP -MF $(DEPDIR)/ibportstate.Tpo -c -o ibportstate.o `test -f 'src/ibportstate.c' || echo '$(srcdir)/'`src/ibportstate.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibportstate.Tpo $(DEPDIR)/ibportstate.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibportstate.c' object='ibportstate.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -c -o src_ibsendtrap-ibsendtrap.o `test -f 'src/ibsendtrap.c' || echo '$(srcdir)/'`src/ibsendtrap.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibportstate.o `test -f 'src/ibportstate.c' || echo '$(srcdir)/'`src/ibportstate.c
 
-src_ibsendtrap-ibsendtrap.obj: src/ibsendtrap.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -MT src_ibsendtrap-ibsendtrap.obj -MD -MP -MF $(DEPDIR)/src_ibsendtrap-ibsendtrap.Tpo -c -o src_ibsendtrap-ibsendtrap.obj `if test -f 'src/ibsendtrap.c'; then $(CYGPATH_W) 'src/ibsendtrap.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsendtrap.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsendtrap-ibsendtrap.Tpo $(DEPDIR)/src_ibsendtrap-ibsendtrap.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsendtrap.c' object='src_ibsendtrap-ibsendtrap.obj' libtool=no @AMDEPBACKSLASH@
+ibportstate.obj: src/ibportstate.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibportstate.obj -MD -MP -MF $(DEPDIR)/ibportstate.Tpo -c -o ibportstate.obj `if test -f 'src/ibportstate.c'; then $(CYGPATH_W) 'src/ibportstate.c'; else $(CYGPATH_W) '$(srcdir)/src/ibportstate.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibportstate.Tpo $(DEPDIR)/ibportstate.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibportstate.c' object='ibportstate.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -c -o src_ibsendtrap-ibsendtrap.obj `if test -f 'src/ibsendtrap.c'; then $(CYGPATH_W) 'src/ibsendtrap.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsendtrap.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibportstate.obj `if test -f 'src/ibportstate.c'; then $(CYGPATH_W) 'src/ibportstate.c'; else $(CYGPATH_W) '$(srcdir)/src/ibportstate.c'; fi`
 
-src_ibsendtrap-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -MT src_ibsendtrap-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibsendtrap-ibdiag_common.Tpo -c -o src_ibsendtrap-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsendtrap-ibdiag_common.Tpo $(DEPDIR)/src_ibsendtrap-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibsendtrap-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+ibqueryerrors.o: src/ibqueryerrors.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibqueryerrors.o -MD -MP -MF $(DEPDIR)/ibqueryerrors.Tpo -c -o ibqueryerrors.o `test -f 'src/ibqueryerrors.c' || echo '$(srcdir)/'`src/ibqueryerrors.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibqueryerrors.Tpo $(DEPDIR)/ibqueryerrors.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibqueryerrors.c' object='ibqueryerrors.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -c -o src_ibsendtrap-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibqueryerrors.o `test -f 'src/ibqueryerrors.c' || echo '$(srcdir)/'`src/ibqueryerrors.c
 
-src_ibsendtrap-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -MT src_ibsendtrap-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibsendtrap-ibdiag_common.Tpo -c -o src_ibsendtrap-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsendtrap-ibdiag_common.Tpo $(DEPDIR)/src_ibsendtrap-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibsendtrap-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+ibqueryerrors.obj: src/ibqueryerrors.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibqueryerrors.obj -MD -MP -MF $(DEPDIR)/ibqueryerrors.Tpo -c -o ibqueryerrors.obj `if test -f 'src/ibqueryerrors.c'; then $(CYGPATH_W) 'src/ibqueryerrors.c'; else $(CYGPATH_W) '$(srcdir)/src/ibqueryerrors.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibqueryerrors.Tpo $(DEPDIR)/ibqueryerrors.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibqueryerrors.c' object='ibqueryerrors.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsendtrap_CFLAGS) $(CFLAGS) -c -o src_ibsendtrap-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibqueryerrors.obj `if test -f 'src/ibqueryerrors.c'; then $(CYGPATH_W) 'src/ibqueryerrors.c'; else $(CYGPATH_W) '$(srcdir)/src/ibqueryerrors.c'; fi`
 
-src_ibstat-ibstat.o: src/ibstat.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibstat_CFLAGS) $(CFLAGS) -MT src_ibstat-ibstat.o -MD -MP -MF $(DEPDIR)/src_ibstat-ibstat.Tpo -c -o src_ibstat-ibstat.o `test -f 'src/ibstat.c' || echo '$(srcdir)/'`src/ibstat.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibstat-ibstat.Tpo $(DEPDIR)/src_ibstat-ibstat.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibstat.c' object='src_ibstat-ibstat.o' libtool=no @AMDEPBACKSLASH@
+ibroute.o: src/ibroute.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibroute.o -MD -MP -MF $(DEPDIR)/ibroute.Tpo -c -o ibroute.o `test -f 'src/ibroute.c' || echo '$(srcdir)/'`src/ibroute.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibroute.Tpo $(DEPDIR)/ibroute.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibroute.c' object='ibroute.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibstat_CFLAGS) $(CFLAGS) -c -o src_ibstat-ibstat.o `test -f 'src/ibstat.c' || echo '$(srcdir)/'`src/ibstat.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibroute.o `test -f 'src/ibroute.c' || echo '$(srcdir)/'`src/ibroute.c
 
-src_ibstat-ibstat.obj: src/ibstat.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibstat_CFLAGS) $(CFLAGS) -MT src_ibstat-ibstat.obj -MD -MP -MF $(DEPDIR)/src_ibstat-ibstat.Tpo -c -o src_ibstat-ibstat.obj `if test -f 'src/ibstat.c'; then $(CYGPATH_W) 'src/ibstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibstat.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibstat-ibstat.Tpo $(DEPDIR)/src_ibstat-ibstat.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibstat.c' object='src_ibstat-ibstat.obj' libtool=no @AMDEPBACKSLASH@
+ibroute.obj: src/ibroute.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibroute.obj -MD -MP -MF $(DEPDIR)/ibroute.Tpo -c -o ibroute.obj `if test -f 'src/ibroute.c'; then $(CYGPATH_W) 'src/ibroute.c'; else $(CYGPATH_W) '$(srcdir)/src/ibroute.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibroute.Tpo $(DEPDIR)/ibroute.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibroute.c' object='ibroute.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibstat_CFLAGS) $(CFLAGS) -c -o src_ibstat-ibstat.obj `if test -f 'src/ibstat.c'; then $(CYGPATH_W) 'src/ibstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibstat.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibroute.obj `if test -f 'src/ibroute.c'; then $(CYGPATH_W) 'src/ibroute.c'; else $(CYGPATH_W) '$(srcdir)/src/ibroute.c'; fi`
 
-src_ibsysstat-ibsysstat.o: src/ibsysstat.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -MT src_ibsysstat-ibsysstat.o -MD -MP -MF $(DEPDIR)/src_ibsysstat-ibsysstat.Tpo -c -o src_ibsysstat-ibsysstat.o `test -f 'src/ibsysstat.c' || echo '$(srcdir)/'`src/ibsysstat.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsysstat-ibsysstat.Tpo $(DEPDIR)/src_ibsysstat-ibsysstat.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsysstat.c' object='src_ibsysstat-ibsysstat.o' libtool=no @AMDEPBACKSLASH@
+ibsendtrap.o: src/ibsendtrap.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibsendtrap.o -MD -MP -MF $(DEPDIR)/ibsendtrap.Tpo -c -o ibsendtrap.o `test -f 'src/ibsendtrap.c' || echo '$(srcdir)/'`src/ibsendtrap.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibsendtrap.Tpo $(DEPDIR)/ibsendtrap.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsendtrap.c' object='ibsendtrap.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -c -o src_ibsysstat-ibsysstat.o `test -f 'src/ibsysstat.c' || echo '$(srcdir)/'`src/ibsysstat.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibsendtrap.o `test -f 'src/ibsendtrap.c' || echo '$(srcdir)/'`src/ibsendtrap.c
 
-src_ibsysstat-ibsysstat.obj: src/ibsysstat.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -MT src_ibsysstat-ibsysstat.obj -MD -MP -MF $(DEPDIR)/src_ibsysstat-ibsysstat.Tpo -c -o src_ibsysstat-ibsysstat.obj `if test -f 'src/ibsysstat.c'; then $(CYGPATH_W) 'src/ibsysstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsysstat.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsysstat-ibsysstat.Tpo $(DEPDIR)/src_ibsysstat-ibsysstat.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsysstat.c' object='src_ibsysstat-ibsysstat.obj' libtool=no @AMDEPBACKSLASH@
+ibsendtrap.obj: src/ibsendtrap.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibsendtrap.obj -MD -MP -MF $(DEPDIR)/ibsendtrap.Tpo -c -o ibsendtrap.obj `if test -f 'src/ibsendtrap.c'; then $(CYGPATH_W) 'src/ibsendtrap.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsendtrap.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibsendtrap.Tpo $(DEPDIR)/ibsendtrap.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsendtrap.c' object='ibsendtrap.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -c -o src_ibsysstat-ibsysstat.obj `if test -f 'src/ibsysstat.c'; then $(CYGPATH_W) 'src/ibsysstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsysstat.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibsendtrap.obj `if test -f 'src/ibsendtrap.c'; then $(CYGPATH_W) 'src/ibsendtrap.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsendtrap.c'; fi`
 
-src_ibsysstat-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -MT src_ibsysstat-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibsysstat-ibdiag_common.Tpo -c -o src_ibsysstat-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsysstat-ibdiag_common.Tpo $(DEPDIR)/src_ibsysstat-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibsysstat-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+ibstat.o: src/ibstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibstat.o -MD -MP -MF $(DEPDIR)/ibstat.Tpo -c -o ibstat.o `test -f 'src/ibstat.c' || echo '$(srcdir)/'`src/ibstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibstat.Tpo $(DEPDIR)/ibstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibstat.c' object='ibstat.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -c -o src_ibsysstat-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibstat.o `test -f 'src/ibstat.c' || echo '$(srcdir)/'`src/ibstat.c
 
-src_ibsysstat-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -MT src_ibsysstat-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibsysstat-ibdiag_common.Tpo -c -o src_ibsysstat-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibsysstat-ibdiag_common.Tpo $(DEPDIR)/src_ibsysstat-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibsysstat-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+ibstat.obj: src/ibstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibstat.obj -MD -MP -MF $(DEPDIR)/ibstat.Tpo -c -o ibstat.obj `if test -f 'src/ibstat.c'; then $(CYGPATH_W) 'src/ibstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibstat.Tpo $(DEPDIR)/ibstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibstat.c' object='ibstat.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibsysstat_CFLAGS) $(CFLAGS) -c -o src_ibsysstat-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibstat.obj `if test -f 'src/ibstat.c'; then $(CYGPATH_W) 'src/ibstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibstat.c'; fi`
 
-src_ibtracert-ibtracert.o: src/ibtracert.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -MT src_ibtracert-ibtracert.o -MD -MP -MF $(DEPDIR)/src_ibtracert-ibtracert.Tpo -c -o src_ibtracert-ibtracert.o `test -f 'src/ibtracert.c' || echo '$(srcdir)/'`src/ibtracert.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibtracert-ibtracert.Tpo $(DEPDIR)/src_ibtracert-ibtracert.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibtracert.c' object='src_ibtracert-ibtracert.o' libtool=no @AMDEPBACKSLASH@
+ibsysstat.o: src/ibsysstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibsysstat.o -MD -MP -MF $(DEPDIR)/ibsysstat.Tpo -c -o ibsysstat.o `test -f 'src/ibsysstat.c' || echo '$(srcdir)/'`src/ibsysstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibsysstat.Tpo $(DEPDIR)/ibsysstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsysstat.c' object='ibsysstat.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -c -o src_ibtracert-ibtracert.o `test -f 'src/ibtracert.c' || echo '$(srcdir)/'`src/ibtracert.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibsysstat.o `test -f 'src/ibsysstat.c' || echo '$(srcdir)/'`src/ibsysstat.c
 
-src_ibtracert-ibtracert.obj: src/ibtracert.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -MT src_ibtracert-ibtracert.obj -MD -MP -MF $(DEPDIR)/src_ibtracert-ibtracert.Tpo -c -o src_ibtracert-ibtracert.obj `if test -f 'src/ibtracert.c'; then $(CYGPATH_W) 'src/ibtracert.c'; else $(CYGPATH_W) '$(srcdir)/src/ibtracert.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibtracert-ibtracert.Tpo $(DEPDIR)/src_ibtracert-ibtracert.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibtracert.c' object='src_ibtracert-ibtracert.obj' libtool=no @AMDEPBACKSLASH@
+ibsysstat.obj: src/ibsysstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibsysstat.obj -MD -MP -MF $(DEPDIR)/ibsysstat.Tpo -c -o ibsysstat.obj `if test -f 'src/ibsysstat.c'; then $(CYGPATH_W) 'src/ibsysstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsysstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibsysstat.Tpo $(DEPDIR)/ibsysstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibsysstat.c' object='ibsysstat.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -c -o src_ibtracert-ibtracert.obj `if test -f 'src/ibtracert.c'; then $(CYGPATH_W) 'src/ibtracert.c'; else $(CYGPATH_W) '$(srcdir)/src/ibtracert.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibsysstat.obj `if test -f 'src/ibsysstat.c'; then $(CYGPATH_W) 'src/ibsysstat.c'; else $(CYGPATH_W) '$(srcdir)/src/ibsysstat.c'; fi`
 
-src_ibtracert-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -MT src_ibtracert-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_ibtracert-ibdiag_common.Tpo -c -o src_ibtracert-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibtracert-ibdiag_common.Tpo $(DEPDIR)/src_ibtracert-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibtracert-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+ibtracert.o: src/ibtracert.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibtracert.o -MD -MP -MF $(DEPDIR)/ibtracert.Tpo -c -o ibtracert.o `test -f 'src/ibtracert.c' || echo '$(srcdir)/'`src/ibtracert.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibtracert.Tpo $(DEPDIR)/ibtracert.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibtracert.c' object='ibtracert.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -c -o src_ibtracert-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibtracert.o `test -f 'src/ibtracert.c' || echo '$(srcdir)/'`src/ibtracert.c
 
-src_ibtracert-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -MT src_ibtracert-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_ibtracert-ibdiag_common.Tpo -c -o src_ibtracert-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_ibtracert-ibdiag_common.Tpo $(DEPDIR)/src_ibtracert-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_ibtracert-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+ibtracert.obj: src/ibtracert.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ibtracert.obj -MD -MP -MF $(DEPDIR)/ibtracert.Tpo -c -o ibtracert.obj `if test -f 'src/ibtracert.c'; then $(CYGPATH_W) 'src/ibtracert.c'; else $(CYGPATH_W) '$(srcdir)/src/ibtracert.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ibtracert.Tpo $(DEPDIR)/ibtracert.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibtracert.c' object='ibtracert.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_ibtracert_CFLAGS) $(CFLAGS) -c -o src_ibtracert-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ibtracert.obj `if test -f 'src/ibtracert.c'; then $(CYGPATH_W) 'src/ibtracert.c'; else $(CYGPATH_W) '$(srcdir)/src/ibtracert.c'; fi`
 
-src_mcm_rereg_test-mcm_rereg_test.o: src/mcm_rereg_test.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_mcm_rereg_test_CFLAGS) $(CFLAGS) -MT src_mcm_rereg_test-mcm_rereg_test.o -MD -MP -MF $(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Tpo -c -o src_mcm_rereg_test-mcm_rereg_test.o `test -f 'src/mcm_rereg_test.c' || echo '$(srcdir)/'`src/mcm_rereg_test.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Tpo $(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/mcm_rereg_test.c' object='src_mcm_rereg_test-mcm_rereg_test.o' libtool=no @AMDEPBACKSLASH@
+mcm_rereg_test.o: src/mcm_rereg_test.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mcm_rereg_test.o -MD -MP -MF $(DEPDIR)/mcm_rereg_test.Tpo -c -o mcm_rereg_test.o `test -f 'src/mcm_rereg_test.c' || echo '$(srcdir)/'`src/mcm_rereg_test.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mcm_rereg_test.Tpo $(DEPDIR)/mcm_rereg_test.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/mcm_rereg_test.c' object='mcm_rereg_test.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_mcm_rereg_test_CFLAGS) $(CFLAGS) -c -o src_mcm_rereg_test-mcm_rereg_test.o `test -f 'src/mcm_rereg_test.c' || echo '$(srcdir)/'`src/mcm_rereg_test.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mcm_rereg_test.o `test -f 'src/mcm_rereg_test.c' || echo '$(srcdir)/'`src/mcm_rereg_test.c
 
-src_mcm_rereg_test-mcm_rereg_test.obj: src/mcm_rereg_test.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_mcm_rereg_test_CFLAGS) $(CFLAGS) -MT src_mcm_rereg_test-mcm_rereg_test.obj -MD -MP -MF $(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Tpo -c -o src_mcm_rereg_test-mcm_rereg_test.obj `if test -f 'src/mcm_rereg_test.c'; then $(CYGPATH_W) 'src/mcm_rereg_test.c'; else $(CYGPATH_W) '$(srcdir)/src/mcm_rereg_test.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Tpo $(DEPDIR)/src_mcm_rereg_test-mcm_rereg_test.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/mcm_rereg_test.c' object='src_mcm_rereg_test-mcm_rereg_test.obj' libtool=no @AMDEPBACKSLASH@
+mcm_rereg_test.obj: src/mcm_rereg_test.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mcm_rereg_test.obj -MD -MP -MF $(DEPDIR)/mcm_rereg_test.Tpo -c -o mcm_rereg_test.obj `if test -f 'src/mcm_rereg_test.c'; then $(CYGPATH_W) 'src/mcm_rereg_test.c'; else $(CYGPATH_W) '$(srcdir)/src/mcm_rereg_test.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/mcm_rereg_test.Tpo $(DEPDIR)/mcm_rereg_test.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/mcm_rereg_test.c' object='mcm_rereg_test.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_mcm_rereg_test_CFLAGS) $(CFLAGS) -c -o src_mcm_rereg_test-mcm_rereg_test.obj `if test -f 'src/mcm_rereg_test.c'; then $(CYGPATH_W) 'src/mcm_rereg_test.c'; else $(CYGPATH_W) '$(srcdir)/src/mcm_rereg_test.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mcm_rereg_test.obj `if test -f 'src/mcm_rereg_test.c'; then $(CYGPATH_W) 'src/mcm_rereg_test.c'; else $(CYGPATH_W) '$(srcdir)/src/mcm_rereg_test.c'; fi`
 
-src_perfquery-perfquery.o: src/perfquery.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -MT src_perfquery-perfquery.o -MD -MP -MF $(DEPDIR)/src_perfquery-perfquery.Tpo -c -o src_perfquery-perfquery.o `test -f 'src/perfquery.c' || echo '$(srcdir)/'`src/perfquery.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_perfquery-perfquery.Tpo $(DEPDIR)/src_perfquery-perfquery.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/perfquery.c' object='src_perfquery-perfquery.o' libtool=no @AMDEPBACKSLASH@
+perfquery.o: src/perfquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT perfquery.o -MD -MP -MF $(DEPDIR)/perfquery.Tpo -c -o perfquery.o `test -f 'src/perfquery.c' || echo '$(srcdir)/'`src/perfquery.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/perfquery.Tpo $(DEPDIR)/perfquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/perfquery.c' object='perfquery.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -c -o src_perfquery-perfquery.o `test -f 'src/perfquery.c' || echo '$(srcdir)/'`src/perfquery.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o perfquery.o `test -f 'src/perfquery.c' || echo '$(srcdir)/'`src/perfquery.c
 
-src_perfquery-perfquery.obj: src/perfquery.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -MT src_perfquery-perfquery.obj -MD -MP -MF $(DEPDIR)/src_perfquery-perfquery.Tpo -c -o src_perfquery-perfquery.obj `if test -f 'src/perfquery.c'; then $(CYGPATH_W) 'src/perfquery.c'; else $(CYGPATH_W) '$(srcdir)/src/perfquery.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_perfquery-perfquery.Tpo $(DEPDIR)/src_perfquery-perfquery.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/perfquery.c' object='src_perfquery-perfquery.obj' libtool=no @AMDEPBACKSLASH@
+perfquery.obj: src/perfquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT perfquery.obj -MD -MP -MF $(DEPDIR)/perfquery.Tpo -c -o perfquery.obj `if test -f 'src/perfquery.c'; then $(CYGPATH_W) 'src/perfquery.c'; else $(CYGPATH_W) '$(srcdir)/src/perfquery.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/perfquery.Tpo $(DEPDIR)/perfquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/perfquery.c' object='perfquery.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -c -o src_perfquery-perfquery.obj `if test -f 'src/perfquery.c'; then $(CYGPATH_W) 'src/perfquery.c'; else $(CYGPATH_W) '$(srcdir)/src/perfquery.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o perfquery.obj `if test -f 'src/perfquery.c'; then $(CYGPATH_W) 'src/perfquery.c'; else $(CYGPATH_W) '$(srcdir)/src/perfquery.c'; fi`
 
-src_perfquery-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -MT src_perfquery-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_perfquery-ibdiag_common.Tpo -c -o src_perfquery-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_perfquery-ibdiag_common.Tpo $(DEPDIR)/src_perfquery-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_perfquery-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+saquery.o: src/saquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT saquery.o -MD -MP -MF $(DEPDIR)/saquery.Tpo -c -o saquery.o `test -f 'src/saquery.c' || echo '$(srcdir)/'`src/saquery.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/saquery.Tpo $(DEPDIR)/saquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/saquery.c' object='saquery.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -c -o src_perfquery-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o saquery.o `test -f 'src/saquery.c' || echo '$(srcdir)/'`src/saquery.c
 
-src_perfquery-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -MT src_perfquery-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_perfquery-ibdiag_common.Tpo -c -o src_perfquery-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_perfquery-ibdiag_common.Tpo $(DEPDIR)/src_perfquery-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_perfquery-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+saquery.obj: src/saquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT saquery.obj -MD -MP -MF $(DEPDIR)/saquery.Tpo -c -o saquery.obj `if test -f 'src/saquery.c'; then $(CYGPATH_W) 'src/saquery.c'; else $(CYGPATH_W) '$(srcdir)/src/saquery.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/saquery.Tpo $(DEPDIR)/saquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/saquery.c' object='saquery.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_perfquery_CFLAGS) $(CFLAGS) -c -o src_perfquery-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o saquery.obj `if test -f 'src/saquery.c'; then $(CYGPATH_W) 'src/saquery.c'; else $(CYGPATH_W) '$(srcdir)/src/saquery.c'; fi`
 
-src_saquery-saquery.o: src/saquery.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -MT src_saquery-saquery.o -MD -MP -MF $(DEPDIR)/src_saquery-saquery.Tpo -c -o src_saquery-saquery.o `test -f 'src/saquery.c' || echo '$(srcdir)/'`src/saquery.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_saquery-saquery.Tpo $(DEPDIR)/src_saquery-saquery.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/saquery.c' object='src_saquery-saquery.o' libtool=no @AMDEPBACKSLASH@
+sminfo.o: src/sminfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sminfo.o -MD -MP -MF $(DEPDIR)/sminfo.Tpo -c -o sminfo.o `test -f 'src/sminfo.c' || echo '$(srcdir)/'`src/sminfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/sminfo.Tpo $(DEPDIR)/sminfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/sminfo.c' object='sminfo.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -c -o src_saquery-saquery.o `test -f 'src/saquery.c' || echo '$(srcdir)/'`src/saquery.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sminfo.o `test -f 'src/sminfo.c' || echo '$(srcdir)/'`src/sminfo.c
 
-src_saquery-saquery.obj: src/saquery.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -MT src_saquery-saquery.obj -MD -MP -MF $(DEPDIR)/src_saquery-saquery.Tpo -c -o src_saquery-saquery.obj `if test -f 'src/saquery.c'; then $(CYGPATH_W) 'src/saquery.c'; else $(CYGPATH_W) '$(srcdir)/src/saquery.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_saquery-saquery.Tpo $(DEPDIR)/src_saquery-saquery.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/saquery.c' object='src_saquery-saquery.obj' libtool=no @AMDEPBACKSLASH@
+sminfo.obj: src/sminfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sminfo.obj -MD -MP -MF $(DEPDIR)/sminfo.Tpo -c -o sminfo.obj `if test -f 'src/sminfo.c'; then $(CYGPATH_W) 'src/sminfo.c'; else $(CYGPATH_W) '$(srcdir)/src/sminfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/sminfo.Tpo $(DEPDIR)/sminfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/sminfo.c' object='sminfo.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -c -o src_saquery-saquery.obj `if test -f 'src/saquery.c'; then $(CYGPATH_W) 'src/saquery.c'; else $(CYGPATH_W) '$(srcdir)/src/saquery.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sminfo.obj `if test -f 'src/sminfo.c'; then $(CYGPATH_W) 'src/sminfo.c'; else $(CYGPATH_W) '$(srcdir)/src/sminfo.c'; fi`
 
-src_saquery-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -MT src_saquery-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_saquery-ibdiag_common.Tpo -c -o src_saquery-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_saquery-ibdiag_common.Tpo $(DEPDIR)/src_saquery-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_saquery-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+smpdump.o: src/smpdump.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT smpdump.o -MD -MP -MF $(DEPDIR)/smpdump.Tpo -c -o smpdump.o `test -f 'src/smpdump.c' || echo '$(srcdir)/'`src/smpdump.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/smpdump.Tpo $(DEPDIR)/smpdump.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpdump.c' object='smpdump.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -c -o src_saquery-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o smpdump.o `test -f 'src/smpdump.c' || echo '$(srcdir)/'`src/smpdump.c
 
-src_saquery-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -MT src_saquery-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_saquery-ibdiag_common.Tpo -c -o src_saquery-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_saquery-ibdiag_common.Tpo $(DEPDIR)/src_saquery-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_saquery-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+smpdump.obj: src/smpdump.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT smpdump.obj -MD -MP -MF $(DEPDIR)/smpdump.Tpo -c -o smpdump.obj `if test -f 'src/smpdump.c'; then $(CYGPATH_W) 'src/smpdump.c'; else $(CYGPATH_W) '$(srcdir)/src/smpdump.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/smpdump.Tpo $(DEPDIR)/smpdump.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpdump.c' object='smpdump.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_saquery_CFLAGS) $(CFLAGS) -c -o src_saquery-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o smpdump.obj `if test -f 'src/smpdump.c'; then $(CYGPATH_W) 'src/smpdump.c'; else $(CYGPATH_W) '$(srcdir)/src/smpdump.c'; fi`
 
-src_sminfo-sminfo.o: src/sminfo.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -MT src_sminfo-sminfo.o -MD -MP -MF $(DEPDIR)/src_sminfo-sminfo.Tpo -c -o src_sminfo-sminfo.o `test -f 'src/sminfo.c' || echo '$(srcdir)/'`src/sminfo.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_sminfo-sminfo.Tpo $(DEPDIR)/src_sminfo-sminfo.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/sminfo.c' object='src_sminfo-sminfo.o' libtool=no @AMDEPBACKSLASH@
+smpquery.o: src/smpquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT smpquery.o -MD -MP -MF $(DEPDIR)/smpquery.Tpo -c -o smpquery.o `test -f 'src/smpquery.c' || echo '$(srcdir)/'`src/smpquery.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/smpquery.Tpo $(DEPDIR)/smpquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpquery.c' object='smpquery.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -c -o src_sminfo-sminfo.o `test -f 'src/sminfo.c' || echo '$(srcdir)/'`src/sminfo.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o smpquery.o `test -f 'src/smpquery.c' || echo '$(srcdir)/'`src/smpquery.c
 
-src_sminfo-sminfo.obj: src/sminfo.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -MT src_sminfo-sminfo.obj -MD -MP -MF $(DEPDIR)/src_sminfo-sminfo.Tpo -c -o src_sminfo-sminfo.obj `if test -f 'src/sminfo.c'; then $(CYGPATH_W) 'src/sminfo.c'; else $(CYGPATH_W) '$(srcdir)/src/sminfo.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_sminfo-sminfo.Tpo $(DEPDIR)/src_sminfo-sminfo.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/sminfo.c' object='src_sminfo-sminfo.obj' libtool=no @AMDEPBACKSLASH@
+smpquery.obj: src/smpquery.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT smpquery.obj -MD -MP -MF $(DEPDIR)/smpquery.Tpo -c -o smpquery.obj `if test -f 'src/smpquery.c'; then $(CYGPATH_W) 'src/smpquery.c'; else $(CYGPATH_W) '$(srcdir)/src/smpquery.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/smpquery.Tpo $(DEPDIR)/smpquery.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpquery.c' object='smpquery.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -c -o src_sminfo-sminfo.obj `if test -f 'src/sminfo.c'; then $(CYGPATH_W) 'src/sminfo.c'; else $(CYGPATH_W) '$(srcdir)/src/sminfo.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o smpquery.obj `if test -f 'src/smpquery.c'; then $(CYGPATH_W) 'src/smpquery.c'; else $(CYGPATH_W) '$(srcdir)/src/smpquery.c'; fi`
 
-src_sminfo-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -MT src_sminfo-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_sminfo-ibdiag_common.Tpo -c -o src_sminfo-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_sminfo-ibdiag_common.Tpo $(DEPDIR)/src_sminfo-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_sminfo-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
+vendstat.o: src/vendstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vendstat.o -MD -MP -MF $(DEPDIR)/vendstat.Tpo -c -o vendstat.o `test -f 'src/vendstat.c' || echo '$(srcdir)/'`src/vendstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/vendstat.Tpo $(DEPDIR)/vendstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/vendstat.c' object='vendstat.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -c -o src_sminfo-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vendstat.o `test -f 'src/vendstat.c' || echo '$(srcdir)/'`src/vendstat.c
 
-src_sminfo-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -MT src_sminfo-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_sminfo-ibdiag_common.Tpo -c -o src_sminfo-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_sminfo-ibdiag_common.Tpo $(DEPDIR)/src_sminfo-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_sminfo-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
+vendstat.obj: src/vendstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vendstat.obj -MD -MP -MF $(DEPDIR)/vendstat.Tpo -c -o vendstat.obj `if test -f 'src/vendstat.c'; then $(CYGPATH_W) 'src/vendstat.c'; else $(CYGPATH_W) '$(srcdir)/src/vendstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/vendstat.Tpo $(DEPDIR)/vendstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/vendstat.c' object='vendstat.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_sminfo_CFLAGS) $(CFLAGS) -c -o src_sminfo-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
-
-src_smpdump-smpdump.o: src/smpdump.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpdump_CFLAGS) $(CFLAGS) -MT src_smpdump-smpdump.o -MD -MP -MF $(DEPDIR)/src_smpdump-smpdump.Tpo -c -o src_smpdump-smpdump.o `test -f 'src/smpdump.c' || echo '$(srcdir)/'`src/smpdump.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_smpdump-smpdump.Tpo $(DEPDIR)/src_smpdump-smpdump.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpdump.c' object='src_smpdump-smpdump.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpdump_CFLAGS) $(CFLAGS) -c -o src_smpdump-smpdump.o `test -f 'src/smpdump.c' || echo '$(srcdir)/'`src/smpdump.c
-
-src_smpdump-smpdump.obj: src/smpdump.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpdump_CFLAGS) $(CFLAGS) -MT src_smpdump-smpdump.obj -MD -MP -MF $(DEPDIR)/src_smpdump-smpdump.Tpo -c -o src_smpdump-smpdump.obj `if test -f 'src/smpdump.c'; then $(CYGPATH_W) 'src/smpdump.c'; else $(CYGPATH_W) '$(srcdir)/src/smpdump.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_smpdump-smpdump.Tpo $(DEPDIR)/src_smpdump-smpdump.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpdump.c' object='src_smpdump-smpdump.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpdump_CFLAGS) $(CFLAGS) -c -o src_smpdump-smpdump.obj `if test -f 'src/smpdump.c'; then $(CYGPATH_W) 'src/smpdump.c'; else $(CYGPATH_W) '$(srcdir)/src/smpdump.c'; fi`
-
-src_smpquery-smpquery.o: src/smpquery.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -MT src_smpquery-smpquery.o -MD -MP -MF $(DEPDIR)/src_smpquery-smpquery.Tpo -c -o src_smpquery-smpquery.o `test -f 'src/smpquery.c' || echo '$(srcdir)/'`src/smpquery.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_smpquery-smpquery.Tpo $(DEPDIR)/src_smpquery-smpquery.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpquery.c' object='src_smpquery-smpquery.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -c -o src_smpquery-smpquery.o `test -f 'src/smpquery.c' || echo '$(srcdir)/'`src/smpquery.c
-
-src_smpquery-smpquery.obj: src/smpquery.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -MT src_smpquery-smpquery.obj -MD -MP -MF $(DEPDIR)/src_smpquery-smpquery.Tpo -c -o src_smpquery-smpquery.obj `if test -f 'src/smpquery.c'; then $(CYGPATH_W) 'src/smpquery.c'; else $(CYGPATH_W) '$(srcdir)/src/smpquery.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_smpquery-smpquery.Tpo $(DEPDIR)/src_smpquery-smpquery.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/smpquery.c' object='src_smpquery-smpquery.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -c -o src_smpquery-smpquery.obj `if test -f 'src/smpquery.c'; then $(CYGPATH_W) 'src/smpquery.c'; else $(CYGPATH_W) '$(srcdir)/src/smpquery.c'; fi`
-
-src_smpquery-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -MT src_smpquery-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_smpquery-ibdiag_common.Tpo -c -o src_smpquery-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_smpquery-ibdiag_common.Tpo $(DEPDIR)/src_smpquery-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_smpquery-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -c -o src_smpquery-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
-
-src_smpquery-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -MT src_smpquery-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_smpquery-ibdiag_common.Tpo -c -o src_smpquery-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_smpquery-ibdiag_common.Tpo $(DEPDIR)/src_smpquery-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_smpquery-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_smpquery_CFLAGS) $(CFLAGS) -c -o src_smpquery-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
-
-src_vendstat-vendstat.o: src/vendstat.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -MT src_vendstat-vendstat.o -MD -MP -MF $(DEPDIR)/src_vendstat-vendstat.Tpo -c -o src_vendstat-vendstat.o `test -f 'src/vendstat.c' || echo '$(srcdir)/'`src/vendstat.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_vendstat-vendstat.Tpo $(DEPDIR)/src_vendstat-vendstat.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/vendstat.c' object='src_vendstat-vendstat.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -c -o src_vendstat-vendstat.o `test -f 'src/vendstat.c' || echo '$(srcdir)/'`src/vendstat.c
-
-src_vendstat-vendstat.obj: src/vendstat.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -MT src_vendstat-vendstat.obj -MD -MP -MF $(DEPDIR)/src_vendstat-vendstat.Tpo -c -o src_vendstat-vendstat.obj `if test -f 'src/vendstat.c'; then $(CYGPATH_W) 'src/vendstat.c'; else $(CYGPATH_W) '$(srcdir)/src/vendstat.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_vendstat-vendstat.Tpo $(DEPDIR)/src_vendstat-vendstat.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/vendstat.c' object='src_vendstat-vendstat.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -c -o src_vendstat-vendstat.obj `if test -f 'src/vendstat.c'; then $(CYGPATH_W) 'src/vendstat.c'; else $(CYGPATH_W) '$(srcdir)/src/vendstat.c'; fi`
-
-src_vendstat-ibdiag_common.o: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -MT src_vendstat-ibdiag_common.o -MD -MP -MF $(DEPDIR)/src_vendstat-ibdiag_common.Tpo -c -o src_vendstat-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_vendstat-ibdiag_common.Tpo $(DEPDIR)/src_vendstat-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_vendstat-ibdiag_common.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -c -o src_vendstat-ibdiag_common.o `test -f 'src/ibdiag_common.c' || echo '$(srcdir)/'`src/ibdiag_common.c
-
-src_vendstat-ibdiag_common.obj: src/ibdiag_common.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -MT src_vendstat-ibdiag_common.obj -MD -MP -MF $(DEPDIR)/src_vendstat-ibdiag_common.Tpo -c -o src_vendstat-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/src_vendstat-ibdiag_common.Tpo $(DEPDIR)/src_vendstat-ibdiag_common.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibdiag_common.c' object='src_vendstat-ibdiag_common.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_vendstat_CFLAGS) $(CFLAGS) -c -o src_vendstat-ibdiag_common.obj `if test -f 'src/ibdiag_common.c'; then $(CYGPATH_W) 'src/ibdiag_common.c'; else $(CYGPATH_W) '$(srcdir)/src/ibdiag_common.c'; fi`
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vendstat.obj `if test -f 'src/vendstat.c'; then $(CYGPATH_W) 'src/vendstat.c'; else $(CYGPATH_W) '$(srcdir)/src/vendstat.c'; fi`
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -1117,50 +1233,113 @@ clean-libtool:
 
 distclean-libtool:
 	-rm -f libtool config.lt
-install-man8: $(man8_MANS) $(man_MANS)
+install-man8: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
-	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.8*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    8*) ;; \
-	    *) ext='8' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man8:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.8*) list="$$list $$i" ;; \
+	@list=''; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.8[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man8dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man8dir)" && rm -f $$files; }
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
 	  esac; \
 	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    8*) ;; \
-	    *) ext='8' ;; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
 	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -1173,46 +1352,77 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	mkid -fID $$unique
 tags: TAGS
 
-TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
 	$(am__remove_distdir)
-	test -d $(distdir) || mkdir $(distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -1228,24 +1438,58 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
 	$(MAKE) $(AM_MAKEFLAGS) \
 	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
 	  dist-hook
-	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r $(distdir)
+	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 	$(am__remove_distdir)
@@ -1258,6 +1502,10 @@ dist-lzma: distdir
 	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
 	$(am__remove_distdir)
 
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__remove_distdir)
@@ -1281,15 +1529,17 @@ dist dist-all: distdir
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
-	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
-	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
@@ -1297,9 +1547,11 @@ distcheck: dist
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && cd $(distdir)/_build \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
@@ -1321,13 +1573,15 @@ distcheck: dist
 	  && rm -rf "$$dc_destdir" \
 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
 	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
 	$(am__remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@cd $(distuninstallcheck_dir) \
+	@$(am__cd) '$(distuninstallcheck_dir)' \
 	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
@@ -1346,22 +1600,23 @@ distcleancheck: distclean
 	       exit 1; } >&2
 check-am: all-am
 check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h
-installdirs:
+	$(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h
+installdirs: installdirs-recursive
+installdirs-am:
 	for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
+	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-am
+installcheck: installcheck-recursive
 install-strip:
 	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
 	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
@@ -1373,71 +1628,83 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-rm -f src/$(am__dirstamp)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
 	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
+clean: clean-recursive
 
-clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
-	mostlyclean-am
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+	clean-sbinPROGRAMS mostlyclean-am
 
-distclean: distclean-am
+distclean: distclean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-hdr distclean-libtool distclean-tags
+	distclean-hdr distclean-libtool distclean-local distclean-tags
 
-dvi: dvi-am
+dvi: dvi-recursive
 
 dvi-am:
 
-html: html-am
+html: html-recursive
+
+html-am:
 
-info: info-am
+info: info-recursive
 
 info-am:
 
 install-data-am: install-man
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-recursive
 
-install-dvi: install-dvi-am
+install-dvi-am:
 
 install-exec-am: install-sbinPROGRAMS install-sbinSCRIPTS
 
-install-html: install-html-am
+install-html: install-html-recursive
+
+install-html-am:
 
-install-info: install-info-am
+install-info: install-info-recursive
+
+install-info-am:
 
 install-man: install-man8
 
-install-pdf: install-pdf-am
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
 
-install-ps: install-ps-am
+install-ps: install-ps-recursive
+
+install-ps-am:
 
 installcheck-am:
 
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool
 
-pdf: pdf-am
+pdf: pdf-recursive
 
 pdf-am:
 
-ps: ps-am
+ps: ps-recursive
 
 ps-am:
 
@@ -1446,45 +1713,59 @@ uninstall-am: uninstall-man uninstall-sbinPROGRAMS \
 
 uninstall-man: uninstall-man8
 
-.MAKE: install-am install-data-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
-	clean-generic clean-libtool clean-sbinPROGRAMS ctags dist \
-	dist-all dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar \
-	dist-tarZ dist-zip distcheck distclean distclean-compile \
-	distclean-generic distclean-hdr distclean-libtool \
-	distclean-tags distcleancheck distdir distuninstallcheck dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-data-hook install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man8 install-pdf install-pdf-am install-ps \
-	install-ps-am install-sbinPROGRAMS install-sbinSCRIPTS \
-	install-strip installcheck installcheck-am installdirs \
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+	ctags-recursive install install-am install-data-am \
+	install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS ctags \
+	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
+	dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
+	distclean distclean-compile distclean-generic distclean-hdr \
+	distclean-libtool distclean-local distclean-tags \
+	distcleancheck distdir distuninstallcheck dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-data-hook install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-man8 \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-sbinPROGRAMS install-sbinSCRIPTS install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
 	maintainer-clean maintainer-clean-generic mostlyclean \
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am uninstall-man \
-	uninstall-man8 uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
+	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+	uninstall-man uninstall-man8 uninstall-sbinPROGRAMS \
+	uninstall-sbinSCRIPTS
 
 ibdiag_version:
-	if [ -x $(top_srcdir)/../gen_ver.sh ] ; then \
+	if [ -x $(top_srcdir)/gen_ver.sh ] ; then \
 		ver_file=$(top_builddir)/include/ibdiag_version.h ; \
 		ibdiag_ver=`cat $$ver_file | sed -ne '/#define IBDIAG_VERSION /s/^.*\"\(.*\)\"$$/\1/p'` ; \
-		ver=`$(top_srcdir)/../gen_ver.sh $(PACKAGE)` ; \
+		ver=`$(top_srcdir)/gen_ver.sh $(PACKAGE)` ; \
 		if [ $$ver != $$ibdiag_ver ] ; then \
 			cat $$ver_file | sed -e '/#define IBDIAG_VERSION /s/\".*\"/\"'$$ver'\"/' > tmp_new_version ; \
 			cat tmp_new_version > $$ver_file && rm -f tmp_new_version ; \
 		fi ; \
 	fi
 
+distclean-local:
+	$(top_srcdir)/doc/generate clean
+
 dist-hook:
-	if [ -x $(top_srcdir)/../gen_chlog.sh ] ; then \
-		$(top_srcdir)/../gen_chlog.sh $(PACKAGE) > $(distdir)/ChangeLog ; \
+	if [ -x $(top_srcdir)/gen_chlog.sh ] ; then \
+		$(top_srcdir)/gen_chlog.sh > $(distdir)/ChangeLog ; \
 	fi
 
 # install this to a default location.
 install-data-hook:
+	if test ! -d $(DESTDIR)/$(sysconfdir)/infiniband-diags; then \
+		$(top_srcdir)/config/install-sh -m 755 -d $(DESTDIR)/$(sysconfdir)/infiniband-diags; \
+	fi
 	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/scripts/IBswcountlimits.pm $(DESTDIR)/$(PERL_INSTALLDIR)/IBswcountlimits.pm
+	$(top_srcdir)/config/install-sh -c -m 444 $(top_srcdir)/etc/error_thresholds $(DESTDIR)/$(sysconfdir)/infiniband-diags
+	$(top_srcdir)/config/install-sh -c -m 400 $(top_srcdir)/etc/ibdiag.conf $(DESTDIR)/$(sysconfdir)/infiniband-diags
+
 # 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:
diff --git a/README b/README
index c251726..78cc96c 100644
--- a/README
+++ b/README
@@ -1,564 +1,22 @@
-Diagnostic Tools
-shaharf at voltaire.com, halr at voltaire.com
+InfiniBand Diagnostic Tools
 
-General:
+infiniband-diags is a set of utilities designed to help configure, debug, and
+maintain infiniband fabrics.  Many tools and utilities are provided.  Some with
+similar functionality.
 
-Model of operation: All utilities use direct MAD access to perform their
-operations. Operations that require QP 0 mads only, may use direct routed
-mads, and therefore may work even in unconfigured subnets. Almost all
-utilities can operate without accessing the SM, unless GUID to lid translation
-is required.
-
-Dependencies: Most utilities depend on libibmad and libibumad.
-	All utilities depend on the ib_umad kernel module.
-
-Multiple port/Multiple CA support: when no IB device or port is specified
-	(see the "local umad parameters" below), the libibumad library
-	selects the port to use by the following criteria:
-	1. the first port that is ACTIVE.
-	2. if not found, the first port that is UP (physical link up).
-
-	If a port and/or CA name is specified, the libibumad library
-	attempts to fulfill the user request, and will fail if it is not
-	possible.
-	For example:
-	ibaddr 			# use the 'best port'
-	ibaddr -C mthca1	# pick the best port from mthca1 only.
-	ibaddr -P 2		# use the second (active/up) port from the
-				  first available IB device.
-	ibaddr -C mthca0 -P 2	# use the specified port only.
-
-Common options & flags:
-	Most diagnostics take the following flags. The exact list of supported
-	flags per utility can be found in the usage message and can be shown
-	using util_name -h syntax.
-
-	# Debugging flags
-	-d	raise the IB debugging level. May be used
-		several times (-ddd or -d -d -d).
-	-e	show umad send receive errors (timeouts and others)
-	-h	show the usage message
-	-v	increase the application verbosity level.
-		May be used several times (-vv or -v -v -v)
-	-V	show the internal version info.
-
-	# Addressing flags
-	-D	use directed path address arguments. The path
-		is a comma separated list of out ports.
-		Examples:
-		"0" 		# self port
-		"0,1,2,1,4"	# out via port 1, then 2, ...
-	-G	use GUID address arguments. In most cases, it is the Port GUID.
-		Examples:
-		"0x08f1040023"
-	-s <smlid>	use 'smlid' as the target lid for SA queries.
-
-	# Local umad parameters:
-	-C <ca_name>	use the specified ca_name.
-	-P <ca_port>	use the specified ca_port.
-	-t <timeout_ms>	override the default timeout for the solicited mads.
-
-CLI notation: all utilities use the POSIX style notation,
-	meaning that all options (flags) must precede all arguments
-	(parameters).
-
-
-Utilities descriptions:
-
-1. ibstatus
-
-Description:
-ibstatus is a script which displays basic information obtained from the local
-IB driver. Output includes LID, SMLID, port state, link width active, and port
-physical state.
-
-Syntax:
-ibstatus [-h] [devname[:port]]...
-
-Examples:
-	ibstatus		# display status of all IB ports
-	ibstatus mthca1 	# status of mthca1 ports
-	ibstatus mthca1:1 mthca0:2	# show status of specified ports
-
-See also:
-	ibstat
-
-2. ibstat
-
-Description:
-Similar to the ibstatus utility but implemented as a binary and not a script.
-It has options to list CAs and/or ports.
-
-Syntax:
-ibstat [-d(ebug) -l(ist_of_cas) -p(ort_list) -s(hort)] <ca_name> [portnum]
-
-Examples:
-	ibstat			# display status of all IB ports
-	ibstat mthca1 		# status of mthca1 ports
-	ibstat mthca1 2		# show status of specified ports
-	ibstat -p mthca0	# list the port guids of mthca0
-	ibstat -l		# list all CA names
-
-See also:
-	ibstatus
-
-3. ibroute
-
-Description:
-ibroute uses SMPs to display the forwarding tables (unicast
-(LinearForwardingTable or LFT) or multicast (MulticastForwardingTable or MFT))
-for the specified switch LID and the optional lid (mlid) range.
-The default range is all valid entries in the range 1...FDBTop.
-
-Syntax:
-ibroute [options] <switch_addr> [<startlid> [<endlid>]]]
-
-Non standard flags:
-	-a	show all lids in range, even invalid entries.
-	-n	do not try to resolve destinations.
-	-M 	show multicast forwarding tables. In this case the range
-		parameters are specifying mlid range.
-
-Examples:
-	ibroute 2		# dump all valid entries of switch lid 2
-	ibroute 2 15		# dump entries in the range 15...FDBTop.
-	ibroute -a 2 10 20	# dump all entries in the range 10..20
-	ibroute -n 2		# simple format
-	ibroute -M 2		# show multicast tables
-
-See also:
-	ibtracert
-
-4. ibtracert
-
-Description:
-ibtracert uses SMPs to trace the path from a source GID/LID to a
-destination GID/LID. Each hop along the path is displayed until the destination
-is reached or a hop does not respond. By using the -m option, multicast path
-tracing can be performed between source and destination nodes.
-
-Syntax:
-ibtracert [options] <src-addr> <dest-addr>
-
-Non standard flags:
-	-n		simple format; don't show additional information.
-	-m <mlid>	show the multicast trace of the specified mlid.
-
-Examples:
-	ibtracert 2 23		# show trace between lid 2 and 23
-	ibtracert -m 0xc000 3 5 # show multicast trace between lid 3 and 5
-				   for mcast lid 0xc000.
-
-5. smpquery
-
-Description:
-smpquery allows a basic subset of standard SMP queries including the following:
-node info, node description, switch info, port info. Fields are displayed in
-human readable format.
-
-Syntax:
-smpquery [options] <op> <dest_addr> [op_params]
-
-Current supported operations and their parameters:
-	nodeinfo <addr>
-	nodedesc <addr>
-	portinfo <addr> [<portnum>]	# default port is zero
-	switchinfo <addr>
-        pkeys <addr> [<portnum>]
-        sl2vl <addr> [<portnum>]
-        vlarb <addr> [<portnum>]
-
-Examples:
-	smpquery nodeinfo 2		# show nodeinfo for lid 2
-	smpquery portinfo 2 5		# show portinfo for lid 2 port 5
-
-6. smpdump
-
-Description:
-smpdump is a general purpose SMP utility which gets SM attributes from a
-specified SMA. The result is dumped in hex by default.
-
-Syntax:
-smpdump [options] <dest_addr> <attr> [mod]
-
-Non standard flags:
-	-s	show output as string
-
-Examples:
-	smpdump -D 0,1,2 0x15 2		# port info, port 2
-	smpdump 3 0x15 2		# port info, lid 3 port 2
-
-7. ibaddr
-
-Description:
-ibaddr can be used to show the lid and GID addresses of the specified port,
-or the local port by default.
-Note: this utility can be used as simple address resolver.
-
-Syntax:
-ibaddr [options] [<dest_addr>]
-
-Examples:
-	ibaddr			# show local address
-	ibaddr 2		# show address of the specified port lid
-	ibaddr -G 0x8f1040023	# show address of the specified port guid
-
-8. sminfo
-
-Description:
-sminfo issue and dumps the output of a sminfo query in human readable format.
-The target SM is the one listed in the local port info, or the SM specified
-by the optional SM lid or by the SM direct routed path.
-Note: using sminfo for any purposes other then simple query may be very
-dangerous, and may result in a malfunction of the target SM.
-
-Syntax:
-sminfo [options] <sm_lid|sm_dr_path> [sminfo_modifier]
-
-Non standard flags:
-	-s <state>	# use the specified state in sminfo mad
-	-p <priority>	# use the specified priority in sminfo mad
-	-a <activity>	# use the specified activity in sminfo mad
-
-Examples:
-	sminfo			# show sminfo of SM listed in local portinfo
-	sminfo 2		# query SM on port lid 2
-
-9. perfquery
-
-Description:
-perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance
-and error counters) from the PMA at the node specified. Optionally reset all
-or
-
-Syntax:
-perfquery [options]  [<lid|guid> [[port] [reset_mask]]]
-
-Non standard flags:
-	-a	show aggregated counters for all ports of the destination lid.
-	-r	reset counters after read.
-	-R	only reset counters.
-
-Examples:
-	perfquery               # read local port's performance counters
-	perfquery 32 1          # read performance counters from lid 32, port 1
-	perfquery -a 32         # read node aggregated performance counters
-	perfquery -r 32 1	# read performance counters and reset
-	perfquery -R 32 1	# reset performance counters of port 1 only
-	perfquery -R -a 32	# reset performance counters of all ports
-	perfquery -R 32 2 0xf000  # reset only non-error counters of port 2
-
-10. ibping
-
-Description:
-ibping uses vendor mads to validate connectivity between IB nodes.
-On exit, (IP) ping like output is show. ibping is run as client/server.
-Default is to run as client. Note also that a default ping server is
-implemented within the kernel.
-
-Syntax:
-ibping [options] <dest lid|guid>
-
-Non standard flags:
-	-c <count>	stop after count packets
-	-f		flood destination: send packets back to back w/o delay
-	-o <oui>	use specified OUI number to multiplex vendor mads
-	-S		start in server mode (do not return)
-
-11. ibnetdiscover
-
-Description:
-ibnetdiscover performs IB subnet discovery and outputs a human readable
-topology file. GUIDs, node types, and port numbers are displayed
-as well as port LIDs and NodeDescriptions. All nodes (and links) are displayed
-(full topology). Optionally this utility can be used to list the current
-connected nodes. The output is printed to the standard output unless a
-topology file is specified.
-
-Syntax:
-ibnetdiscover [options] [<topology-filename>]
-
-Non standard flags:
-	-l	List of connected nodes
-	-H	List of connected HCAs
-	-S	List of connected switches
-	-g	Grouping
-
-12. ibhosts
-
-Description:
-ibhosts either walks the IB subnet topology or uses an already saved topology
-file and extracts the CA nodes.
-
-Syntax:
-ibhosts [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format
-
-13. ibswitches
-
-Description:
-ibswitches either walks the IB subnet topology or uses an already saved
-topology file and extracts the IB switches.
-
-Syntax:
-ibswitches [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format
-
-14. ibchecknet
-
-Description:
-ibchecknet uses a full topology file that was created by ibnetdiscover,
-scans the network to validate the connectivity and reports errors
-(from port counters).
-
-Syntax:
-ibchecknet [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format, ibchecknode, ibcheckport, ibcheckerrs
-
-15. ibcheckport
-
-Description:
-Check connectivity and do some simple sanity checks for the specified port.
-Port address is lid unless -G option is used to specify a GUID address.
-
-Syntax:
-ibcheckport [-h] [-G] <lid|guid> <port_number>
-
-Example:
-	ibcheckport 2 3		# check lid 2 port 3
-
-Dependencies:
-smpquery, smpquery output format, ibaddr
-
-16. ibchecknode
-
-Description:
-Check connectivity and do some simple sanity checks for the specified node.
-Port address is lid unless -G option is used to specify a GUID address.
-
-Syntax:
-ibchecknode [-h] [-G] <lid|guid>
-
-Example:
-	ibchecknode 2		# check node via lid 2
-
-Dependencies:
-smpquery, smpquery output format, ibaddr
-
-Usage:
-
-17. ibcheckerrs
-
-Description:
-Check specified port (or node) and report errors that surpassed their predefined
-threshold. Port address is lid unless -G option is used to specify a GUID
-address. The predefined thresholds can be dumped using the -s option, and a
-user defined threshold_file (using the same format as the dump) can be
-specified using the -t <file> option.
-
-Syntax:
-ibcheckerrs [-h] [-G] [-t <threshold_file>] [-s(how_thresholds)] <lid|guid> [<port>]
-
-Examples:
-	ibcheckerrs 2		# check aggregated node counter for lid 2
-	ibcheckerrs 2	4	# check port counters for lid 2 port 4
-	ibcheckerrs -t xxx 2	# check node using xxx threshold file
-
-Dependencies:
-perfquery, perfquery output format, ibaddr
-
-18. ibportstate
-
-Description:
-ibportstate allows the port state and port physical state of an IB port
-to be queried or a switch port to be disabled or enabled.
-
-Syntax:
-ibportstate [-d(ebug) -e(rr_show) -v(erbose) -D(irect) -G(uid) -s smlid
--V(ersion) -C ca_name -P ca_port -t timeout_ms] <dest dr_path|lid|guid>
-<portnum> [<op>]
-	supported ops: enable, disable, query
-
-Examples:
-	ibportstate 3 1 disable                 # by lid
-	ibportstate -G 0x2C9000100D051 1 enable # by guid
-	ibportstate -D 0 1                      # by direct route
-
-19. ibcheckwidth
-
-Description:
-ibcheckwidth uses a full topology file that was created by ibnetdiscover,
-scans the network to validate the active link widths and reports any 1x
-links.
-
-Syntax:
-ibcheckwidth [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format, ibchecknode, ibcheckportwidth
-
-20. ibcheckportwidth
-
-Description:
-Check connectivity and check the specified port for 1x link width.
-Port address is lid unless -G option is used to specify a GUID address.
-
-Syntax:
-ibcheckportwidth [-h] [-G] <lid|guid> <port>
-
-Example:
-        ibcheckportwidth 2 3         # check lid 2 port 3
-
-Dependencies:
-smpquery, smpquery output format, ibaddr
-
-21. ibcheckstate
-
-Description:
-ibcheckstate uses a full topology file that was created by ibnetdiscover,
-scans the network to validate the port state and port physical state,
-and reports any ports which have a port state other than Active or
-a port physical state other than LinkUp.
-
-Syntax:
-ibcheckstate [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format, ibchecknode, ibcheckportstate
-
-22. ibcheckportstate
-
-Description:
-Check connectivity and check the specified port for proper port state
-(Active) and port physical state (LinkUp).
-Port address is lid unless -G option is used to specify a GUID address.
-
-yntax:
-ibcheckportstate [-h] [-G] <lid|guid> <port_number>
-
-Example:
-        ibcheckportstate 2 3         # check lid 2 port 3
-
-Dependencies:
-smpquery, smpquery output format, ibaddr
-
-23. ibcheckerrors
-
-ibcheckerrors uses a full topology file that was created by ibnetdiscover,
-scans the network to validate the connectivity and reports errors
-(from port counters).
-
-Syntax:
-ibnetcheckerrors [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format, ibchecknode, ibcheckport, ibcheckerrs
-
-24. ibdiscover.pl
-
-ibdiscover.pl uses a topology file create by ibnetdiscover and a discover.map
-file which the network administrator creates which indicates the nodes
-to be expected and a ibdiscover.topo file which is the expected connectivity
-and produces a new connectivity file (discover.topo.new) and outputs
-the changes to stdout. The network administrator can choose to replace
-the "old" topo file with the new one or certain changes in.
-
-The syntax of the ibdiscover.map file is:
-<nodeGUID>|port|"Text for node"|<NodeDescription from ibnetdiscover format>
-e.g.
-8f10400410015|8|"ISR 6000"|# SW-6IB4 Voltaire port 0 lid 5
-8f10403960558|2|"HCA 1"|# MT23108 InfiniHost Mellanox Technologies
-
-The syntax of the old and new topo files (ibdiscover.topo and
-ibdiscover.topo.new) are:
-<LocalPort>|<LocalNodeGUID>|<RemotePort>|<RemoteNodeGUID>
-e.g.
-10|5442ba00003080|1|8f10400410015
-
-These topo files are produced by the ibdiscover.pl tool.
-
-Syntax:
-ibnetdiscover | ibdiscover.pl
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format
-
-25. ibnodes
-
-Description:
-ibnodes either walks the IB subnet topology or uses an already saved topology
-file and extracts the IB nodes (CAs and switches).
-
-Syntax:
-ibnodes [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format
-
-26. ibclearerrors
-
-Description:
-ibclearerrors clears the PMA error counters in PortCounters by either walking
-the IB subnet topology or using an already saved topology file.
-
-Syntax:
-ibclearerrors [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format, perfquery
-
-27. ibclearcounters
-
-Description:
-ibclearcounters clears the PMA port counters by either walking
-the IB subnet topology or using an already saved topology file.
-
-Syntax:
-ibclearcounters [-h] [<topology-file>]
-
-Dependencies:
-ibnetdiscover, ibnetdiscover format, perfquery
-
-28. saquery
-
-Description:
-Issue some SA queries.
-
-Syntax:
-Usage: saquery [-h -d -P -N -L -G -s -g][<name>]
-   Queries node records by default
-   -d enable debugging
-   -P get PathRecord info
-   -N get NodeRecord info
-   -L Return just the Lid of the name specified
-   -G Return just the Guid of the name specified
-   -s Return the PortInfoRecords with isSM capability mask bit on
-   -g get multicast group info
+In addition to the utilities provided a sub-library libibnetdisc is provided to
+scan an entire IB fabric and return data structures representing it.  The
+interface to this library is _not_ guaranteed to be stable (though we try.)
 
 Dependencies:
-OpenSM libvendor, OpenSM libopensm, libibumad
 
-29. ibsysstat
+	1) libibmad >= 1.3.9
+	2) libibumad >= 1.3.7
+	3) opensm-libs >= 3.3.10
+	4) ib_umad kernel module
 
-Description:
-ibsysstat  uses  vendor  mads to validate connectivity between IB nodes
-and obtain other information about the IB node.  ibsysstat  is  run  as
-client/server. Default is to run as client.
 
-Syntax:
-ibsysstat [options] <dest lid|guid> [<op>]
+Release notes v1.6.0 => 1.6.1
 
-Non standard flags:
-       Current supported operations:
-               ping - verify connectivity to server (default)
-               host - obtain host information from server
-               cpu  - obtain cpu information from server
-        -o <oui>        use specified OUI number to multiplex vendor mads
-        -S              start in server mode (do not return)
+   1) bug fixes and code clean up
 
diff --git a/aclocal.m4 b/aclocal.m4
index 8e383e6..b5ac213 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file 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.
@@ -19,7965 +19,6 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-# This file 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.
-
-m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 56 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
-       [m4_default([$3],
-		   [m4_fatal([Libtool version $1 or higher is required],
-		             63)])],
-       [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
-  *\ * | *\	*)
-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-_LT_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    _LT_PATH_MAGIC
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
-              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME.  Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
-    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
-	[m4_ifval([$1], [$1], [$2])])
-    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
-    m4_ifval([$4],
-	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
-    lt_dict_add_subkey([lt_decl_dict], [$2],
-	[tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
-  [0], [m4_fatal([$0: too few arguments: $#])],
-  [1], [m4_fatal([$0: too few arguments: $#: $1])],
-  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
-  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
-  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
-    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
-    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
-     m4_if([$2], [],
-	   m4_quote(lt_decl_varnames),
-	m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
-			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly.  In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
-    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-#    # Some comment about what VAR is for.
-#    visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
-					   [description])))[]dnl
-m4_pushdef([_libtool_name],
-    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
-    [0], [_libtool_name=[$]$1],
-    [1], [_libtool_name=$lt_[]$1],
-    [2], [_libtool_name=$lt_[]$1],
-    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
-    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
-	dnl If the libtool generation code has been placed in $CONFIG_LT,
-	dnl instead of duplicating it all over again into config.status,
-	dnl then we will have config.status run $CONFIG_LT later, so it
-	dnl needs to know what name is stored there:
-        [AC_CONFIG_COMMANDS([libtool],
-            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
-    dnl If the libtool generation code is destined for config.status,
-    dnl expand the accumulated commands and init code now:
-    [AC_CONFIG_COMMANDS([libtool],
-        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\[$]0 --fallback-echo"')dnl "
-  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
-  ;;
-esac
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
-  -h, --help      print this help, then exit
-  -V, --version   print version number, then exit
-  -q, --quiet     do not print progress messages
-  -d, --debug     don't remove temporary files
-
-Report bugs to <bug-libtool at gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2008 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
-  case $[1] in
-    --version | --v* | -V )
-      echo "$lt_cl_version"; exit 0 ;;
-    --help | --h* | -h )
-      echo "$lt_cl_help"; exit 0 ;;
-    --debug | --d* | -d )
-      debug=: ;;
-    --quiet | --q* | --silent | --s* | -q )
-      lt_cl_silent=: ;;
-
-    -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
-    *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
-  esac
-  shift
-done
-
-if $lt_cl_silent; then
-  exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure.  Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-if test "$no_create" != yes; then
-  lt_cl_success=:
-  test "$silent" = yes &&
-    lt_config_lt_args="$lt_config_lt_args --quiet"
-  exec AS_MESSAGE_LOG_FD>/dev/null
-  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-  exec AS_MESSAGE_LOG_FD>>config.log
-  $lt_cl_success || AS_EXIT(1)
-fi
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars.  Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
-  m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-  _LT_PROG_LTMAIN
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_XSI_SHELLFNS
-
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
-  [C],			[_LT_LANG(C)],
-  [C++],		[_LT_LANG(CXX)],
-  [Java],		[_LT_LANG(GCJ)],
-  [Fortran 77],		[_LT_LANG(F77)],
-  [Fortran],		[_LT_LANG(FC)],
-  [Windows Resource],	[_LT_LANG(RC)],
-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
-    [_LT_LANG($1)],
-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
-  [LT_SUPPORTED_TAG([$1])dnl
-  m4_append([_LT_TAGS], [$1 ])dnl
-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
-  _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
-  [LT_LANG(CXX)],
-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
-  [LT_LANG(F77)],
-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
-  [LT_LANG(FC)],
-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-  [LT_LANG(GCJ)],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-    [LT_LANG(GCJ)],
-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
-      [LT_LANG(GCJ)],
-      [m4_ifdef([AC_PROG_GCJ],
-	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([A][M_PROG_GCJ],
-	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([LT_PROG_GCJ],
-	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
-  [LT_LANG(RC)],
-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-    AC_CHECK_TOOL([LIPO], [lipo], [:])
-    AC_CHECK_TOOL([OTOOL], [otool], [:])
-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
-    _LT_DECL([], [DSYMUTIL], [1],
-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
-    _LT_DECL([], [NMEDIT], [1],
-      [Tool to change global to local symbols on Mac OS X])
-    _LT_DECL([], [LIPO], [1],
-      [Tool to manipulate fat objects and archives on Mac OS X])
-    _LT_DECL([], [OTOOL], [1],
-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
-    _LT_DECL([], [OTOOL64], [1],
-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&AS_MESSAGE_LOG_FD
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi])
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-	[lt_cv_ld_exported_symbols_list=yes],
-	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_automatic, $1)=yes
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-],[])
-  else
-  _LT_TAGVAR(ld_shlibs, $1)=no
-  fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-	 [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_SHELL_INIT
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[_LT_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-[$]*
-_LT_EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
-
-	  if test "$prev" != 'sed 50q "[$]0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(lt_ECHO)
-])
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1],
-    [An echo program that does not interpret backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-  [AS_HELP_STRING([--disable-libtool-lock],
-    [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE="32"
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE="64"
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
-	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
-    [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
-    [Commands used to build an old-style archive])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$5], , :, [$5])
-else
-    m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$4], , :, [$4])
-else
-    m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
-    [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}]
-_LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-    ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
-	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
-	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
-	      ])
-	    ])
-	  ])
-	])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-	  lt_cv_dlopen_self, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-	  lt_cv_dlopen_self_static, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
-	 [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
-	 [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
-	 [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
-	[Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
-         [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
-    [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
-	[], [
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  # Handle Gentoo/FreeBSD as it was Linux
-  case $host_vendor in
-    gentoo)
-      version_type=linux ;;
-    *)
-      version_type=freebsd-$objformat ;;
-  esac
-
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-    linux)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-      soname_spec='${libname}${release}${shared_ext}$major'
-      need_lib_prefix=no
-      need_version=no
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-       [shlibpath_overrides_runpath=yes])])
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
-    [Variables whose values should be saved in libtool wrapper scripts and
-    restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
-    [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
-    [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
-    [[List of archive names.  First name is the real one, the rest are links.
-    The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
-    [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [postinstall_cmds], [2],
-    [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
-    [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
-    [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
-    [[As "finish_cmds", except a single script fragment to be evaled but
-    not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
-    [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
-    [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="m4_if([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
-	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-
-AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_DECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
-    [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method == "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
-  AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
-  [lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
-  cat conftest.out >&AS_MESSAGE_LOG_FD
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
-	[Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
-"     {last_section=section; section=\$ 3};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx]"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-	  cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-const struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
-	else
-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-    [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-    [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
-    [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-    [Transform the output of nm in a C name address pair when lib prefix is needed])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-m4_if([$1], [CXX], [
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	else
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  icpc* )
-	    # Intel C++, used to be incompatible with GCC.
-	    # ICC 10 doesn't accept -KPIC any more.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-	;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-	[How to pass a linker flag through the compiler])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
-    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
-    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
-	[Additional compiler flags for building library objects])
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
-	[Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix[[4-9]]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw* | cegcc*)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-], [
-  runpath_var=
-  _LT_TAGVAR(allow_undefined_flag, $1)=
-  _LT_TAGVAR(always_export_symbols, $1)=no
-  _LT_TAGVAR(archive_cmds, $1)=
-  _LT_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_TAGVAR(compiler_needs_object, $1)=no
-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(hardcode_automatic, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(inherit_rpath, $1)=no
-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_TAGVAR(module_cmds, $1)=
-  _LT_TAGVAR(module_expsym_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=no
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    interix[[3-9]]*)
-      _LT_TAGVAR(hardcode_direct, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
-      then
-	tmp_addflag=
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-	  tmp_sharedflag='--shared' ;;
-	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	xlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	_LT_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_TAGVAR(archive_cmds, $1)=''
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 _LT_SYS_MODULE_PATH_AIX
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[[45]]*)
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    darwin* | rhapsody*)
-      _LT_DARWIN_LINKER_FEATURES($1)
-      ;;
-
-    dgux*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    freebsd1*)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  ;;
-	*)
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        AC_LINK_IFELSE(int foo(void) {},
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-        )
-        LDFLAGS="$save_LDFLAGS"
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(inherit_rpath, $1)=yes
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-	fi
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-        ;;
-	motorola)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	_LT_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
-    [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-        _LT_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-        then
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
-    [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
-    [enable_shared_with_static_runtimes], [0],
-    [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
-    [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
-    [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
-    [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
-    [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
-    [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
-    [Commands used to build a loadable module if different from building
-    a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
-    [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
-    [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
-    [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
-    [Flag to hardcode $libdir into a binary during linking.
-    This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
-    [[If ld is used when linking, flag to hardcode $libdir into a binary
-    during linking.  This must work even if $libdir does not exist]])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
-    [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
-    library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
-    [Set to "yes" if building a shared library automatically hardcodes DIR
-    into the library and all subsequent libraries and executables linked
-    against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
-    [Set to yes if linker adds runtime paths of dependent libraries
-    to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
-    [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
-    [Fix the shell variable $srcfile for the compiler])
-_LT_TAGDECL([], [always_export_symbols], [0],
-    [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
-    [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
-    [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
-    [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
-    [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [file_list_spec], [1],
-    [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl    [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_SYS_DYNAMIC_LINKER($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-  LT_SYS_DLOPEN_SELF
-  _LT_CMD_STRIPLIB
-
-  # Report which library types will actually be built
-  AC_MSG_CHECKING([if libtool supports shared libraries])
-  AC_MSG_RESULT([$can_build_shared])
-
-  AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  AC_MSG_RESULT([$enable_shared])
-
-  AC_MSG_CHECKING([whether to build static libraries])
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  AC_MSG_RESULT([$enable_static])
-
-  _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_PROG_CXX
-# ------------
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-    else
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-      LT_PATH_LD
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-    _LT_TAGVAR(ld_shlibs, $1)=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-      aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	    for ld_flag in $LDFLAGS; do
-	      case $ld_flag in
-	      *-brtl*)
-	        aix_use_runtimelinking=yes
-	        break
-	        ;;
-	      esac
-	    done
-	    ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        _LT_TAGVAR(archive_cmds, $1)=''
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	    # We have reworked collect2
-	    :
-	  else
-	    # We have old collect2
-	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	    # It fails to find uninstalled libraries when the uninstalled
-	    # path is not listed in the libpath.  Setting hardcode_minus_L
-	    # to unsupported forces relinking
-	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-          esac
-          shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
-	  fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	  # chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-          else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
-	    else
-	      shared_flag='${wl}-bM:SRE'
-	    fi
-          fi
-        fi
-
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-	# export.
-        _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          _LT_SYS_MODULE_PATH_AIX
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-	    # Determine the default libpath from the value encoded in an
-	    # empty executable.
-	    _LT_SYS_MODULE_PATH_AIX
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	    # Warning - without using the other run time loading flags,
-	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-	  # FIXME: insert proper C++ library support
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	  ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-        # as there is no search path for DLLs.
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-        _LT_TAGVAR(always_export_symbols, $1)=no
-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          _LT_TAGVAR(ld_shlibs, $1)=no
-        fi
-        ;;
-      darwin* | rhapsody*)
-        _LT_DARWIN_LINKER_FEATURES($1)
-	;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          ghcx*)
-	    # Green Hills C++ Compiler
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      freebsd[[12]]*)
-        # C++ shared libraries reported to be fairly broken before
-	# switch to ELF
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      freebsd-elf*)
-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				             # but as the default
-				             # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            _LT_TAGVAR(ld_shlibs, $1)=no
-            ;;
-          aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              _LT_TAGVAR(ld_shlibs, $1)=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            _LT_TAGVAR(hardcode_direct, $1)=no
-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-            ;;
-          *)
-            _LT_TAGVAR(hardcode_direct, $1)=yes
-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					         # but as the default
-					         # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          aCC*)
-	    case $host_cpu in
-	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	    esac
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
-	        case $host_cpu in
-	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	        esac
-	      fi
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      interix[[3-9]]*)
-	_LT_TAGVAR(hardcode_direct, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-	# Instead, shared libraries are loaded at an image base (0x10000000 by
-	# default) and relocated if they conflict, which is a slow very memory
-	# consuming and fragmenting process.  To avoid this, we pick a random,
-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
-	      fi
-	    fi
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-	    ;;
-        esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(inherit_rpath, $1)=yes
-        ;;
-
-      linux* | k*bsd*-gnu)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	    ;;
-	  icpc* | ecpc* )
-	    # Intel C++
-	    with_gnu_ld=yes
-	    # version 8.0 and above of icpc choke on multiply defined symbols
-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
-	    # earlier do not add the objects themselves.
-	    case `$CC -V 2>&1` in
-	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	      *)  # Version 8.0 or newer
-	        tmp_idyn=
-	        case $host_cpu in
-		  ia64*) tmp_idyn=' -i_dynamic';;
-		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	    esac
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-	    case `$CC -V` in
-	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
-	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
-	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
-		$RANLIB $oldlib'
-	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    *) # Version 6 will use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-	  cxx*)
-	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	    runpath_var=LD_RUN_PATH
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-	  xl*)
-	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	    fi
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	      _LT_TAGVAR(compiler_needs_object, $1)=yes
-
-	      # Not sure whether something based on
-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	      # would be better.
-	      output_verbose_link_cmd='echo'
-
-	      # Archives containing C++ object files must be created using
-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	      # necessary to make sure instantiated templates are included
-	      # in the archive.
-	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	  *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	esac
-	;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-	  wlarc=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	fi
-	# Workaround some broken pre-1.5 toolchains
-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-	;;
-
-      *nto* | *qnx*)
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-	;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
-	if test -f /usr/libexec/ld.so; then
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-	  fi
-	  output_verbose_link_cmd=echo
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Archives containing C++ object files must be created using
-	    # the KAI C++ compiler.
-	    case $host in
-	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
-	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
-	    esac
-	    ;;
-          RCC*)
-	    # Rational C++ 2.4.1
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          cxx*)
-	    case $host in
-	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-		;;
-	      *)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-		;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	      case $host in
-	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	      esac
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	      # Commands to make compiler produce verbose output that lists
-	      # what "hidden" libraries, object files and flags are used when
-	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.x
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          lcc*)
-	    # Lucid
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
-	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	    case $host_os in
-	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	      *)
-		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
-		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	        ;;
-	    esac
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-
-	    output_verbose_link_cmd='echo'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	    ;;
-          gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	    # The C++ compiler must be used to create the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-	      fi
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-	      case $host_os in
-		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-		  ;;
-	      esac
-	    fi
-	    ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
-	# link with -lc, and that would cause any symbols used from libc to
-	# always be unresolved, which means just about no library would
-	# ever link correctly.  If we're not using GNU ld we use -z text
-	# though, which does catch some bad symbols but isn't as heavy-handed
-	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-	runpath_var='LD_RUN_PATH'
-
-	case $cc_basename in
-          CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-	    # NonStop-UX NCC 3.20
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-    esac
-
-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-_LT_EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
-	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
-	 else
-	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
-	 else
-	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_TAGVAR(predep_objects,$1)=
-  _LT_TAGVAR(postdep_objects,$1)=
-  _LT_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
-    [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
-    [Dependencies to place before and after the objects being linked to
-    create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
-    [The library search path used internally by the compiler when linking
-    a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_PROG_F77
-# ------------
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  CC=${F77-"f77"}
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-  GCC=$G77
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_PROG_FC
-# -----------
-# Since AC_PROG_FC is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_FC],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
-AC_PROG_FC
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_FC
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_FC], [])
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_REQUIRE([_LT_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  CC=${FC-"f95"}
-  compiler=$CC
-  GCC=$ac_cv_fc_compiler_gnu
-
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC="$lt_save_CC"
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
-  :
-  _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
-    [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-      AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $[*] ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
-
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$[@]"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]+=\$[2]"
-}
-_LT_EOF
-    ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
-    ;;
-  esac
-])
-
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file 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.
-
-# serial 6 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-		      [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
-  ])
-])# _LT_SET_OPTIONS
-
-
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [0], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
-	[Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
-    _LT_DECL([build_old_libs], [enable_static], [0],
-	[Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
-	 [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
-		 [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
-		 [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
-		 [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
-		 [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
-		 [m4_define([_LTDL_TYPE], [convenience])])
-
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file 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.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-	     [m4_foreach([_Lt_suffix],
-		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-		 [lt_append([$1], [$2], [$3])$4],
-		 [$5])],
-	  [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-	[$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
-
-# ltversion.m4 -- version numbers			-*- Autoconf -*-
-#
-#   Copyright (C) 2004 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file 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.
-
-# Generated from ltversion.in.
-
-# serial 3012 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.2.6])
-m4_define([LT_PACKAGE_REVISION], [1.3012])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6'
-macro_revision='1.3012'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
-
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file 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.
-
-# serial 4 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-
 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -7990,10 +31,10 @@ m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
+[am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10.2], [],
+m4_if([$1], [1.11.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -8009,7 +50,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.2])dnl
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -8069,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
 # Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 8
+# serial 9
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -8089,6 +130,7 @@ AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -8102,14 +144,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
 # Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 9
+# serial 10
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -8166,6 +208,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -8183,7 +235,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -8193,19 +255,23 @@ AC_CACHE_CHECK([dependency style of $depcc],
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -8269,59 +335,61 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 4
+#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[# Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -8353,13 +421,13 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 13
+# serial 16
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -8376,7 +444,7 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
+[AC_PREREQ([2.62])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -8427,8 +495,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
@@ -8436,24 +504,37 @@ AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-	      		     [_AM_PROG_TAR([v7])])])
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                  [_AM_DEPENDENCIES(OBJC)],
-                  [define([AC_PROG_OBJC],
-                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
 
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
@@ -8476,7 +557,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -8487,7 +568,14 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
 AC_SUBST(install_sh)])
 
 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
@@ -8513,13 +601,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 3
+# serial 4
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -8528,7 +616,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
 [am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -8538,24 +626,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 AC_SUBST([am__include])
 AC_SUBST([am__quote])
@@ -8565,14 +653,14 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 5
+# serial 6
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -8589,7 +677,14 @@ AC_SUBST($1)])
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -8660,14 +755,14 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 4
+# serial 5
 
 # AM_SANITY_CHECK
 # ---------------
@@ -8676,16 +771,29 @@ AC_DEFUN([AM_SANITY_CHECK],
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$[*]" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$[*]" != "X $srcdir/configure conftest.file" \
@@ -8738,18 +846,25 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 #
 # This file 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.
 
+# serial 2
+
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
 # Check how to create a tarball.                            -*- Autoconf -*-
 
 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
@@ -8846,3 +961,8 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([config/libtool.m4])
+m4_include([config/ltoptions.m4])
+m4_include([config/ltsugar.m4])
+m4_include([config/ltversion.m4])
+m4_include([config/lt~obsolete.m4])
diff --git a/autogen.sh b/autogen.sh
index 4827884..7fd0f20 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,9 +3,15 @@
 # create config dir if not exist
 test -d config || mkdir config
 
+rst2manexe=`which rst2man`
+if [ "$rst2manexe" == "" ]; then
+	echo "ERROR: Building from source requires rst2man to build the man pages"
+fi
+
 set -x
 aclocal -I config
 libtoolize --force --copy
 autoheader
+doc/generate
 automake --foreign --add-missing --copy
 autoconf
diff --git a/config.h.in b/config.h.in
index 2758667..a3b72ae 100644
--- a/config.h.in
+++ b/config.h.in
@@ -12,24 +12,15 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
-/* Define to 1 if you have the `ibcommon' library (-libcommon). */
-#undef HAVE_LIBIBCOMMON
-
 /* Define to 1 if you have the `ibmad' library (-libmad). */
 #undef HAVE_LIBIBMAD
 
 /* Define to 1 if you have the `ibumad' library (-libumad). */
 #undef HAVE_LIBIBUMAD
 
-/* Define to 1 if you have the `opensm' library (-lopensm). */
-#undef HAVE_LIBOPENSM
-
 /* Define to 1 if you have the `osmcomp' library (-losmcomp). */
 #undef HAVE_LIBOSMCOMP
 
-/* Define to 1 if you have the `osmvendor' library (-losmvendor). */
-#undef HAVE_LIBOSMVENDOR
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -63,8 +54,8 @@
 /* Define to 1 if you have the `strtoul' function. */
 #undef HAVE_STRTOUL
 
-/* Define to 1 if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_H
+/* Define to 1 if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
 
 /* Define to 1 if you have the <sys/ioctl.h> header file. */
 #undef HAVE_SYS_IOCTL_H
@@ -75,12 +66,18 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if struct umad_port has link_layer member */
+#undef HAVE_UMAD_PORT_LINK_LAYER
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
 /* Define to 1 if you have the `vprintf' function. */
 #undef HAVE_VPRINTF
 
+/* Define the path to configurations */
+#undef IBDIAG_CONFIG_PATH
+
 /* Define to the sub-directory in which libtool stores uninstalled libraries.
    */
 #undef LT_OBJDIR
diff --git a/config/compile b/config/compile
new file mode 100755
index 0000000..1b1d232
--- /dev/null
+++ b/config/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config/config.guess b/config/config.guess
index 202f698..2fc3acc 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-timestamp='2008-09-28'
+timestamp='2003-06-17'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -18,15 +17,13 @@ timestamp='2008-09-28'
 #
 # 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-
 # Originally written by Per Bothner <per at bothner.com>.
 # Please send patches to <config-patches at gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -56,8 +53,8 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -69,11 +66,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit 0 ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit 0 ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit 0 ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -107,7 +104,7 @@ set_cc_for_build='
 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -126,7 +123,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
 	;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+esac ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi at noc.rutgers.edu 1994-08-24)
@@ -139,21 +136,11 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
-	eval $set_cc_for_build
-	cat << EOF > $dummy.c
-	#include <features.h>
-	#ifdef __UCLIBC__
-	# ifdef __UCLIBC_CONFIG_VERSION__
-	LIBC=uclibc __UCLIBC_CONFIG_VERSION__
-	# else
-	LIBC=uclibc
-	# endif
-	#else
-	LIBC=gnu
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
+## for Red Hat Linux
+if test -f /etc/redhat-release ; then
+    VENDOR=redhat ;
+else
+    VENDOR= ;
 fi
 
 # Note: order is significant - the case branches are not exclusive.
@@ -178,7 +165,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
-	    sh5el) machine=sh5le-unknown ;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
@@ -217,32 +203,50 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
-	exit ;;
+	exit 0 ;;
+    amiga:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    arc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    hp300:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mac68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    macppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme68k:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvme88k:OpenBSD:*:*)
+	echo m88k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    mvmeppc:OpenBSD:*:*)
+	echo powerpc-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    pmax:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sgi:OpenBSD:*:*)
+	echo mipseb-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    sun3:OpenBSD:*:*)
+	echo m68k-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
+    wgrisc:OpenBSD:*:*)
+	echo mipsel-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     *:OpenBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-	exit ;;
-    *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit ;;
-    *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-	exit ;;
-    macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
+	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+	exit 0 ;;
     alpha:OSF1:*:*)
-	case $UNAME_RELEASE in
-	*4.0)
+	if test $UNAME_RELEASE = "V4.0"; then
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-		;;
-	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-		;;
-	esac
+	fi
 	# According to Compaq, /usr/sbin/psrinfo has been available on
 	# OSF/1 and Tru64 systems produced since 1995.  I hope that
 	# covers most systems running today.  This code pipes the CPU
@@ -280,49 +284,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    "EV7.9 (21364A)")
 		UNAME_MACHINE="alphaev79" ;;
 	esac
-	# A Pn.n version is a patched version.
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit 0 ;;
+    Alpha*:OpenVMS:*:*)
+	echo alpha-hp-vms
+	exit 0 ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
 	# of the specific Alpha model?
 	echo alpha-pc-interix
-	exit ;;
+	exit 0 ;;
     21064:Windows_NT:50:3)
 	echo alpha-dec-winnt3.5
-	exit ;;
+	exit 0 ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
-	exit ;;
+	exit 0;;
     *:[Aa]miga[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit ;;
+	exit 0 ;;
     *:[Mm]orph[Oo][Ss]:*:*)
 	echo ${UNAME_MACHINE}-unknown-morphos
-	exit ;;
+	exit 0 ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
-	exit ;;
-    *:z/VM:*:*)
-	echo s390-ibm-zvmoe
-	exit ;;
-    *:OS400:*:*)
-        echo powerpc-ibm-os400
-	exit ;;
+	exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-	echo arm-unknown-riscos
-	exit ;;
+	exit 0;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
 	echo hppa1.1-hitachi-hiuxmpp
-	exit ;;
+	exit 0;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
 	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -330,32 +327,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	else
 		echo pyramid-pyramid-bsd
 	fi
-	exit ;;
+	exit 0 ;;
     NILE*:*:*:dcosx)
 	echo pyramid-pyramid-svr4
-	exit ;;
+	exit 0 ;;
     DRS?6000:unix:4.0:6*)
 	echo sparc-icl-nx6
-	exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7*)
 	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7; exit ;;
+	    sparc) echo sparc-icl-nx7 && exit 0 ;;
 	esac ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
+	exit 0 ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	exit 0 ;;
+    i86pc:SunOS:5.*:*)
 	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
+	exit 0 ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
 	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
+	exit 0 ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
 	    Series*|S4*)
@@ -364,10 +361,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
 	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit ;;
+	exit 0 ;;
     sun3*:SunOS:*:*)
 	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -379,10 +376,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		echo sparc-sun-sunos${UNAME_RELEASE}
 		;;
 	esac
-	exit ;;
+	exit 0 ;;
     aushp:SunOS:*:*)
 	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -393,40 +390,37 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+        exit 0 ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
-    m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
-	exit ;;
+        exit 0 ;;
     powerpc:machten:*:*)
 	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
-	exit ;;
+	exit 0 ;;
     RISC*:ULTRIX:*:*)
 	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     VAX*:ULTRIX*:*:*)
 	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
 	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -450,33 +444,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
-	    { echo "$SYSTEM_NAME"; exit; }
+	$CC_FOR_BUILD -o $dummy $dummy.c \
+	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+	  && exit 0
 	echo mips-mips-riscos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
-	exit ;;
+	exit 0 ;;
     Motorola:*:4.3:PL8-*)
 	echo powerpc-harris-powermax
-	exit ;;
+	exit 0 ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 	echo powerpc-harris-powermax
-	exit ;;
+	exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
 	echo powerpc-harris-powerunix
-	exit ;;
+	exit 0 ;;
     m88k:CX/UX:7*:*)
 	echo m88k-harris-cxux7
-	exit ;;
+	exit 0 ;;
     m88k:*:4*:R4*)
 	echo m88k-motorola-sysv4
-	exit ;;
+	exit 0 ;;
     m88k:*:3*:R3*)
 	echo m88k-motorola-sysv3
-	exit ;;
+	exit 0 ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -492,29 +485,29 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+ 	exit 0 ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
-	exit ;;
+	exit 0 ;;
     M88*:*:R3*:*)
 	# Delta 88k system running SVR3
 	echo m88k-motorola-sysv3
-	exit ;;
+	exit 0 ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 	echo m88k-tektronix-sysv3
-	exit ;;
+	exit 0 ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 	echo m68k-tektronix-bsd
-	exit ;;
+	exit 0 ;;
     *:IRIX*:*:*)
 	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit ;;
+	exit 0 ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
+	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
 	echo i386-ibm-aix
-	exit ;;
+	exit 0 ;;
     ia64:AIX:*:*)
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
@@ -522,7 +515,7 @@ EOF
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit ;;
+	exit 0 ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 		eval $set_cc_for_build
@@ -537,19 +530,15 @@ EOF
 			exit(0);
 			}
 EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-		then
-			echo "$SYSTEM_NAME"
-		else
-			echo rs6000-ibm-aix3.2.5
-		fi
+		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+		echo rs6000-ibm-aix3.2.5
 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 		echo rs6000-ibm-aix3.2.4
 	else
 		echo rs6000-ibm-aix3.2
 	fi
-	exit ;;
-    *:AIX:*:[456])
+	exit 0 ;;
+    *:AIX:*:[45])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -562,28 +551,28 @@ EOF
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit ;;
+	exit 0 ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
-	exit ;;
+	exit 0 ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 	echo romp-ibm-bsd4.4
-	exit ;;
+	exit 0 ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
 	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit ;;                             # report: romp-ibm BSD 4.3
+	exit 0 ;;                           # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
-	exit ;;
+	exit 0 ;;
     DPX/2?00:B.O.S.:*:*)
 	echo m68k-bull-sysv3
-	exit ;;
+	exit 0 ;;
     9000/[34]??:4.3bsd:1.*:*)
 	echo m68k-hp-bsd
-	exit ;;
+	exit 0 ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 	echo m68k-hp-bsd4.4
-	exit ;;
+	exit 0 ;;
     9000/[34678]??:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	case "${UNAME_MACHINE}" in
@@ -645,19 +634,9 @@ EOF
 	esac
 	if [ ${HP_ARCH} = "hppa2.0w" ]
 	then
-	    eval $set_cc_for_build
-
-	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-	    # generating 64-bit code.  GNU and HP use different nomenclature:
-	    #
-	    # $ CC_FOR_BUILD=cc ./config.guess
-	    # => hppa2.0w-hp-hpux11.23
-	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-	    # => hppa64-hp-hpux11.23
-
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep __LP64__ >/dev/null
+	    # avoid double evaluation of $set_cc_for_build
+	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 	    then
 		HP_ARCH="hppa2.0w"
 	    else
@@ -665,11 +644,11 @@ EOF
 	    fi
 	fi
 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit ;;
+	exit 0 ;;
     ia64:HP-UX:*:*)
 	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 	echo ia64-hp-hpux${HPUX_REV}
-	exit ;;
+	exit 0 ;;
     3050*:HI-UX:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -697,192 +676,150 @@ EOF
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-		{ echo "$SYSTEM_NAME"; exit; }
+	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
 	echo unknown-hitachi-hiuxwe2
-	exit ;;
+	exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 	echo hppa1.1-hp-bsd
-	exit ;;
+	exit 0 ;;
     9000/8??:4.3bsd:*:*)
 	echo hppa1.0-hp-bsd
-	exit ;;
+	exit 0 ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
-	exit ;;
+	exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 	echo hppa1.1-hp-osf
-	exit ;;
+	exit 0 ;;
     hp8??:OSF1:*:*)
 	echo hppa1.0-hp-osf
-	exit ;;
+	exit 0 ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
 	    echo ${UNAME_MACHINE}-unknown-osf1mk
 	else
 	    echo ${UNAME_MACHINE}-unknown-osf1
 	fi
-	exit ;;
+	exit 0 ;;
     parisc*:Lites*:*:*)
 	echo hppa1.1-hp-lites
-	exit ;;
+	exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit ;;
+        exit 0 ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit ;;
+        exit 0 ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit ;;
+        exit 0 ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit ;;
+        exit 0 ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit ;;
+        exit 0 ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	exit 0 ;;
     CRAY*[A-Z]90:*:*:*)
 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
-	exit ;;
+	exit 0 ;;
     CRAY*TS:*:*:*)
 	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	exit 0 ;;
     CRAY*T3E:*:*:*)
 	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	exit 0 ;;
     CRAY*SV1:*:*:*)
 	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	exit 0 ;;
     *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
+	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
+	exit 0 ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
-    5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
+        exit 0 ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     sparc*:BSD/OS:*:*)
 	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:BSD/OS:*:*)
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	esac
-	exit ;;
+	exit 0 ;;
+    *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+	# Determine whether the default compiler uses glibc.
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <features.h>
+	#if __GLIBC__ >= 2
+	LIBC=gnu
+	#else
+	LIBC=
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+	exit 0 ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
-	exit ;;
-    *:MINGW*:*)
+	exit 0 ;;
+    i*:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
-	exit ;;
-    i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
-	exit ;;
+	exit 0 ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
-	exit ;;
-    *:Interix*:[3456]*)
-    	case ${UNAME_MACHINE} in
-	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
-		exit ;;
-	    EM64T | authenticamd | genuineintel)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	esac ;;
+	exit 0 ;;
+    x86:Interix*:[34]*)
+	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+	exit 0 ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
+	exit 0 ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
 	# UNAME_MACHINE based on the output of uname instead of i386?
 	echo i586-pc-interix
-	exit ;;
+	exit 0 ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
-	exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
+	exit 0 ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
-	exit ;;
+	exit 0 ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
+	exit 0 ;;
     *:GNU:*:*)
-	# the GNU system
 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit ;;
-    *:GNU/*:*:*)
-	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit ;;
+	exit 0 ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
-	exit ;;
+	exit 0 ;;
     arm*:Linux:*:*)
-	eval $set_cc_for_build
-	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_EABI__
-	then
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	else
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
-	fi
-	exit ;;
-    avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-${LIBC}
-	exit ;;
-    crisv32:Linux:*:*)
-	echo crisv32-axis-linux-${LIBC}
-	exit ;;
-    frv:Linux:*:*)
-    	echo frv-unknown-linux-${LIBC}
-	exit ;;
+	echo cris-axis-linux-gnu
+	exit 0 ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
+	echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     mips:Linux:*:*)
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -899,12 +836,8 @@ EOF
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^CPU/{
-		s: ::g
-		p
-	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 	;;
     mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -922,22 +855,15 @@ EOF
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^CPU/{
-		s: ::g
-		p
-	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 	;;
-    or32:Linux:*:*)
-	echo or32-unknown-linux-${LIBC}
-	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-${LIBC}
-	exit ;;
+	echo powerpc-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-${LIBC}
-	exit ;;
+	echo powerpc64-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -949,44 +875,35 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
         esac
 	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
-	exit ;;
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit 0 ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
 	esac
-	exit ;;
+	exit 0 ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-${LIBC}
-	exit ;;
+	echo hppa64-unknown-linux-gnu
+	exit 0 ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
-	exit ;;
+	echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
+	exit 0 ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
-    vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
-	exit ;;
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit 0 ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-${LIBC}
-	exit ;;
-    xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
-	exit ;;
+	echo x86_64-${VENDOR:-unknown}-linux-gnu
+	exit 0 ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
 	# first see if it will tell us. cd to the root directory to prevent
@@ -1000,19 +917,20 @@ EOF
 				    p'`
         case "$ld_supported_targets" in
 	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
+		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 		;;
 	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
-		exit ;;
+		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		exit 0 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		exit 0 ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
-		exit ;;
+		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		exit 0 ;;
 	esac
-	# This should get integrated into the C code below, but now we hack
-	if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
 	# Determine whether the default compiler is a.out or elf
 	eval $set_cc_for_build
 	sed 's/^	//' << EOF >$dummy.c
@@ -1028,33 +946,23 @@ EOF
 	LIBC=gnulibc1
 	# endif
 	#else
-	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+	#ifdef __INTEL_COMPILER
 	LIBC=gnu
 	#else
 	LIBC=gnuaout
 	#endif
 	#endif
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
-	    /^LIBC/{
-		s: ::g
-		p
-	    }'`"
-	test x"${LIBC}" != x && {
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-		exit
-	}
-	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
+	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 	;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 	# earlier versions are messed up and put the nodename in both
 	# sysname and nodename.
 	echo i386-sequent-sysv4
-	exit ;;
+	exit 0 ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -1062,27 +970,24 @@ EOF
 	# I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit ;;
+	exit 0 ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
 	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit ;;
+	exit 0 ;;
     i*86:XTS-300:*:STOP)
 	echo ${UNAME_MACHINE}-unknown-stop
-	exit ;;
+	exit 0 ;;
     i*86:atheos:*:*)
 	echo ${UNAME_MACHINE}-unknown-atheos
-	exit ;;
-    i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
-	exit ;;
+	exit 0 ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     i*86:*DOS:*:*)
 	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit ;;
+	exit 0 ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
 	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1090,16 +995,15 @@ EOF
 	else
 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 	fi
-	exit ;;
-    i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	exit 0 ;;
+    i*86:*:5:[78]*)
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
 	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit ;;
+	exit 0 ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1117,73 +1021,73 @@ EOF
 	else
 		echo ${UNAME_MACHINE}-pc-sysv32
 	fi
-	exit ;;
+	exit 0 ;;
     pc:*:*:*)
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
 	echo i386-pc-msdosdjgpp
-        exit ;;
+        exit 0 ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
-	exit ;;
+	exit 0 ;;
     paragon:*:*:*)
 	echo i860-intel-osf1
-	exit ;;
+	exit 0 ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
 	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 	fi
-	exit ;;
+	exit 0 ;;
     mini*:CTIX:SYS*5:*)
 	# "miniframe"
 	echo m68010-convergent-sysv
-	exit ;;
+	exit 0 ;;
     mc68k:UNIX:SYSTEM5:3.51m)
 	echo m68k-convergent-sysv
-	exit ;;
+	exit 0 ;;
     M680?0:D-NIX:5.3:*)
 	echo m68k-diab-dnix
-	exit ;;
-    M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	exit 0 ;;
+    M68*:*:R3V[567]*:*)
+	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
 	OS_REL=''
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+          && echo i486-ncr-sysv4 && exit 0 ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
-	exit ;;
+	exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
 	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     rs6000:LynxOS:2.*:*)
 	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     SM[BE]S:UNIX_SV:*:*)
 	echo mips-dde-sysv${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
-	exit ;;
+	exit 0 ;;
     RM*:SINIX-*:*:*)
 	echo mips-sni-sysv4
-	exit ;;
+	exit 0 ;;
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1191,84 +1095,68 @@ EOF
 	else
 		echo ns32k-sni-sysv
 	fi
-	exit ;;
+	exit 0 ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel at ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit ;;
+        exit 0 ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
 	echo hppa1.1-stratus-sysv4
-	exit ;;
+	exit 0 ;;
     *:*:*:FTX*)
 	# From seanf at swdc.stratus.com.
 	echo i860-stratus-sysv4
-	exit ;;
-    i*86:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
-	exit ;;
+	exit 0 ;;
     *:VOS:*:*)
 	# From Paul.Green at stratus.com.
 	echo hppa1.1-stratus-vos
-	exit ;;
+	exit 0 ;;
     mc68*:A/UX:*:*)
 	echo m68k-apple-aux${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
-	exit ;;
+	exit 0 ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
 	        echo mips-nec-sysv${UNAME_RELEASE}
 	else
 	        echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit ;;
+        exit 0 ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
-	exit ;;
+	exit 0 ;;
     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
 	echo powerpc-apple-beos
-	exit ;;
+	exit 0 ;;
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
-	exit ;;
-    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	echo i586-pc-haiku
-	exit ;;
+	exit 0 ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     SX-5:SUPER-UX:*:*)
 	echo sx5-nec-superux${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     SX-6:SUPER-UX:*:*)
 	echo sx6-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     Power*:Rhapsody:*:*)
 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:Rhapsody:*:*)
 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    unknown) UNAME_PROCESSOR=powerpc ;;
+	case `uname -p` in
+	    *86) UNAME_PROCESSOR=i686 ;;
+	    powerpc) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
 	if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1276,25 +1164,22 @@ EOF
 		UNAME_MACHINE=pc
 	fi
 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
-	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
+	exit 0 ;;
+    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
 	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
-	exit ;;
+	exit 0 ;;
     BS2000:POSIX*:*:*)
 	echo bs2000-siemens-sysv
-	exit ;;
+	exit 0 ;;
     DS/*:UNIX_System_V:*:*)
 	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit ;;
+	exit 0 ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
@@ -1305,47 +1190,28 @@ EOF
 	    UNAME_MACHINE="$cputype"
 	fi
 	echo ${UNAME_MACHINE}-unknown-plan9
-	exit ;;
+	exit 0 ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
-	exit ;;
+	exit 0 ;;
     *:TENEX:*:*)
 	echo pdp10-unknown-tenex
-	exit ;;
+	exit 0 ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 	echo pdp10-dec-tops20
-	exit ;;
+	exit 0 ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 	echo pdp10-xkl-tops20
-	exit ;;
+	exit 0 ;;
     *:TOPS-20:*:*)
 	echo pdp10-unknown-tops20
-	exit ;;
+	exit 0 ;;
     *:ITS:*:*)
 	echo pdp10-unknown-its
-	exit ;;
+	exit 0 ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-	exit ;;
-    *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit ;;
-    *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms ; exit ;;
-	    I*) echo ia64-dec-vms ; exit ;;
-	    V*) echo vax-dec-vms ; exit ;;
-	esac ;;
-    *:XENIX:*:SysV)
-	echo i386-pc-xenix
-	exit ;;
-    i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-	exit ;;
-    i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
-	exit ;;
+	exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1377,7 +1243,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
+  printf ("arm-acorn-riscix"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1466,12 +1332,11 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1480,22 +1345,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
 	echo c1-convex-bsd
-	exit ;;
+	exit 0 ;;
     c2*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-	exit ;;
+	exit 0 ;;
     c34*)
 	echo c34-convex-bsd
-	exit ;;
+	exit 0 ;;
     c38*)
 	echo c38-convex-bsd
-	exit ;;
+	exit 0 ;;
     c4*)
 	echo c4-convex-bsd
-	exit ;;
+	exit 0 ;;
     esac
 fi
 
@@ -1506,9 +1371,7 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+    ftp://ftp.gnu.org/pub/gnu/config/
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
diff --git a/config/config.sub b/config/config.sub
index 66f218c..6b2ff9f 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-timestamp='2008-09-08'
+timestamp='2003-06-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -22,15 +21,14 @@ timestamp='2008-09-08'
 #
 # 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-
 # Please send patches to <config-patches at gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -72,8 +70,8 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -85,11 +83,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit 0 ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit 0 ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit 0 ;;
     -- )     # Stop option processing
        shift; break ;;
     - )	# Use stdin as input.
@@ -101,7 +99,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit ;;
+       exit 0;;
 
     * )
        break ;;
@@ -120,9 +118,7 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
+  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -148,7 +144,7 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray)
+	-apple | -axis)
 		os=
 		basic_machine=$1
 		;;
@@ -173,10 +169,6 @@ case $os in
 	-hiux*)
 		os=-hiuxwe2
 		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
 	-sco5)
 		os=-sco3.2v5
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -193,10 +185,6 @@ case $os in
 		# Don't forget version if it is 3.2v4 or newer.
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
 	-sco*)
 		os=-sco3.2v2
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -240,55 +228,45 @@ case $basic_machine in
 	| a29k \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-	| bfin \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
 	| c4x | clipper \
-	| d10v | d30v | dlx | dsp16xx | dvp \
-	| fido | fr30 | frv \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
-	| ip2k | iq2000 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| ip2k \
+	| m32r | m68000 | m68k | m88k | mcore \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
 	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
 	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
-	| mt \
 	| msp430 \
-	| nios | nios2 \
 	| ns16k | ns32k \
-	| or32 \
+	| openrisc | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]a*eb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| s390 | s390x \
+	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
+	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+	| strongarm \
 	| tahoe | thumb | tic4x | tic80 | tron \
 	| v850 | v850e \
 	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-	| z8k | z80)
+	| x86 | xscale | xstormy16 | xtensa \
+	| z8k)
 		basic_machine=$basic_machine-unknown
 		;;
 	m6811 | m68hc11 | m6812 | m68hc12)
@@ -298,9 +276,6 @@ case $basic_machine in
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
 		;;
-	ms1)
-		basic_machine=mt-unknown
-		;;
 
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
@@ -320,66 +295,55 @@ case $basic_machine in
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| bfin-* | bs2000-* \
+	| avr-* \
+	| bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| clipper-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| m32c-* | m32r-* | m32rle-* \
+	| ip2k-* \
+	| m32r-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| m88110-* | m88k-* | mcore-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
 	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
 	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
 	| msp430-* \
-	| nios-* | nios2-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
+	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]a*eb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| s390-* | s390x-* \
+	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tron-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
-	| xstormy16-* | xtensa*-* \
+	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+	| xtensa-* \
 	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
+	| z8k-*)
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
@@ -397,9 +361,6 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
-		basic_machine=abacus-unknown
-		;;
 	adobe68k)
 		basic_machine=m68010-adobe
 		os=-scout
@@ -417,9 +378,6 @@ case $basic_machine in
 	amd64)
 		basic_machine=x86_64-pc
 		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
 	amdahl)
 		basic_machine=580-amdahl
 		os=-sysv
@@ -451,22 +409,10 @@ case $basic_machine in
 		basic_machine=ns32k-sequent
 		os=-dynix
 		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
-        cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -491,27 +437,12 @@ case $basic_machine in
 		basic_machine=j90-cray
 		os=-unicos
 		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
 	crds | unos)
 		basic_machine=m68k-crds
 		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
 	cris | cris-* | etrax*)
 		basic_machine=cris-axis
 		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
 		;;
@@ -534,14 +465,6 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
 	dpx20 | dpx20-*)
 		basic_machine=rs6000-bull
 		os=-bosx
@@ -692,14 +615,6 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
 	m88k-omron*)
 		basic_machine=m88k-omron
 		;;
@@ -715,10 +630,6 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-mingw32
 		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
@@ -726,30 +637,16 @@ case $basic_machine in
 		basic_machine=m68k-atari
 		os=-mint
 		;;
-	mipsEE* | ee | ps2)
-		basic_machine=mips64r5900el-scei
-		case $os in
-		    -linux*)
-			;;
-		    *)
-			os=-elf
-			;;
-		esac
-		;;
-	iop)
-		basic_machine=mipsel-scei
-		os=-irx
-		;;
-	dvp)
-		basic_machine=dvp-scei
-		os=-elf
-		;;
 	mips3*-*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
 		;;
 	mips3*)
 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 		;;
+	mmix*)
+		basic_machine=mmix-knuth
+		os=-mmixware
+		;;
 	monitor)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -762,9 +659,6 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-msdos
 		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
@@ -833,6 +727,10 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	nv1)
+		basic_machine=nv1-cray
+		os=-unicosmp
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -840,12 +738,9 @@ case $basic_machine in
 		basic_machine=hppa1.1-oki
 		os=-proelf
 		;;
-	openrisc | openrisc-*)
+	or32 | or32-*)
 		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
+		os=-coff
 		;;
 	OSE68000 | ose68000)
 		basic_machine=m68000-ericsson
@@ -863,14 +758,6 @@ case $basic_machine in
 		basic_machine=i860-intel
 		os=-osf
 		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
 	pbd)
 		basic_machine=sparc-tti
 		;;
@@ -880,12 +767,6 @@ case $basic_machine in
 	pc532 | pc532-*)
 		basic_machine=ns32k-pc532
 		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
 	pentium | p5 | k5 | k6 | nexgen | viac3)
 		basic_machine=i586-pc
 		;;
@@ -942,10 +823,6 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
 	rom68k)
 		basic_machine=m68k-rom68k
 		os=-coff
@@ -956,12 +833,6 @@ case $basic_machine in
 	rtpc | rtpc-*)
 		basic_machine=romp-ibm
 		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
 	sa29200)
 		basic_machine=a29k-amd
 		os=-udi
@@ -972,10 +843,6 @@ case $basic_machine in
 	sb1el)
 		basic_machine=mipsisa64sb1el-unknown
 		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
 	sei)
 		basic_machine=mips-sei
 		os=-seiux
@@ -987,9 +854,6 @@ case $basic_machine in
 		basic_machine=sh-hitachi
 		os=-hms
 		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
 	sh64)
 		basic_machine=sh64-unknown
 		;;
@@ -1079,10 +943,6 @@ case $basic_machine in
 		basic_machine=tic6x-unknown
 		os=-coff
 		;;
-	tile*)
-		basic_machine=tile-unknown
-		os=-linux-gnu
-		;;
 	tx39)
 		basic_machine=mipstx39-unknown
 		;;
@@ -1096,10 +956,6 @@ case $basic_machine in
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
 	udi29k)
 		basic_machine=a29k-amd
 		os=-udi
@@ -1143,10 +999,6 @@ case $basic_machine in
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
@@ -1158,10 +1010,6 @@ case $basic_machine in
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1181,9 +1029,6 @@ case $basic_machine in
 	romp)
 		basic_machine=romp-ibm
 		;;
-	mmix)
-		basic_machine=mmix-knuth
-		;;
 	rs6000)
 		basic_machine=rs6000-ibm
 		;;
@@ -1200,10 +1045,13 @@ case $basic_machine in
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b)
 		basic_machine=sparc-sun
 		;;
 	cydra)
@@ -1276,23 +1124,19 @@ case $os in
 	      | -aos* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -chorusos* | -chorusrdb* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1310,15 +1154,12 @@ case $os in
 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
 		;;
 	-mac*)
 		os=`echo $os | sed -e 's|mac|macos|'`
 		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
 	-linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
@@ -1331,9 +1172,6 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
-		os=-os400
-		;;
 	-wince*)
 		os=-wince
 		;;
@@ -1355,9 +1193,6 @@ case $os in
 	-atheos*)
 		os=-atheos
 		;;
-	-syllable*)
-		os=-syllable
-		;;
 	-386bsd)
 		os=-bsd
 		;;
@@ -1380,9 +1215,6 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
-		os=-tpf
-		;;
 	-triton*)
 		os=-sysv3
 		;;
@@ -1419,12 +1251,6 @@ case $os in
 	-kaos*)
 		os=-kaos
 		;;
-	-zvmoe)
-		os=-zvmoe
-		;;
-	-dicos*)
-		os=-dicos
-		;;
 	-none)
 		;;
 	*)
@@ -1447,12 +1273,6 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
-		os=-elf
-		;;
-        spu-*)
-		os=-elf
-		;;
 	*-acorn)
 		os=-riscix1.2
 		;;
@@ -1462,8 +1282,8 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-        c4x-* | tic4x-*)
-        	os=-coff
+	c4x-* | tic4x-*)
+		os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1490,9 +1310,6 @@ case $basic_machine in
 	m68*-cisco)
 		os=-aout
 		;;
-        mep-*)
-		os=-elf
-		;;
 	mips*-cisco)
 		os=-elf
 		;;
@@ -1511,15 +1328,9 @@ case $basic_machine in
 	*-be)
 		os=-beos
 		;;
-	*-haiku)
-		os=-haiku
-		;;
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
-		os=-mmixware
-		;;
 	*-wec)
 		os=-proelf
 		;;
@@ -1652,15 +1463,9 @@ case $basic_machine in
 			-mvs* | -opened*)
 				vendor=ibm
 				;;
-			-os400*)
-				vendor=ibm
-				;;
 			-ptx*)
 				vendor=sequent
 				;;
-			-tpf*)
-				vendor=ibm
-				;;
 			-vxsim* | -vxworks* | -windiss*)
 				vendor=wrs
 				;;
@@ -1685,7 +1490,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit
+exit 0
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/config/depcomp b/config/depcomp
index e5f9736..04701da 100755
--- a/config/depcomp
+++ b/config/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2007-03-29.01
+scriptversion=2005-07-09.11
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 # 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
@@ -92,20 +91,7 @@ gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am.  Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
-  for arg
-  do
-    case $arg in
-    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
-    *)  set fnord "$@" "$arg" ;;
-    esac
-    shift # fnord
-    shift # $arg
-  done
-  "$@"
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
   else
@@ -215,39 +201,34 @@ aix)
   # current directory.  Also, the AIX compiler puts `$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
   if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.u
-    tmpdepfile2=$base.u
-    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
-    tmpdepfile1=$dir$base.u
-    tmpdepfile2=$dir$base.u
-    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
+  if test -f "$tmpdepfile"; then :
+  else
+    stripped=`echo "$stripped" | sed 's,^.*/,,'`
+    tmpdepfile="$stripped.u"
+  fi
+
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    rm -f "$tmpdepfile"
     exit $stat
   fi
 
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-  do
-    test -f "$tmpdepfile" && break
-  done
   if test -f "$tmpdepfile"; then
+    outname="$stripped.o"
     # Each line is of the form `foo.o: dependent.h'.
     # Do two passes, one to just change these to
     # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -295,46 +276,6 @@ icc)
   rm -f "$tmpdepfile"
   ;;
 
-hp2)
-  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
-  # compilers, which have integrated preprocessors.  The correct option
-  # to use with these is +Maked; it writes dependencies to a file named
-  # 'foo.d', which lands next to the object file, wherever that
-  # happens to be.
-  # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-  if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir.libs/$base.d
-    "$@" -Wc,+Maked
-  else
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir$base.d
-    "$@" +Maked
-  fi
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-     rm -f "$tmpdepfile1" "$tmpdepfile2"
-     exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
-    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
-  else
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile" "$tmpdepfile2"
-  ;;
-
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -347,13 +288,13 @@ tru64)
 
    if test "$libtool" = yes; then
       # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
+      # static library.  This mecanism is used in libtool 1.4 series to
       # handle both shared and static libraries in a single compilation.
       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
+      # compilations output dependencies in in $dir.libs/$base.o.d and
       # in $dir$base.o.d.  We have to check for both files, because
       # one of the two compilations can be disabled.  We should prefer
       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
diff --git a/config/install-sh b/config/install-sh
index a5897de..4d4a951 100755
--- a/config/install-sh
+++ b/config/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2006-12-25.00
+scriptversion=2005-05-14.22
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,68 +39,38 @@ scriptversion=2006-12-25.00
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" ""	$nl"
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
+doit="${DOITPROG-}"
 
-posix_mkdir=
+# put in absolute paths if you don't have them in your path; or use env. vars.
 
-# Desired mode of installed file.
-mode=0755
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
 
-chgrpcmd=
-chmodcmd=$chmodprog
+chmodcmd="$chmodprog 0755"
 chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
+chgrpcmd=
 stripcmd=
-
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
 src=
 dst=
 dir_arg=
-dst_arg=
-
-copy_on_change=false
+dstarg=
 no_target_directory=
 
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -110,86 +80,81 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
-     --help     display this help and exit.
-     --version  display version info and exit.
-
-  -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
-  -d            create directories instead of installing files.
-  -g GROUP      $chgrpprog installed files to GROUP.
-  -m MODE       $chmodprog installed files to MODE.
-  -o USER       $chownprog installed files to USER.
-  -s            $stripprog installed files.
-  -t DIRECTORY  install into DIRECTORY.
-  -T            report an error if DSTFILE is a directory.
+-c         (ignored)
+-d         create directories instead of installing files.
+-g GROUP   $chgrpprog installed files to GROUP.
+-m MODE    $chmodprog installed files to MODE.
+-o USER    $chownprog installed files to USER.
+-s         $stripprog installed files.
+-t DIRECTORY  install into DIRECTORY.
+-T         report an error if DSTFILE is a directory.
+--help     display this help and exit.
+--version  display version info and exit.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
-  RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
 "
 
-while test $# -ne 0; do
+while test -n "$1"; do
   case $1 in
-    -c) ;;
-
-    -C) copy_on_change=true;;
+    -c) shift
+        continue;;
 
-    -d) dir_arg=true;;
+    -d) dir_arg=true
+        shift
+        continue;;
 
     -g) chgrpcmd="$chgrpprog $2"
-	shift;;
+        shift
+        shift
+        continue;;
 
     --help) echo "$usage"; exit $?;;
 
-    -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
 
     -o) chowncmd="$chownprog $2"
-	shift;;
+        shift
+        shift
+        continue;;
 
-    -s) stripcmd=$stripprog;;
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
 
-    -t) dst_arg=$2
-	shift;;
+    -t) dstarg=$2
+	shift
+	shift
+	continue;;
 
-    -T) no_target_directory=true;;
+    -T) no_target_directory=true
+	shift
+	continue;;
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)	shift
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
 	break;;
-
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
-
-    *)  break;;
   esac
-  shift
 done
 
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
-  # When -d is used, all remaining arguments are directories to create.
-  # When -t is used, the destination is already specified.
-  # Otherwise, the last argument is the destination.  Remove it from $@.
-  for arg
-  do
-    if test -n "$dst_arg"; then
-      # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dst_arg"
-      shift # fnord
-    fi
-    shift # arg
-    dst_arg=$arg
-  done
-fi
-
-if test $# -eq 0; then
+if test -z "$1"; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
@@ -199,47 +164,24 @@ if test $# -eq 0; then
   exit 0
 fi
 
-if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
-
-  # Set umask so as not to create temps with too-generous modes.
-  # However, 'strip' requires both read and write access to temps.
-  case $mode in
-    # Optimize common cases.
-    *644) cp_umask=133;;
-    *755) cp_umask=22;;
-
-    *[0-7])
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw='% 200'
-      fi
-      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
-    *)
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw=,u+rw
-      fi
-      cp_umask=$mode$u_plus_rw;;
-  esac
-fi
-
 for src
 do
   # Protect names starting with `-'.
   case $src in
-    -*) src=./$src;;
+    -*) src=./$src ;;
   esac
 
   if test -n "$dir_arg"; then
     dst=$src
-    dstdir=$dst
-    test -d "$dstdir"
-    dstdir_status=$?
-  else
+    src=
 
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -248,199 +190,71 @@ do
       exit 1
     fi
 
-    if test -z "$dst_arg"; then
+    if test -z "$dstarg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
 
-    dst=$dst_arg
+    dst=$dstarg
     # Protect names starting with `-'.
     case $dst in
-      -*) dst=./$dst;;
+      -*) dst=./$dst ;;
     esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
+	echo "$0: $dstarg: Is a directory" >&2
 	exit 1
       fi
-      dstdir=$dst
-      dst=$dstdir/`basename "$src"`
-      dstdir_status=0
-    else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
-      test -d "$dstdir"
-      dstdir_status=$?
+      dst=$dst/`basename "$src"`
     fi
   fi
 
-  obsolete_mkdir_used=false
-
-  if test $dstdir_status != 0; then
-    case $posix_mkdir in
-      '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
-    esac
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
 
-    if
-      $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
-      )
-    then :
-    else
+  # Make sure that the destination directory exists.
 
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
-      # or it failed possibly due to a race condition.  Create the
-      # directory the slow way, step by step, checking for races as we go.
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+	 '
+    IFS="${IFS-$defaultIFS}"
 
-      case $dstdir in
-	/*) prefix='/';;
-	-*) prefix='./';;
-	*)  prefix='';;
-      esac
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
+    IFS=$oIFS
 
-      eval "$initialize_posix_glob"
+    pathcomp=
 
-      oIFS=$IFS
-      IFS=/
-      $posix_glob set -f
-      set fnord $dstdir
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
       shift
-      $posix_glob set +f
-      IFS=$oIFS
-
-      prefixes=
-
-      for d
-      do
-	test -z "$d" && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
-      done
-
-      if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+	# mkdir can fail with a `File exist' error in case several
+	# install-sh are creating the directory concurrently.  This
+	# is OK.
+	test -d "$pathcomp" || exit
       fi
-    fi
+      pathcomp=$pathcomp/
+    done
   fi
 
   if test -n "$dir_arg"; then
-    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
   else
+    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -448,9 +262,10 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+    $doit $cpprog "$src" "$dsttmp" &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -458,59 +273,48 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
-    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
-    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # If -C, don't bother to copy if it wouldn't change the file.
-    if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
-       set X $old && old=:$2:$4:$5:$6 &&
-       set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
-       test "$old" = "$new" &&
-       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
-    then
-      rm -f "$dsttmp"
-    else
-      # Rename the file to the real destination.
-      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
-      # The rename failed, perhaps because mv can't rename something else
-      # to itself, or perhaps because mv is so ancient that it does not
-      # support -f.
-      {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
-      }
-    fi || exit 1
-
-    trap '' 0
-  fi
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+    # Now rename the file to the real destination.
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+      || {
+	   # The rename failed, perhaps because mv can't rename something else
+	   # to itself, or perhaps because mv is so ancient that it does not
+	   # support -f.
+
+	   # Now remove or move aside any old file at destination location.
+	   # We try this two ways since rm can't unlink itself on some
+	   # systems and the destination file might be busy for other
+	   # reasons.  In this case, the final cleanup might fail but the new
+	   # file should still install successfully.
+	   {
+	     if test -f "$dstdir/$dstfile"; then
+	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+	       || {
+		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+		 (exit 1); exit 1
+	       }
+	     else
+	       :
+	     fi
+	   } &&
+
+	   # Now rename the file to the real destination.
+	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+	 }
+    }
+  fi || { (exit 1); exit 1; }
 done
 
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit 0
+}
+
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
diff --git a/aclocal.m4 b/config/libtool.m4
similarity index 82%
copy from aclocal.m4
copy to config/libtool.m4
index 8e383e6..671cde1 100644
--- a/aclocal.m4
+++ b/config/libtool.m4
@@ -1,24 +1,3 @@
-# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
-# This file 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.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
-  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
-[m4_warning([this file was generated for autoconf 2.63.
-You have another version of autoconf.  It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
@@ -284,6 +263,9 @@ ltmain="$ac_aux_dir/ltmain.sh"
 ])# _LT_PROG_LTMAIN
 
 
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
 
 # So that we can recreate a full libtool script including additional
 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
@@ -337,6 +319,9 @@ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
 
 
 
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
 
 
 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
@@ -2316,14 +2301,7 @@ freebsd* | dragonfly*)
     *) objformat=elf ;;
     esac
   fi
-  # Handle Gentoo/FreeBSD as it was Linux
-  case $host_vendor in
-    gentoo)
-      version_type=linux ;;
-    *)
-      version_type=freebsd-$objformat ;;
-  esac
-
+  version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
@@ -2334,12 +2312,6 @@ freebsd* | dragonfly*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
       need_version=yes
       ;;
-    linux)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-      soname_spec='${libname}${release}${shared_ext}$major'
-      need_lib_prefix=no
-      need_version=no
-      ;;
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
@@ -2498,10 +2470,13 @@ linux* | k*bsd*-gnu)
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -5285,6 +5260,10 @@ compiler_DEFAULT=$CC
 _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
 if test -n "$compiler"; then
   _LT_COMPILER_NO_RTTI($1)
   _LT_COMPILER_PIC($1)
@@ -6914,6 +6893,10 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
 
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
 if test -n "$compiler"; then
   _LT_COMPILER_NO_RTTI($1)
   _LT_COMPILER_PIC($1)
@@ -7052,10 +7035,12 @@ _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
 ])# _LT_DECL_SED
 
 m4_ifndef([AC_PROG_SED], [
+############################################################
 # NOTE: This macro has been submitted for inclusion into   #
 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
 #  a released version of Autoconf we should remove this    #
 #  macro and use it instead.                               #
+############################################################
 
 m4_defun([AC_PROG_SED],
 [AC_MSG_CHECKING([for a sed that does not truncate output])
@@ -7373,1476 +7358,3 @@ _LT_EOF
     ;;
   esac
 ])
-
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file 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.
-
-# serial 6 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-		      [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
-  ])
-])# _LT_SET_OPTIONS
-
-
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [0], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
-	[Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
-    _LT_DECL([build_old_libs], [enable_static], [0],
-	[Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
-	 [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
-		 [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
-		 [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
-		 [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
-		 [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
-		 [m4_define([_LTDL_TYPE], [convenience])])
-
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file 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.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-	     [m4_foreach([_Lt_suffix],
-		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-		 [lt_append([$1], [$2], [$3])$4],
-		 [$5])],
-	  [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-	[$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
-
-# ltversion.m4 -- version numbers			-*- Autoconf -*-
-#
-#   Copyright (C) 2004 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file 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.
-
-# Generated from ltversion.in.
-
-# serial 3012 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.2.6])
-m4_define([LT_PACKAGE_REVISION], [1.3012])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6'
-macro_revision='1.3012'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
-
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file 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.
-
-# serial 4 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10.2], [],
-      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too.  Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.2])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
-  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL                                            -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 9
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
-  fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_$1_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-])
-
-# Generate code to set up dependency tracking.              -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-#serial 4
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[# Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
-  done
-done
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake.                             -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 13
-
-# This macro actually does too much.  Some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
-dnl Autoconf wants to disallow AM_ names.  We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
-  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-	      		     [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                  [_AM_DEPENDENCIES(OBJC)],
-                  [define([AC_PROG_OBJC],
-                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $_am_arg | $_am_arg:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot.  For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes.	            -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-	@echo done
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 5
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling.                     -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane.    -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 4
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
-   test "$[2]" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# Check how to create a tarball.                            -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-#     tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-#     $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
-
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
-
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
-  rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/config/ltmain.sh b/config/ltmain.sh
index 0634c4b..a72f2fd 100755
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -1,6 +1,6 @@
 # Generated from ltmain.m4sh.
 
-# ltmain.sh (GNU libtool) 2.2.6
+# ltmain.sh (GNU libtool) 2.2.6b
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
@@ -65,7 +65,7 @@
 #       compiler:		$LTCC
 #       compiler flags:		$LTCFLAGS
 #       linker:		$LD (gnu? $with_gnu_ld)
-#       $progname:		(GNU libtool) 2.2.6
+#       $progname:		(GNU libtool) 2.2.6b
 #       automake:		$automake_version
 #       autoconf:		$autoconf_version
 #
@@ -73,9 +73,9 @@
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=2.2.6
+VERSION=2.2.6b
 TIMESTAMP=""
-package_revision=1.3012
+package_revision=1.3017
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -116,15 +116,15 @@ $lt_unset CDPATH
 
 : ${CP="cp -f"}
 : ${ECHO="echo"}
-: ${EGREP="/usr/bin/grep -E"}
-: ${FGREP="/usr/bin/grep -F"}
-: ${GREP="/usr/bin/grep"}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
 : ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="/opt/local/bin/gsed"}
+: ${SED="/bin/sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -570,13 +570,6 @@ else
   # Restart under the correct shell, and then maybe $ECHO will work.
   exec $SHELL "$progpath" --no-reexec ${1+"$@"}
 fi
-# Same for EGREP, and just to be sure, do LTCC as well
-if test "x$EGREP" = x ; then
-    EGREP=egrep
-fi
-if test "x$LTCC" = x ; then
-    LTCC=${CC-gcc}
-fi
 
 if test "X$1" = X--fallback-echo; then
   # used as fallback echo
@@ -8066,53 +8059,9 @@ EOF
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		if test "x$EGREP" = x ; then
-			EGREP=egrep
-		fi
-		# We do not want portage's install root ($D) present.  Check only for
-		# this if the .la is being installed.
-		if test "$installed" = yes && test "$D"; then
-		  eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
-		else
-		  mynewdependency_lib="$libdir/$name"
-		fi
-		# Do not add duplicates
-		if test "$mynewdependency_lib"; then
-		  my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
-		  if test -z "$my_little_ninja_foo_1"; then
-		    newdependency_libs="$newdependency_libs $mynewdependency_lib"
-		  fi
-		fi
-		;;
-		  *)
-		if test "$installed" = yes; then
-		  # Rather use S=WORKDIR if our version of portage supports it.
-		  # This is because some ebuild (gcc) do not use $S as buildroot.
-		  if test "$PWORKDIR"; then
-		    S="$PWORKDIR"
-		  fi
-		  # We do not want portage's build root ($S) present.
-		  my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
-		  # We do not want portage's install root ($D) present.
-		  my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
-		  if test -n "$my_little_ninja_foo_2" && test "$S"; then
-		    mynewdependency_lib=""
-		  elif test -n "$my_little_ninja_foo_3" && test "$D"; then
-		    eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
-		  else
-		    mynewdependency_lib="$deplib"
-		  fi
-		else
-		  mynewdependency_lib="$deplib"
-		fi
-		# Do not add duplicates
-		if test "$mynewdependency_lib"; then
-		  my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
-		  if test -z "$my_little_ninja_foo_4"; then
-			newdependency_libs="$newdependency_libs $mynewdependency_lib"
-		  fi
-		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
 		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
 	      esac
 	    done
 	    dependency_libs="$newdependency_libs"
@@ -8176,10 +8125,6 @@ EOF
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
 	  esac
-	  # Do not add duplicates
-	  if test "$installed" = yes && test "$D"; then
-	    install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
-	  fi
 	  $ECHO > $output "\
 # $outputname - a libtool library file
 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
diff --git a/config/ltoptions.m4 b/config/ltoptions.m4
new file mode 100644
index 0000000..34151a3
--- /dev/null
+++ b/config/ltoptions.m4
@@ -0,0 +1,368 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file 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.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/config/ltsugar.m4 b/config/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/config/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file 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.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/config/ltversion.m4 b/config/ltversion.m4
new file mode 100644
index 0000000..f3c5309
--- /dev/null
+++ b/config/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file 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.
+
+# Generated from ltversion.in.
+
+# serial 3017 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6b])
+m4_define([LT_PACKAGE_REVISION], [1.3017])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6b'
+macro_revision='1.3017'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/config/lt~obsolete.m4 b/config/lt~obsolete.m4
new file mode 100644
index 0000000..637bb20
--- /dev/null
+++ b/config/lt~obsolete.m4
@@ -0,0 +1,92 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file 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.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/config/missing b/config/missing
index 1c8ff70..894e786 100755
--- a/config/missing
+++ b/config/missing
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2006-05-10.23
+scriptversion=2005-06-08.21
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
 #   Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
@@ -33,8 +33,6 @@ if test $# -eq 0; then
 fi
 
 run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
 # In the cases where this matters, `missing' is being run in the
 # srcdir already.
@@ -46,7 +44,7 @@ fi
 
 msg="missing on your system"
 
-case $1 in
+case "$1" in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -79,7 +77,6 @@ Supported PROGRAM values:
   aclocal      touch file \`aclocal.m4'
   autoconf     touch file \`configure'
   autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
   automake     touch all \`Makefile.in' files
   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
   flex         create \`lex.yy.c', if possible, from existing .c
@@ -109,7 +106,7 @@ esac
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
 # the program).
-case $1 in
+case "$1" in
   lex|yacc)
     # Not GNU programs, they don't have --version.
     ;;
@@ -138,7 +135,7 @@ esac
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case $1 in
+case "$1" in
   aclocal*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
@@ -167,7 +164,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case $f in
+      case "$f" in
       *:*) touch_files="$touch_files "`echo "$f" |
 				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -195,8 +192,8 @@ WARNING: \`$1' is needed, but is $msg.
          You can get \`$1' as part of \`Autoconf' from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
     if test -f "$file"; then
 	touch $file
     else
@@ -217,25 +214,25 @@ WARNING: \`$1' $msg.  You should only need it if
          in order for those modifications to take effect.  You can get
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
+    if [ $# -ne 1 ]; then
         eval LASTARG="\${$#}"
-	case $LASTARG in
+	case "$LASTARG" in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
+	    if [ -f "$SRCFILE" ]; then
 	         cp "$SRCFILE" y.tab.c
 	    fi
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
+	    if [ -f "$SRCFILE" ]; then
 	         cp "$SRCFILE" y.tab.h
 	    fi
 	  ;;
 	esac
     fi
-    if test ! -f y.tab.h; then
+    if [ ! -f y.tab.h ]; then
 	echo >y.tab.h
     fi
-    if test ! -f y.tab.c; then
+    if [ ! -f y.tab.c ]; then
 	echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
@@ -247,18 +244,18 @@ WARNING: \`$1' is $msg.  You should only need it if
          in order for those modifications to take effect.  You can get
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
-    if test $# -ne 1; then
+    if [ $# -ne 1 ]; then
         eval LASTARG="\${$#}"
-	case $LASTARG in
+	case "$LASTARG" in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
+	    if [ -f "$SRCFILE" ]; then
 	         cp "$SRCFILE" lex.yy.c
 	    fi
 	  ;;
 	esac
     fi
-    if test ! -f lex.yy.c; then
+    if [ ! -f lex.yy.c ]; then
 	echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
@@ -270,9 +267,11 @@ WARNING: \`$1' is $msg.  You should only need it if
 	 \`Help2man' package in order for those modifications to take
 	 effect.  You can get \`Help2man' from any GNU archive site."
 
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
 	touch $file
     else
 	test -z "$file" || exec >$file
@@ -290,17 +289,11 @@ WARNING: \`$1' is $msg.  You should only need it if
          DU, IRIX).  You might want to install the \`Texinfo' package or
          the \`GNU make' package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
     if test -z "$file"; then
       # ... or it is the one specified with @setfilename ...
       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
       # ... or it is derived from the source name (dir/f.texi becomes f.info)
       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
@@ -324,13 +317,13 @@ WARNING: \`$1' is $msg.  You should only need it if
     fi
     firstarg="$1"
     if shift; then
-	case $firstarg in
+	case "$firstarg" in
 	*o*)
 	    firstarg=`echo "$firstarg" | sed s/o//`
 	    tar "$firstarg" "$@" && exit 0
 	    ;;
 	esac
-	case $firstarg in
+	case "$firstarg" in
 	*h*)
 	    firstarg=`echo "$firstarg" | sed s/h//`
 	    tar "$firstarg" "$@" && exit 0
diff --git a/configure b/configure
index e18ae18..ed78e7a 100755
--- a/configure
+++ b/configure
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for infiniband-diags 1.4.4_20090314.
+# Generated by GNU Autoconf 2.63 for infiniband-diags 1.6.1.
 #
-# Report bugs to <general at lists.openfabrics.org>.
+# Report bugs to <linux-rdma at vger.kernel.org>.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -745,9 +745,9 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='infiniband-diags'
 PACKAGE_TARNAME='infiniband-diags'
-PACKAGE_VERSION='1.4.4_20090314'
-PACKAGE_STRING='infiniband-diags 1.4.4_20090314'
-PACKAGE_BUGREPORT='general at lists.openfabrics.org'
+PACKAGE_VERSION='1.6.1'
+PACKAGE_STRING='infiniband-diags 1.6.1'
+PACKAGE_BUGREPORT='linux-rdma at vger.kernel.org'
 
 # Factoring default headers for most tests.
 ac_includes_default="\
@@ -785,14 +785,22 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+have_rst2man
+BUILD_DATE
+ibnetdisc_api_version
 IBSCRIPTPATH
 HAVE_LD_VERSION_SCRIPT_FALSE
 HAVE_LD_VERSION_SCRIPT_TRUE
 PERL_INSTALLDIR
 PERL
+ENABLE_COMPAT_UTILS_FALSE
+ENABLE_COMPAT_UTILS_TRUE
 ENABLE_TEST_UTILS_FALSE
 ENABLE_TEST_UTILS_TRUE
+IBDIAG_CONFIG_PATH
 LIBOBJS
 CPP
 OTOOL64
@@ -905,7 +913,6 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_libcheck
 enable_debug
 enable_dependency_tracking
 enable_shared
@@ -915,8 +922,10 @@ enable_fast_install
 with_gnu_ld
 enable_libtool_lock
 enable_test_utils
+enable_compat_utils
 with_perl_path
 with_perl_installdir
+with_ibpath_override
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1479,7 +1488,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures infiniband-diags 1.4.4_20090314 to adapt to many kinds of systems.
+\`configure' configures infiniband-diags 1.6.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1550,7 +1559,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of infiniband-diags 1.4.4_20090314:";;
+     short | recursive ) echo "Configuration of infiniband-diags 1.6.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1558,7 +1567,6 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-libcheck      do not test for presence of ib libraries
   --enable-debug Turn on debug mode
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
@@ -1567,7 +1575,8 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
-  --enable-test-utils build additional test utilities
+  --enable-test-utils build additional test utilities (default=no)
+  --enable-compat-utils build deprecated compatibility utilities (default=no)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1578,6 +1587,7 @@ Optional Packages:
   --with-perl-path=path   define perl location
   --with-perl-installdir=path
                           define perl install path
+  --with-ibpath_override=<path> define ib binaries path
 
 Some influential environment variables:
   CC          C compiler command
@@ -1592,7 +1602,7 @@ Some influential environment variables:
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
-Report bugs to <general at lists.openfabrics.org>.
+Report bugs to <linux-rdma at vger.kernel.org>.
 _ACEOF
 ac_status=$?
 fi
@@ -1655,7 +1665,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-infiniband-diags configure 1.4.4_20090314
+infiniband-diags configure 1.6.1
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1669,7 +1679,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by infiniband-diags $as_me 1.4.4_20090314, which was
+It was created by infiniband-diags $as_me 1.6.1, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2068,9 +2078,10 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
+
 ac_config_headers="$ac_config_headers config.h"
 
-am__api_version='1.10'
+am__api_version='1.11'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2170,16 +2181,33 @@ $as_echo_n "checking whether build environment is sane... " >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$*" != "X $srcdir/configure conftest.file" \
@@ -2223,7 +2251,14 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -2233,6 +2268,115 @@ else
 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
 { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
@@ -2387,7 +2531,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='infiniband-diags'
- VERSION='1.4.4_20090314'
+ VERSION='1.6.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2415,108 +2559,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 # Always define AMTAR for backward compatibility.
@@ -2535,15 +2577,6 @@ RELEASE=${RELEASE:-unknown}
 TARBALL=${TARBALL:-${PACKAGE}-${VERSION}.tar.gz}
 
 
-# Check whether --enable-libcheck was given.
-if test "${enable_libcheck+set}" = set; then
-  enableval=$enable_libcheck;        if test x$enableval = xno ; then
-                disable_libcheck=yes
-        fi
-
-fi
-
-
 # Check whether --enable-debug was given.
 if test "${enable_debug+set}" = set; then
   enableval=$enable_debug; case "${enableval}" in
@@ -3506,7 +3539,7 @@ ac_config_commands="$ac_config_commands depfiles"
 am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -3517,24 +3550,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 
 
@@ -3591,6 +3624,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -3608,7 +3646,17 @@ else
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -3618,19 +3666,23 @@ else
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -3677,8 +3729,8 @@ esac
 
 
 
-macro_version='2.2.6'
-macro_revision='1.3012'
+macro_version='2.2.6b'
+macro_revision='1.3017'
 
 
 
@@ -4371,13 +4423,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4374: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4426: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4377: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4429: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4380: output\"" >&5)
+  (eval echo "\"\$as_me:4432: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -5583,7 +5635,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5586 "configure"' > conftest.$ac_ext
+  echo '#line 5638 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7411,6 +7463,10 @@ _lt_linker_boilerplate=`cat conftest.err`
 $RM -r conftest*
 
 
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
 if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
@@ -7436,11 +7492,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7439: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7495: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7443: \$? = $ac_status" >&5
+   echo "$as_me:7499: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7775,11 +7831,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7778: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7834: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7782: \$? = $ac_status" >&5
+   echo "$as_me:7838: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7880,11 +7936,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7883: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7939: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7887: \$? = $ac_status" >&5
+   echo "$as_me:7943: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -7935,11 +7991,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7938: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7994: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7942: \$? = $ac_status" >&5
+   echo "$as_me:7998: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9571,14 +9627,7 @@ freebsd* | dragonfly*)
     *) objformat=elf ;;
     esac
   fi
-  # Handle Gentoo/FreeBSD as it was Linux
-  case $host_vendor in
-    gentoo)
-      version_type=linux ;;
-    *)
-      version_type=freebsd-$objformat ;;
-  esac
-
+  version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
@@ -9589,12 +9638,6 @@ freebsd* | dragonfly*)
       library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
       need_version=yes
       ;;
-    linux)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-      soname_spec='${libname}${release}${shared_ext}$major'
-      need_lib_prefix=no
-      need_version=no
-      ;;
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
@@ -9800,10 +9843,13 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
   # before this can be enabled.
   hardcode_into_libs=yes
 
+  # Add ABI-specific directories to the system library path.
+  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
+
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -10748,7 +10794,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10751 "configure"
+#line 10797 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10844,7 +10890,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10847 "configure"
+#line 10893 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11072,16 +11118,14 @@ CC="$lt_save_CC"
 
 
 
-if test "$disable_libcheck" != "yes"
-then
 
-{ $as_echo "$as_me:$LINENO: checking for sys_read_string in -libcommon" >&5
-$as_echo_n "checking for sys_read_string in -libcommon... " >&6; }
-if test "${ac_cv_lib_ibcommon_sys_read_string+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for umad_init in -libumad" >&5
+$as_echo_n "checking for umad_init in -libumad... " >&6; }
+if test "${ac_cv_lib_ibumad_umad_init+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-libcommon  $LIBS"
+LIBS="-libumad  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11095,11 +11139,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char sys_read_string ();
+char umad_init ();
 int
 main ()
 {
-return sys_read_string ();
+return umad_init ();
   ;
   return 0;
 }
@@ -11125,91 +11169,12 @@ $as_echo "$ac_try_echo") >&5
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_ibcommon_sys_read_string=yes
+  ac_cv_lib_ibumad_umad_init=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_ibcommon_sys_read_string=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ibcommon_sys_read_string" >&5
-$as_echo "$ac_cv_lib_ibcommon_sys_read_string" >&6; }
-if test "x$ac_cv_lib_ibcommon_sys_read_string" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBIBCOMMON 1
-_ACEOF
-
-  LIBS="-libcommon $LIBS"
-
-else
-  { { $as_echo "$as_me:$LINENO: error: sys_read_string() not found. diags require libibcommon." >&5
-$as_echo "$as_me: error: sys_read_string() not found. diags require libibcommon." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking for umad_init in -libumad" >&5
-$as_echo_n "checking for umad_init in -libumad... " >&6; }
-if test "${ac_cv_lib_ibumad_umad_init+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-libumad  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char umad_init ();
-int
-main ()
-{
-return umad_init ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_ibumad_umad_init=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_ibumad_umad_init=no
+	ac_cv_lib_ibumad_umad_init=no
 fi
 
 rm -rf conftest.dSYM
@@ -11233,9 +11198,9 @@ $as_echo "$as_me: error: umad_init() not found. diags require libibumad." >&2;}
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for mad_dump_int in -libmad" >&5
-$as_echo_n "checking for mad_dump_int in -libmad... " >&6; }
-if test "${ac_cv_lib_ibmad_mad_dump_int+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for mad_dump_mlnx_ext_port_info in -libmad" >&5
+$as_echo_n "checking for mad_dump_mlnx_ext_port_info in -libmad... " >&6; }
+if test "${ac_cv_lib_ibmad_mad_dump_mlnx_ext_port_info+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11253,11 +11218,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char mad_dump_int ();
+char mad_dump_mlnx_ext_port_info ();
 int
 main ()
 {
-return mad_dump_int ();
+return mad_dump_mlnx_ext_port_info ();
   ;
   return 0;
 }
@@ -11283,12 +11248,12 @@ $as_echo "$ac_try_echo") >&5
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_ibmad_mad_dump_int=yes
+  ac_cv_lib_ibmad_mad_dump_mlnx_ext_port_info=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_ibmad_mad_dump_int=no
+	ac_cv_lib_ibmad_mad_dump_mlnx_ext_port_info=no
 fi
 
 rm -rf conftest.dSYM
@@ -11296,9 +11261,9 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ibmad_mad_dump_int" >&5
-$as_echo "$ac_cv_lib_ibmad_mad_dump_int" >&6; }
-if test "x$ac_cv_lib_ibmad_mad_dump_int" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ibmad_mad_dump_mlnx_ext_port_info" >&5
+$as_echo "$ac_cv_lib_ibmad_mad_dump_mlnx_ext_port_info" >&6; }
+if test "x$ac_cv_lib_ibmad_mad_dump_mlnx_ext_port_info" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBIBMAD 1
 _ACEOF
@@ -11306,15 +11271,17 @@ _ACEOF
   LIBS="-libmad $LIBS"
 
 else
-  { { $as_echo "$as_me:$LINENO: error: mad_dump_int() not found. diags require libibmad." >&5
-$as_echo "$as_me: error: mad_dump_int() not found. diags require libibmad." >&2;}
+  { { $as_echo "$as_me:$LINENO: error: mad_dump_mlnx_ext_port_info() not found.
+	diags require libibmad with mad_dump_mlnx_ext_port_info support." >&5
+$as_echo "$as_me: error: mad_dump_mlnx_ext_port_info() not found.
+	diags require libibmad with mad_dump_mlnx_ext_port_info support." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for port_performance_ext_query in -libmad" >&5
-$as_echo_n "checking for port_performance_ext_query in -libmad... " >&6; }
-if test "${ac_cv_lib_ibmad_port_performance_ext_query+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for mad_dump_classportinfo in -libmad" >&5
+$as_echo_n "checking for mad_dump_classportinfo in -libmad... " >&6; }
+if test "${ac_cv_lib_ibmad_mad_dump_classportinfo+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11332,11 +11299,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char port_performance_ext_query ();
+char mad_dump_classportinfo ();
 int
 main ()
 {
-return port_performance_ext_query ();
+return mad_dump_classportinfo ();
   ;
   return 0;
 }
@@ -11362,12 +11329,12 @@ $as_echo "$ac_try_echo") >&5
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_ibmad_port_performance_ext_query=yes
+  ac_cv_lib_ibmad_mad_dump_classportinfo=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_ibmad_port_performance_ext_query=no
+	ac_cv_lib_ibmad_mad_dump_classportinfo=no
 fi
 
 rm -rf conftest.dSYM
@@ -11375,9 +11342,9 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ibmad_port_performance_ext_query" >&5
-$as_echo "$ac_cv_lib_ibmad_port_performance_ext_query" >&6; }
-if test "x$ac_cv_lib_ibmad_port_performance_ext_query" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ibmad_mad_dump_classportinfo" >&5
+$as_echo "$ac_cv_lib_ibmad_mad_dump_classportinfo" >&6; }
+if test "x$ac_cv_lib_ibmad_mad_dump_classportinfo" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBIBMAD 1
 _ACEOF
@@ -11385,50 +11352,43 @@ _ACEOF
   LIBS="-libmad $LIBS"
 
 else
-  { { $as_echo "$as_me:$LINENO: error: port_performance_ext_query() not found. diags require more recent libibmad." >&5
-$as_echo "$as_me: error: port_performance_ext_query() not found. diags require more recent libibmad." >&2;}
+  { { $as_echo "$as_me:$LINENO: error: mad_dump_classportinfo() not found. diags requires a more recent libibmad." >&5
+$as_echo "$as_me: error: mad_dump_classportinfo() not found. diags requires a more recent libibmad." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for cl_thread_init in -losmcomp" >&5
-$as_echo_n "checking for cl_thread_init in -losmcomp... " >&6; }
-if test "${ac_cv_lib_osmcomp_cl_thread_init+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for struct umad_port.link_layer" >&5
+$as_echo_n "checking for struct umad_port.link_layer... " >&6; }
+if test "${ac_cv_member_struct_umad_port_link_layer+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-losmcomp  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <infiniband/umad.h>
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cl_thread_init ();
 int
 main ()
 {
-return cl_thread_init ();
+static struct umad_port ac_aggr;
+if (ac_aggr.link_layer)
+return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -11437,77 +11397,39 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_osmcomp_cl_thread_init=yes
+       } && test -s conftest.$ac_objext; then
+  ac_cv_member_struct_umad_port_link_layer=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_osmcomp_cl_thread_init=no
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_osmcomp_cl_thread_init" >&5
-$as_echo "$ac_cv_lib_osmcomp_cl_thread_init" >&6; }
-if test "x$ac_cv_lib_osmcomp_cl_thread_init" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBOSMCOMP 1
-_ACEOF
-
-  LIBS="-losmcomp $LIBS"
-
-else
-  { { $as_echo "$as_me:$LINENO: error: cl_thread_init() not found. diags require libosmcomp." >&5
-$as_echo "$as_me: error: cl_thread_init() not found. diags require libosmcomp." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking for osmv_query_sa in -losmvendor" >&5
-$as_echo_n "checking for osmv_query_sa in -losmvendor... " >&6; }
-if test "${ac_cv_lib_osmvendor_osmv_query_sa+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-losmvendor -lopensm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <infiniband/umad.h>
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char osmv_query_sa ();
 int
 main ()
 {
-return osmv_query_sa ();
+static struct umad_port ac_aggr;
+if (sizeof ac_aggr.link_layer)
+return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -11516,46 +11438,43 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_osmvendor_osmv_query_sa=yes
+       } && test -s conftest.$ac_objext; then
+  ac_cv_member_struct_umad_port_link_layer=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_osmvendor_osmv_query_sa=no
+	ac_cv_member_struct_umad_port_link_layer=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_osmvendor_osmv_query_sa" >&5
-$as_echo "$ac_cv_lib_osmvendor_osmv_query_sa" >&6; }
-if test "x$ac_cv_lib_osmvendor_osmv_query_sa" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBOSMVENDOR 1
-_ACEOF
-
-  LIBS="-losmvendor $LIBS"
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_umad_port_link_layer" >&5
+$as_echo "$ac_cv_member_struct_umad_port_link_layer" >&6; }
+if test "x$ac_cv_member_struct_umad_port_link_layer" = x""yes; then
+  ac_have_umad_port_link_layer=yes
 else
-  { { $as_echo "$as_me:$LINENO: error: osmv_query_sa() not found. diags require libosmvendor." >&5
-$as_echo "$as_me: error: osmv_query_sa() not found. diags require libosmvendor." >&2;}
-   { (exit 1); exit 1; }; }
+  ac_have_umad_port_link_layer=no
 fi
 
+if test "$ac_have_umad_port_link_layer" = "yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UMAD_PORT_LINK_LAYER 1
+_ACEOF
+
+fi
 
-{ $as_echo "$as_me:$LINENO: checking for osm_log_init_v2 in -lopensm" >&5
-$as_echo_n "checking for osm_log_init_v2 in -lopensm... " >&6; }
-if test "${ac_cv_lib_opensm_osm_log_init_v2+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for cl_qmap_insert in -losmcomp" >&5
+$as_echo_n "checking for cl_qmap_insert in -losmcomp... " >&6; }
+if test "${ac_cv_lib_osmcomp_cl_qmap_insert+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lopensm  $LIBS"
+LIBS="-losmcomp  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11569,11 +11488,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char osm_log_init_v2 ();
+char cl_qmap_insert ();
 int
 main ()
 {
-return osm_log_init_v2 ();
+return cl_qmap_insert ();
   ;
   return 0;
 }
@@ -11599,12 +11518,12 @@ $as_echo "$ac_try_echo") >&5
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_opensm_osm_log_init_v2=yes
+  ac_cv_lib_osmcomp_cl_qmap_insert=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_opensm_osm_log_init_v2=no
+	ac_cv_lib_osmcomp_cl_qmap_insert=no
 fi
 
 rm -rf conftest.dSYM
@@ -11612,22 +11531,21 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_opensm_osm_log_init_v2" >&5
-$as_echo "$ac_cv_lib_opensm_osm_log_init_v2" >&6; }
-if test "x$ac_cv_lib_opensm_osm_log_init_v2" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_osmcomp_cl_qmap_insert" >&5
+$as_echo "$ac_cv_lib_osmcomp_cl_qmap_insert" >&6; }
+if test "x$ac_cv_lib_osmcomp_cl_qmap_insert" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBOPENSM 1
+#define HAVE_LIBOSMCOMP 1
 _ACEOF
 
-  LIBS="-lopensm $LIBS"
+  LIBS="-losmcomp $LIBS"
 
 else
-  { { $as_echo "$as_me:$LINENO: error: osm_log_init_v2() not found. diags require libopensm." >&5
-$as_echo "$as_me: error: osm_log_init_v2() not found. diags require libopensm." >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cl_qmap_insert() not found. diags require libosmcomp." >&5
+$as_echo "$as_me: error: cl_qmap_insert() not found. diags require libosmcomp." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-fi
 
 { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
@@ -11814,8 +11732,7 @@ fi
 
 
 
-
-for ac_header in stdlib.h string.h unistd.h fcntl.h inttypes.h netinet/in.h sys/ioctl.h syslog.h
+for ac_header in stdlib.h string.h unistd.h fcntl.h inttypes.h netinet/in.h sys/ioctl.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -11934,9 +11851,9 @@ $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result
     { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
-## -------------------------------------------- ##
-## Report this to general at lists.openfabrics.org ##
-## -------------------------------------------- ##
+## ----------------------------------------- ##
+## Report this to linux-rdma at vger.kernel.org ##
+## ----------------------------------------- ##
 _ASBOX
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
@@ -11965,150 +11882,6 @@ fi
 
 done
 
-if test "$disable_libcheck" != "yes"
-then
-if test "${ac_cv_header_infiniband_common_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for infiniband/common.h" >&5
-$as_echo_n "checking for infiniband/common.h... " >&6; }
-if test "${ac_cv_header_infiniband_common_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_infiniband_common_h" >&5
-$as_echo "$ac_cv_header_infiniband_common_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking infiniband/common.h usability" >&5
-$as_echo_n "checking infiniband/common.h usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <infiniband/common.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking infiniband/common.h presence" >&5
-$as_echo_n "checking infiniband/common.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <infiniband/common.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: infiniband/common.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: infiniband/common.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## -------------------------------------------- ##
-## Report this to general at lists.openfabrics.org ##
-## -------------------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for infiniband/common.h" >&5
-$as_echo_n "checking for infiniband/common.h... " >&6; }
-if test "${ac_cv_header_infiniband_common_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_infiniband_common_h=$ac_header_preproc
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_infiniband_common_h" >&5
-$as_echo "$ac_cv_header_infiniband_common_h" >&6; }
-
-fi
-if test "x$ac_cv_header_infiniband_common_h" = x""yes; then
-  :
-else
-  { { $as_echo "$as_me:$LINENO: error: <infiniband/common.h> not found. diags require libibcommon." >&5
-$as_echo "$as_me: error: <infiniband/common.h> not found. diags require libibcommon." >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-
-
 if test "${ac_cv_header_infiniband_umad_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for infiniband/umad.h" >&5
 $as_echo_n "checking for infiniband/umad.h... " >&6; }
@@ -12223,9 +11996,9 @@ $as_echo "$as_me: WARNING: infiniband/umad.h: proceeding with the preprocessor's
     { $as_echo "$as_me:$LINENO: WARNING: infiniband/umad.h: in the future, the compiler will take precedence" >&5
 $as_echo "$as_me: WARNING: infiniband/umad.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
-## -------------------------------------------- ##
-## Report this to general at lists.openfabrics.org ##
-## -------------------------------------------- ##
+## ----------------------------------------- ##
+## Report this to linux-rdma at vger.kernel.org ##
+## ----------------------------------------- ##
 _ASBOX
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
@@ -12365,9 +12138,9 @@ $as_echo "$as_me: WARNING: infiniband/mad.h: proceeding with the preprocessor's
     { $as_echo "$as_me:$LINENO: WARNING: infiniband/mad.h: in the future, the compiler will take precedence" >&5
 $as_echo "$as_me: WARNING: infiniband/mad.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
-## -------------------------------------------- ##
-## Report this to general at lists.openfabrics.org ##
-## -------------------------------------------- ##
+## ----------------------------------------- ##
+## Report this to linux-rdma at vger.kernel.org ##
+## ----------------------------------------- ##
 _ASBOX
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
@@ -12393,7 +12166,6 @@ $as_echo "$as_me: error: <infiniband/mad.h> not found. diags require libibmad."
 fi
 
 
-fi
 
 { $as_echo "$as_me:$LINENO: checking for error_at_line" >&5
 $as_echo_n "checking for error_at_line... " >&6; }
@@ -12659,7 +12431,8 @@ done
 
 
 
-for ac_func in strchr strrchr strtol strtoul memset
+
+for ac_func in strchr strrchr strtol strtoul memset strtoull
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -12868,6 +12641,16 @@ _ACEOF
 fi
 
 
+IBDIAG_CONFIG_PATH_TMP1="`eval echo ${sysconfdir}`"
+IBDIAG_CONFIG_PATH_TMP2="`echo $IBDIAG_CONFIG_PATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
+IBDIAG_CONFIG_PATH="`eval echo $IBDIAG_CONFIG_PATH_TMP2`/infiniband-diags"
+
+
+cat >>confdefs.h <<_ACEOF
+#define IBDIAG_CONFIG_PATH "$IBDIAG_CONFIG_PATH"
+_ACEOF
+
+
 { $as_echo "$as_me:$LINENO: checking for --enable-test-utils" >&5
 $as_echo_n "checking for --enable-test-utils... " >&6; }
 # Check whether --enable-test-utils was given.
@@ -12894,6 +12677,32 @@ fi
 { $as_echo "$as_me:$LINENO: result: ${tutils=no}" >&5
 $as_echo "${tutils=no}" >&6; }
 
+{ $as_echo "$as_me:$LINENO: checking for --enable-compat-utils" >&5
+$as_echo_n "checking for --enable-compat-utils... " >&6; }
+# Check whether --enable-compat-utils was given.
+if test "${enable_compat_utils+set}" = set; then
+  enableval=$enable_compat_utils; case "${enableval}" in
+  yes) cutils=yes ;;
+  no)  cutils=no ;;
+  *) { { $as_echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-compat-utils" >&5
+$as_echo "$as_me: error: bad value ${enableval} for --enable-compat-utils" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  cutils=no
+fi
+
+ if test x$cutils = xyes; then
+  ENABLE_COMPAT_UTILS_TRUE=
+  ENABLE_COMPAT_UTILS_FALSE='#'
+else
+  ENABLE_COMPAT_UTILS_TRUE='#'
+  ENABLE_COMPAT_UTILS_FALSE=
+fi
+
+{ $as_echo "$as_me:$LINENO: result: ${cutils=no}" >&5
+$as_echo "${cutils=no}" >&6; }
+
 { $as_echo "$as_me:$LINENO: checking for --with-perl-path " >&5
 $as_echo_n "checking for --with-perl-path ... " >&6; }
 
@@ -12981,7 +12790,7 @@ $as_echo "${withperlinstalldir=no}" >&6; }
 
 if test $withperlinstalldir = "no"
 then
-    PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installsitearch}; print $T;'`
+    PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installvendorlib}; print $T;'`
 fi
 
 
@@ -13008,12 +12817,79 @@ else
 fi
 
 
+
+# Check whether --with-ibpath_override was given.
+if test "${with_ibpath_override+set}" = set; then
+  withval=$with_ibpath_override; { $as_echo "$as_me:$LINENO: Using IBPATH : $with_ibpath_override" >&5
+$as_echo "$as_me: Using IBPATH : $with_ibpath_override" >&6;}
+else
+  with_ibpath_override=
+fi
+
+
 IBSCRIPTPATH_TMP1="`eval echo ${sbindir}`"
 IBSCRIPTPATH_TMP2="`echo $IBSCRIPTPATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
-IBSCRIPTPATH="`eval echo $IBSCRIPTPATH_TMP2`"
+IBSCRIPTPATH="${with_ibpath_override:-`eval echo $IBSCRIPTPATH_TMP2`}"
+
+
+ibnetdisc_api_version=`grep LIBVERSION $srcdir/libibnetdisc/libibnetdisc.ver | sed 's/LIBVERSION=//'`
+if test -z $ibnetdisc_api_version; then
+   echo "FAILED to find $srcdir/libibnetdisc/libibnetdisc.ver"
+   exit 1
+fi
+
+
+DOC_DATE="`date +%Y-%m-%d`"
+
+# Extract the first word of "rst2man", so it can be a program name with args.
+set dummy rst2man; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_have_rst2man+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$have_rst2man"; then
+  ac_cv_prog_have_rst2man="$have_rst2man" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_have_rst2man=""yes""
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+fi
+fi
+have_rst2man=$ac_cv_prog_have_rst2man
+if test -n "$have_rst2man"; then
+  { $as_echo "$as_me:$LINENO: result: $have_rst2man" >&5
+$as_echo "$have_rst2man" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x$have_rst2man == xyes; then
+	doc/generate
+else
+	if test -f doc/man/infiniband-diags.8.in; then
+		echo "WARNING: 'rst2man' not found; using premade man pages"
+	else
+		echo "FAILED to find 'rst2man' required to build man pages"
+		exit 1
+	fi
+fi
 
-ac_config_files="$ac_config_files Makefile infiniband-diags.spec include/ibdiag_version.h scripts/ibcheckerrors scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode scripts/ibcheckport scripts/ibcheckportstate scripts/ibcheckportwidth scripts/ibcheckstate scripts/ibcheckwidth scripts/ibclearcounters scripts/ibclearerrors scripts/ibdatacounts scripts/ibdatacounters scripts/ibhosts scripts/ibnodes scripts/ibswitches scripts/ibrouters"
+ac_config_files="$ac_config_files Makefile infiniband-diags.spec include/ibdiag_version.h scripts/ibcheckerrors scripts/ibcheckerrs scripts/ibchecknet scripts/ibchecknode scripts/ibcheckport scripts/ibcheckportstate scripts/ibcheckportwidth scripts/ibcheckstate scripts/ibcheckwidth scripts/ibclearcounters scripts/ibclearerrors scripts/ibdatacounts scripts/ibdatacounters scripts/ibhosts scripts/ibnodes scripts/ibswitches scripts/ibrouters scripts/iblinkinfo.pl scripts/ibqueryerrors.pl doc [...]
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -13112,6 +12988,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
 if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"DEBUG\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -13140,6 +13024,13 @@ $as_echo "$as_me: error: conditional \"ENABLE_TEST_UTILS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${ENABLE_COMPAT_UTILS_TRUE}" && test -z "${ENABLE_COMPAT_UTILS_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_COMPAT_UTILS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"ENABLE_COMPAT_UTILS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -13469,7 +13360,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by infiniband-diags $as_me 1.4.4_20090314, which was
+This file was extended by infiniband-diags $as_me 1.6.1, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -13532,7 +13423,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-infiniband-diags config.status 1.4.4_20090314
+infiniband-diags config.status 1.6.1
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -13933,6 +13824,39 @@ do
     "scripts/ibnodes") CONFIG_FILES="$CONFIG_FILES scripts/ibnodes" ;;
     "scripts/ibswitches") CONFIG_FILES="$CONFIG_FILES scripts/ibswitches" ;;
     "scripts/ibrouters") CONFIG_FILES="$CONFIG_FILES scripts/ibrouters" ;;
+    "scripts/iblinkinfo.pl") CONFIG_FILES="$CONFIG_FILES scripts/iblinkinfo.pl" ;;
+    "scripts/ibqueryerrors.pl") CONFIG_FILES="$CONFIG_FILES scripts/ibqueryerrors.pl" ;;
+    "doc/man/ibaddr.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibaddr.8" ;;
+    "doc/man/check_lft_balance.8") CONFIG_FILES="$CONFIG_FILES doc/man/check_lft_balance.8" ;;
+    "doc/man/ibcacheedit.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibcacheedit.8" ;;
+    "doc/man/ibccconfig.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibccconfig.8" ;;
+    "doc/man/ibccquery.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibccquery.8" ;;
+    "doc/man/dump_lfts.8") CONFIG_FILES="$CONFIG_FILES doc/man/dump_lfts.8" ;;
+    "doc/man/dump_mfts.8") CONFIG_FILES="$CONFIG_FILES doc/man/dump_mfts.8" ;;
+    "doc/man/ibhosts.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibhosts.8" ;;
+    "doc/man/ibidsverify.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibidsverify.8" ;;
+    "doc/man/iblinkinfo.8") CONFIG_FILES="$CONFIG_FILES doc/man/iblinkinfo.8" ;;
+    "doc/man/ibfindnodesusing.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibfindnodesusing.8" ;;
+    "doc/man/ibnetdiscover.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibnetdiscover.8" ;;
+    "doc/man/ibnodes.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibnodes.8" ;;
+    "doc/man/ibping.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibping.8" ;;
+    "doc/man/ibportstate.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibportstate.8" ;;
+    "doc/man/ibqueryerrors.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibqueryerrors.8" ;;
+    "doc/man/ibroute.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibroute.8" ;;
+    "doc/man/ibrouters.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibrouters.8" ;;
+    "doc/man/ibstat.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibstat.8" ;;
+    "doc/man/ibstatus.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibstatus.8" ;;
+    "doc/man/ibswitches.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibswitches.8" ;;
+    "doc/man/ibsysstat.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibsysstat.8" ;;
+    "doc/man/ibtracert.8") CONFIG_FILES="$CONFIG_FILES doc/man/ibtracert.8" ;;
+    "doc/man/perfquery.8") CONFIG_FILES="$CONFIG_FILES doc/man/perfquery.8" ;;
+    "doc/man/saquery.8") CONFIG_FILES="$CONFIG_FILES doc/man/saquery.8" ;;
+    "doc/man/sminfo.8") CONFIG_FILES="$CONFIG_FILES doc/man/sminfo.8" ;;
+    "doc/man/smpdump.8") CONFIG_FILES="$CONFIG_FILES doc/man/smpdump.8" ;;
+    "doc/man/smpquery.8") CONFIG_FILES="$CONFIG_FILES doc/man/smpquery.8" ;;
+    "doc/man/vendstat.8") CONFIG_FILES="$CONFIG_FILES doc/man/vendstat.8" ;;
+    "doc/man/infiniband-diags.8") CONFIG_FILES="$CONFIG_FILES doc/man/infiniband-diags.8" ;;
+    "libibnetdisc/Makefile") CONFIG_FILES="$CONFIG_FILES libibnetdisc/Makefile" ;;
 
   *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -14587,27 +14511,28 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`$as_dirname -- "$mf" ||
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
@@ -14630,28 +14555,28 @@ $as_echo X"$mf" |
 	    q
 	  }
 	  s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`$as_dirname -- "$file" ||
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
@@ -14674,7 +14599,7 @@ $as_echo X"$file" |
 	    q
 	  }
 	  s/.*/./; q'`
-    { as_dir=$dirpart/$fdir
+      { as_dir=$dirpart/$fdir
   case $as_dir in #(
   -*) as_dir=./$as_dir;;
   esac
@@ -14715,10 +14640,11 @@ $as_echo X"$as_dir" |
   } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
  ;;
     "libtool":C)
 
diff --git a/configure.in b/configure.in
index 011b3f2..61d7909 100644
--- a/configure.in
+++ b/configure.in
@@ -1,20 +1,15 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.57)
-AC_INIT(infiniband-diags, 1.4.4_20090314, general at lists.openfabrics.org)
+AC_INIT(infiniband-diags, 1.6.1, linux-rdma at vger.kernel.org)
 AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR(config)
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE
 
 AC_SUBST(RELEASE, ${RELEASE:-unknown})
 AC_SUBST(TARBALL, ${TARBALL:-${PACKAGE}-${VERSION}.tar.gz})
 
-AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of ib libraries],
-[       if test x$enableval = xno ; then
-                disable_libcheck=yes
-        fi
-])
-
 dnl support debug mode
 AC_ARG_ENABLE(debug,
 [  --enable-debug Turn on debug mode],
@@ -29,53 +24,53 @@ dnl Checks for programs
 AC_PROG_CC
 AC_PROG_LIBTOOL
 
-if test "$disable_libcheck" != "yes"
-then
 dnl Checks for libraries
-AC_CHECK_LIB(ibcommon, sys_read_string, [],
-	AC_MSG_ERROR([sys_read_string() not found. diags require libibcommon.]))
 AC_CHECK_LIB(ibumad, umad_init, [],
 	AC_MSG_ERROR([umad_init() not found. diags require libibumad.]))
-AC_CHECK_LIB(ibmad, mad_dump_int, [],
-	AC_MSG_ERROR([mad_dump_int() not found. diags require libibmad.]))
-AC_CHECK_LIB(ibmad, port_performance_ext_query, [],
-	AC_MSG_ERROR([port_performance_ext_query() not found. diags require more recent libibmad.]))
-AC_CHECK_LIB(osmcomp, cl_thread_init, [],
-	AC_MSG_ERROR([cl_thread_init() not found. diags require libosmcomp.]))
-AC_CHECK_LIB(osmvendor, osmv_query_sa, [],
-	AC_MSG_ERROR([osmv_query_sa() not found. diags require libosmvendor.]), [-lopensm])
-AC_CHECK_LIB(opensm, osm_log_init_v2, [],
-	AC_MSG_ERROR([osm_log_init_v2() not found. diags require libopensm.]))
+AC_CHECK_LIB(ibmad, mad_dump_mlnx_ext_port_info, [],
+	AC_MSG_ERROR([mad_dump_mlnx_ext_port_info() not found.
+	diags require libibmad with mad_dump_mlnx_ext_port_info support.]))
+AC_CHECK_LIB(ibmad, mad_dump_classportinfo, [],
+	AC_MSG_ERROR([mad_dump_classportinfo() not found. diags requires a more recent libibmad.]))
+AC_CHECK_MEMBER([struct umad_port.link_layer],
+			[ac_have_umad_port_link_layer=yes],
+			[ac_have_umad_port_link_layer=no],
+			[#include <infiniband/umad.h>])
+if test "$ac_have_umad_port_link_layer" = "yes"; then
+   AC_DEFINE([HAVE_UMAD_PORT_LINK_LAYER], 1, [Define to 1 if struct umad_port has link_layer member])
 fi
+AC_CHECK_LIB(osmcomp, cl_qmap_insert, [],
+	AC_MSG_ERROR([cl_qmap_insert() not found. diags require libosmcomp.]))
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h string.h unistd.h fcntl.h inttypes.h netinet/in.h sys/ioctl.h syslog.h])
-if test "$disable_libcheck" != "yes"
-then
-AC_CHECK_HEADER(infiniband/common.h, [],
-	AC_MSG_ERROR([<infiniband/common.h> not found. diags require libibcommon.])
-)
+AC_CHECK_HEADERS([stdlib.h string.h unistd.h fcntl.h inttypes.h netinet/in.h sys/ioctl.h])
 AC_CHECK_HEADER(infiniband/umad.h, [],
 	AC_MSG_ERROR([<infiniband/umad.h> not found. diags require libibumad.])
 )
 AC_CHECK_HEADER(infiniband/mad.h, [],
 	AC_MSG_ERROR([<infiniband/mad.h> not found. diags require libibmad.])
 )
-fi
 
 dnl Checks for library functions
 AC_FUNC_ERROR_AT_LINE
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([strchr strrchr strtol strtoul memset])
+AC_CHECK_FUNCS([strchr strrchr strtol strtoul memset strtoull])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
+dnl Define a configure directory
+IBDIAG_CONFIG_PATH_TMP1="`eval echo ${sysconfdir}`"
+IBDIAG_CONFIG_PATH_TMP2="`echo $IBDIAG_CONFIG_PATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
+IBDIAG_CONFIG_PATH="`eval echo $IBDIAG_CONFIG_PATH_TMP2`/infiniband-diags"
+AC_SUBST(IBDIAG_CONFIG_PATH)
+AC_DEFINE_UNQUOTED([IBDIAG_CONFIG_PATH], "$IBDIAG_CONFIG_PATH", [Define the path to configurations])
+
 dnl Check if we should include test utilities
 AC_MSG_CHECKING(for --enable-test-utils)
 AC_ARG_ENABLE(test-utils,
-[  --enable-test-utils build additional test utilities],
+[  --enable-test-utils build additional test utilities (default=no)],
 [case "${enableval}" in
   yes) tutils=yes ;;
   no)  tutils=no ;;
@@ -84,6 +79,18 @@ esac],[tutils=no])
 AM_CONDITIONAL(ENABLE_TEST_UTILS, test x$tutils = xyes)
 AC_MSG_RESULT(${tutils=no})
 
+dnl Check if we should include compat utils
+AC_MSG_CHECKING(for --enable-compat-utils)
+AC_ARG_ENABLE(compat-utils,
+[  --enable-compat-utils build deprecated compatibility utilities (default=no)],
+[case "${enableval}" in
+  yes) cutils=yes ;;
+  no)  cutils=no ;;
+  *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-utils) ;;
+esac],[cutils=no])
+AM_CONDITIONAL(ENABLE_COMPAT_UTILS, test x$cutils = xyes)
+AC_MSG_RESULT(${cutils=no})
+
 dnl Check for perl and perl install location
 AC_MSG_CHECKING(for --with-perl-path )
 AC_ARG_WITH(perl-path,
@@ -125,7 +132,7 @@ AC_SUBST(PERL_INSTALLDIR)
 
 if test $withperlinstalldir = "no"
 then
-    PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installsitearch}; print $T;'`
+    PERL_INSTALLDIR=`$PERL -e 'use Config; $T=$Config{installvendorlib}; print $T;'`
 fi
 AC_SUBST(PERL_INSTALLDIR)
 
@@ -138,33 +145,97 @@ AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
 
 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
 
+dnl Define override for IBPATH
+AC_ARG_WITH(ibpath_override,
+[  --with-ibpath_override=<path> define ib binaries path],
+AC_MSG_NOTICE(Using IBPATH : $with_ibpath_override),
+with_ibpath_override=)
+
 dnl Make appropriate substitution for IB script path
 dnl Must expand nested unquoting
 IBSCRIPTPATH_TMP1="`eval echo ${sbindir}`"
 IBSCRIPTPATH_TMP2="`echo $IBSCRIPTPATH_TMP1 | sed 's/^NONE/$ac_default_prefix/'`"
-IBSCRIPTPATH="`eval echo $IBSCRIPTPATH_TMP2`"
+IBSCRIPTPATH="${with_ibpath_override:-`eval echo $IBSCRIPTPATH_TMP2`}"
 AC_SUBST(IBSCRIPTPATH)
 
+dnl Begin libibnetdisc stuff
+ibnetdisc_api_version=`grep LIBVERSION $srcdir/libibnetdisc/libibnetdisc.ver | sed 's/LIBVERSION=//'`
+if test -z $ibnetdisc_api_version; then
+   echo "FAILED to find $srcdir/libibnetdisc/libibnetdisc.ver"
+   exit 1
+fi
+AC_SUBST(ibnetdisc_api_version)
+dnl End libibnetdisc stuff
+
+dnl Generate doc/man/*.in files if possible
+DOC_DATE="`date +%Y-%m-%d`"
+AC_SUBST(BUILD_DATE)
+AC_CHECK_PROG(have_rst2man, rst2man, "yes")
+if test x$have_rst2man == xyes; then
+	doc/generate
+else
+	if test -f doc/man/infiniband-diags.8.in; then
+		echo "WARNING: 'rst2man' not found; using premade man pages"
+	else
+		echo "FAILED to find 'rst2man' required to build man pages"
+		exit 1
+	fi
+fi
+dnl
+
 AC_CONFIG_FILES([\
-        Makefile \
-        infiniband-diags.spec \
-        include/ibdiag_version.h \
-        scripts/ibcheckerrors \
-        scripts/ibcheckerrs \
-        scripts/ibchecknet \
-        scripts/ibchecknode \
-        scripts/ibcheckport \
-        scripts/ibcheckportstate \
-        scripts/ibcheckportwidth \
-        scripts/ibcheckstate \
-        scripts/ibcheckwidth \
-        scripts/ibclearcounters \
-        scripts/ibclearerrors \
+	Makefile \
+	infiniband-diags.spec \
+	include/ibdiag_version.h \
+	scripts/ibcheckerrors \
+	scripts/ibcheckerrs \
+	scripts/ibchecknet \
+	scripts/ibchecknode \
+	scripts/ibcheckport \
+	scripts/ibcheckportstate \
+	scripts/ibcheckportwidth \
+	scripts/ibcheckstate \
+	scripts/ibcheckwidth \
+	scripts/ibclearcounters \
+	scripts/ibclearerrors \
 	scripts/ibdatacounts \
 	scripts/ibdatacounters \
-        scripts/ibhosts \
-        scripts/ibnodes \
-        scripts/ibswitches \
-	scripts/ibrouters
+	scripts/ibhosts \
+	scripts/ibnodes \
+	scripts/ibswitches \
+	scripts/ibrouters \
+	scripts/iblinkinfo.pl \
+	scripts/ibqueryerrors.pl \
+	doc/man/ibaddr.8 \
+	doc/man/check_lft_balance.8 \
+	doc/man/ibcacheedit.8 \
+	doc/man/ibccconfig.8 \
+	doc/man/ibccquery.8 \
+	doc/man/dump_lfts.8 \
+	doc/man/dump_mfts.8 \
+	doc/man/ibhosts.8 \
+	doc/man/ibidsverify.8 \
+	doc/man/iblinkinfo.8 \
+	doc/man/ibfindnodesusing.8 \
+	doc/man/ibnetdiscover.8 \
+	doc/man/ibnodes.8 \
+	doc/man/ibping.8 \
+	doc/man/ibportstate.8 \
+	doc/man/ibqueryerrors.8 \
+	doc/man/ibroute.8 \
+	doc/man/ibrouters.8 \
+	doc/man/ibstat.8 \
+	doc/man/ibstatus.8 \
+	doc/man/ibswitches.8 \
+	doc/man/ibsysstat.8 \
+	doc/man/ibtracert.8 \
+	doc/man/perfquery.8 \
+	doc/man/saquery.8 \
+	doc/man/sminfo.8 \
+	doc/man/smpdump.8 \
+	doc/man/smpquery.8 \
+	doc/man/vendstat.8 \
+	doc/man/infiniband-diags.8 \
+	libibnetdisc/Makefile \
 ])
 AC_OUTPUT
diff --git a/doc/README.rst b/doc/README.rst
new file mode 100644
index 0000000..5c74eda
--- /dev/null
+++ b/doc/README.rst
@@ -0,0 +1,105 @@
+infiniband-diags ReStructured Text documentation
+================================================
+
+Having documentation in ReStructured Text has the following benefits
+
+1) The addition of common functionality (options, config files, etc.) can be
+   documented once and then included in documents for multiple tools.
+
+   1a) Documentation source is more straight forward and writers can
+       concentrate on the features which are unique to each tool.
+
+2) Documentation can be generated into multiple formats (man, html) not just
+   man pages.
+
+3) Documentation for any individual tool is complete within that page.  (There
+   is no referencing of other documents and guessing which "common" options
+   apply.)
+
+
+Instructions
+------------
+
+Place main ``rst`` files in the rst directory.  ``common include`` rst files
+should be in rst/common.
+
+"git add" should _only_ be run on the rst source files themselves.
+
+The best way to update generated documentation after changes is to [re]run
+configure.  autoconf will run the ``generate`` script if rst2man is available
+on your system.  If rst2man is not available, tarball and source rpm
+distributions contain the doc/man/\*.in files and can be built from those files
+a users system without rst2man.  Of course they will not get any changes made
+to the rst files.  Therefore developers are required to have rst2man[*] installed.
+
+[*] rst2man is available in the python-docutils package.
+
+
+Common files
+------------
+
+Common documents should be placed in the rst/common directory.  Common files should not be put
+in the 'main' rst directory.   The automated conversion script will try and
+make documents out of them.
+
+There are 2 types of common files
+
+	1) common options
+
+               The common options are text which describes a common option.
+               The naming conventions is:
+
+                        opt_<option>.rst
+
+	2) common sections
+
+                A common section contains a section header and documents a more
+                advanced feature such as a config file.  The naming convention
+                for the common section is:
+
+                        sec_<section>.rst.
+
+
+Common documents should actually document features which are intended to be
+common across multiple tools.  Within the code these features are contained in
+ibdiag_common or a sub library such as ibnetdisc or an external library such as
+the node name map feature.
+
+
+Examples
+--------
+
+The "man" page text is:
+
+::
+        <text>
+
+        .. include:: common/opt_L.rst
+
+        <text>
+
+        .. include:: common/sec_config-file.rst
+
+
+The common option "L" is:
+
+::
+        .. Define the common option -L
+
+        **-L**   The address specified is a LID
+
+
+And the common Section is:
+
+::
+        .. Common text for the config file
+
+        CONFIG FILE
+        -----------
+
+        @IBDIAG_CONFIG_PATH@/ibdiag.conf
+
+        A global config file is provided to set some of the common options for all
+        tools.  See supplied config file for details.
+
+
diff --git a/doc/generate b/doc/generate
new file mode 100755
index 0000000..a91dd3d
--- /dev/null
+++ b/doc/generate
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+docdir=`dirname $0`
+mode=$1
+
+cd $docdir
+
+if [ "$mode" == "" ]; then
+	if [ ! -d man ]; then
+		mkdir man
+	fi
+	for file in rst/*.rst; do
+		file=`basename $file`
+		target=`echo $file | sed -e 's/\(.*\).rst/\1/'`
+		echo "   creating man/$target ..."
+		rst2man rst/$file > man/$target
+	done
+elif [ "$mode" == "clean" ]; then
+	rm -f man/*
+elif [ "$mode" == "-h" ] || [ "$mode" == "--help" ]; then
+	echo "./generate [clean]"
+	echo "   Generate the <file>.in 'man' files from rst documentation"
+	echo "   clean -- remove all files in 'man' and regenerate \"clean\""
+else
+	echo "ERROR: invalid option '$mode'"
+	exit 1
+fi
+
+exit 0
+
diff --git a/doc/man/check_lft_balance.8 b/doc/man/check_lft_balance.8
new file mode 100644
index 0000000..8e93a0b
--- /dev/null
+++ b/doc/man/check_lft_balance.8
@@ -0,0 +1,73 @@
+.\" Man page generated from reStructeredText.
+.
+.TH CHECK_LFT_BALANCE 8 "" "" "Open IB Diagnostics"
+.SH NAME
+CHECK_LFT_BALANCE \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH check InfiniBand unicast forwarding tables balance
+.SS SYNOPSIS
+.sp
+check_lft_balance.sh [\-hRv]
+.SS DESCRIPTION
+.sp
+check_lft_balance.sh is a script which checks for balancing in Infiniband
+unicast forwarding tables.  It analyzes the output of
+\fBdump_lfts(8)\fP and \fBiblinkinfo(8)\fP
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-h\fP
+.sp
+show help
+.TP
+.B \fB\-R\fP
+.sp
+Recalculate dump_lfts information, ie do not use the cached
+information.  This option is slower but should be used if the diag
+tools have not been used for some time or if there are other reasons to
+believe that the fabric has changed.
+.TP
+.B \fB\-v\fP
+.sp
+verbose output
+.UNINDENT
+.SS SEE ALSO
+.sp
+\fBdump_lfts(8)\fP
+\fBiblinkinfo(8)\fP
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/check_lft_balance.8.in b/doc/man/check_lft_balance.8.in
new file mode 100644
index 0000000..5bf8ff8
--- /dev/null
+++ b/doc/man/check_lft_balance.8.in
@@ -0,0 +1,73 @@
+.\" Man page generated from reStructeredText.
+.
+.TH CHECK_LFT_BALANCE 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+CHECK_LFT_BALANCE \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH check InfiniBand unicast forwarding tables balance
+.SS SYNOPSIS
+.sp
+check_lft_balance.sh [\-hRv]
+.SS DESCRIPTION
+.sp
+check_lft_balance.sh is a script which checks for balancing in Infiniband
+unicast forwarding tables.  It analyzes the output of
+\fBdump_lfts(8)\fP and \fBiblinkinfo(8)\fP
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-h\fP
+.sp
+show help
+.TP
+.B \fB\-R\fP
+.sp
+Recalculate dump_lfts information, ie do not use the cached
+information.  This option is slower but should be used if the diag
+tools have not been used for some time or if there are other reasons to
+believe that the fabric has changed.
+.TP
+.B \fB\-v\fP
+.sp
+verbose output
+.UNINDENT
+.SS SEE ALSO
+.sp
+\fBdump_lfts(8)\fP
+\fBiblinkinfo(8)\fP
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/dump_lfts.8 b/doc/man/dump_lfts.8
new file mode 100644
index 0000000..31ea0fc
--- /dev/null
+++ b/doc/man/dump_lfts.8
@@ -0,0 +1,177 @@
+.\" Man page generated from reStructeredText.
+.
+.TH DUMP_LFTS.SH 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+DUMP_LFTS.SH \- dump InfiniBand unicast forwarding tables
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+dump_lfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/dump\-file]
+.SH DESCRIPTION
+.sp
+dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
+tables (MFTs) in the switch nodes in the subnet.
+.sp
+The dump file format is compatible with loading into OpenSM using
+the \-R file \-U /path/to/dump\-file syntax.
+.SH OPTIONS
+.sp
+\fB\-D\fP
+dump forwarding tables using direct routed rather than LID routed SMPs
+.sp
+\fB\-h\fP
+show help
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+\fBdump_mfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
+.SH AUTHORS
+.INDENT 0.0
+.TP
+.B Sasha Khapyorsky
+.
+< \fI\%sashak at voltaire.com\fP >
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/dump_lfts.8.in b/doc/man/dump_lfts.8.in
new file mode 100644
index 0000000..a75a425
--- /dev/null
+++ b/doc/man/dump_lfts.8.in
@@ -0,0 +1,177 @@
+.\" Man page generated from reStructeredText.
+.
+.TH DUMP_LFTS.SH 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+DUMP_LFTS.SH \- dump InfiniBand unicast forwarding tables
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+dump_lfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/dump\-file]
+.SH DESCRIPTION
+.sp
+dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
+tables (MFTs) in the switch nodes in the subnet.
+.sp
+The dump file format is compatible with loading into OpenSM using
+the \-R file \-U /path/to/dump\-file syntax.
+.SH OPTIONS
+.sp
+\fB\-D\fP
+dump forwarding tables using direct routed rather than LID routed SMPs
+.sp
+\fB\-h\fP
+show help
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+\fBdump_mfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
+.SH AUTHORS
+.INDENT 0.0
+.TP
+.B Sasha Khapyorsky
+.
+< \fI\%sashak at voltaire.com\fP >
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/dump_mfts.8 b/doc/man/dump_mfts.8
new file mode 100644
index 0000000..c594043
--- /dev/null
+++ b/doc/man/dump_mfts.8
@@ -0,0 +1,170 @@
+.\" Man page generated from reStructeredText.
+.
+.TH DUMP_MFTS.SH 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+DUMP_MFTS.SH \- dump InfiniBand multicast forwarding tables
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+dump_mfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/file]
+.SH DESCRIPTION
+.sp
+dump_mfts.sh is a script which dumps the InfiniBand multicast
+forwarding tables (MFTs) in the switch nodes in the subnet.
+.SH OPTIONS
+.sp
+\fB\-D\fP
+dump forwarding tables using direct routed rather than LID routed SMPs
+.sp
+\fB\-h\fP
+show help
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+\fBdump_lfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/dump_mfts.8.in b/doc/man/dump_mfts.8.in
new file mode 100644
index 0000000..0e5f4b9
--- /dev/null
+++ b/doc/man/dump_mfts.8.in
@@ -0,0 +1,170 @@
+.\" Man page generated from reStructeredText.
+.
+.TH DUMP_MFTS.SH 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+DUMP_MFTS.SH \- dump InfiniBand multicast forwarding tables
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+dump_mfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/file]
+.SH DESCRIPTION
+.sp
+dump_mfts.sh is a script which dumps the InfiniBand multicast
+forwarding tables (MFTs) in the switch nodes in the subnet.
+.SH OPTIONS
+.sp
+\fB\-D\fP
+dump forwarding tables using direct routed rather than LID routed SMPs
+.sp
+\fB\-h\fP
+show help
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+\fBdump_lfts(8), ibroute(8), ibswitches(8), opensm(8)\fP
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibaddr.8 b/doc/man/ibaddr.8
new file mode 100644
index 0000000..6a4b7bc
--- /dev/null
+++ b/doc/man/ibaddr.8
@@ -0,0 +1,207 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBADDR 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBADDR \- query InfiniBand address(es)
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibaddr [options]
+.SH DESCRIPTION
+.sp
+Display the lid (and range) as well as the GID address of the
+port specified (by DR path, lid, or GUID) or the local port by default.
+.sp
+Note: this utility can be used as simple address resolver.
+.SH OPTIONS
+.sp
+\fB\-\-gid_show, \-g\fP
+show gid address only
+.sp
+\fB\-\-lid_show, \-l\fP
+show lid range only
+.sp
+\fB\-\-Lid_show, \-L\fP
+show lid range (in decimal) only
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH EXAMPLES
+.sp
+.nf
+.ft C
+ibaddr                  # local port\e\(aqs address
+ibaddr 32               # show lid range and gid of lid 32
+ibaddr \-G 0x8f1040023   # same but using guid address
+ibaddr \-l 32            # show lid range only
+ibaddr \-L 32            # show decimal lid range only
+ibaddr \-g 32            # show gid address only
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+\fBibroute (8), ibtracert (8)\fP
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibaddr.8.in b/doc/man/ibaddr.8.in
new file mode 100644
index 0000000..efbd438
--- /dev/null
+++ b/doc/man/ibaddr.8.in
@@ -0,0 +1,207 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBADDR 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBADDR \- query InfiniBand address(es)
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibaddr [options]
+.SH DESCRIPTION
+.sp
+Display the lid (and range) as well as the GID address of the
+port specified (by DR path, lid, or GUID) or the local port by default.
+.sp
+Note: this utility can be used as simple address resolver.
+.SH OPTIONS
+.sp
+\fB\-\-gid_show, \-g\fP
+show gid address only
+.sp
+\fB\-\-lid_show, \-l\fP
+show lid range only
+.sp
+\fB\-\-Lid_show, \-L\fP
+show lid range (in decimal) only
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH EXAMPLES
+.sp
+.nf
+.ft C
+ibaddr                  # local port\e\(aqs address
+ibaddr 32               # show lid range and gid of lid 32
+ibaddr \-G 0x8f1040023   # same but using guid address
+ibaddr \-l 32            # show lid range only
+ibaddr \-L 32            # show decimal lid range only
+ibaddr \-g 32            # show gid address only
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+\fBibroute (8), ibtracert (8)\fP
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibcacheedit.8 b/doc/man/ibcacheedit.8
new file mode 100644
index 0000000..bfed66c
--- /dev/null
+++ b/doc/man/ibcacheedit.8
@@ -0,0 +1,86 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCACHEEDIT 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBCACHEEDIT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH edit an ibnetdiscover cache
+.SS SYNOPSIS
+.sp
+ibcacheedit [options] <orig.cache> <new.cache>
+.SS DESCRIPTION
+.sp
+ibcacheedit allows users to edit an ibnetdiscover cache created through the
+\fB\-\-cache\fP option in \fBibnetdiscover(8)\fP .
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-\-switchguid BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a switchguid that should be changed.  The before and after guid
+should be separated by a colon.  On switches, port guids are identical
+to the switch guid, so port guids will be adjusted as well on switches.
+.TP
+.B \fB\-\-caguid BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a caguid that should be changed.  The before and after guid
+should be separated by a colon.
+.TP
+.B \fB\-\-sysimgguid BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a sysimgguid that should be changed.  The before and after guid
+should be spearated by a colon.
+.TP
+.B \fB\-\-portguid NODEGUID:BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a portguid that should be changed.  The nodeguid of the port
+(e.g. switchguid or caguid) should be specified first, followed by a
+colon, the before port guid, another colon, then the after port guid.
+On switches, port guids are identical to the switch guid, so the switch
+guid will be adjusted as well on switches.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibcacheedit.8.in b/doc/man/ibcacheedit.8.in
new file mode 100644
index 0000000..9b8cb42
--- /dev/null
+++ b/doc/man/ibcacheedit.8.in
@@ -0,0 +1,86 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCACHEEDIT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBCACHEEDIT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH edit an ibnetdiscover cache
+.SS SYNOPSIS
+.sp
+ibcacheedit [options] <orig.cache> <new.cache>
+.SS DESCRIPTION
+.sp
+ibcacheedit allows users to edit an ibnetdiscover cache created through the
+\fB\-\-cache\fP option in \fBibnetdiscover(8)\fP .
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-\-switchguid BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a switchguid that should be changed.  The before and after guid
+should be separated by a colon.  On switches, port guids are identical
+to the switch guid, so port guids will be adjusted as well on switches.
+.TP
+.B \fB\-\-caguid BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a caguid that should be changed.  The before and after guid
+should be separated by a colon.
+.TP
+.B \fB\-\-sysimgguid BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a sysimgguid that should be changed.  The before and after guid
+should be spearated by a colon.
+.TP
+.B \fB\-\-portguid NODEGUID:BEFOREGUID:AFTERGUID\fP
+.sp
+Specify a portguid that should be changed.  The nodeguid of the port
+(e.g. switchguid or caguid) should be specified first, followed by a
+colon, the before port guid, another colon, then the after port guid.
+On switches, port guids are identical to the switch guid, so the switch
+guid will be adjusted as well on switches.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibccconfig.8 b/doc/man/ibccconfig.8
new file mode 100644
index 0000000..6f95756
--- /dev/null
+++ b/doc/man/ibccconfig.8
@@ -0,0 +1,197 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCCCONFIG 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBCCCONFIG \- configure congestion control settings
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibccconfig [common_options] [\-c cckey] <op> <lid|guid> [port]
+.SH DESCRIPTION
+.sp
+\fBibccconfig\fP
+supports the configuration of congestion control settings on switches
+and HCAs.
+.sp
+\fBWARNING \-\- You should understand what you are doing before using this tool.
+Misuse of this tool could result in a broken fabric.\fP
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B Current supported operations and their parameters:
+.
+CongestionKeyInfo (CK) <lid|guid> <cckey> <cckeyprotectbit> <cckeyleaseperiod> <cckeyviolations>
+SwitchCongestionSetting (SS) <lid|guid> <controlmap> <victimmask> <creditmask> <threshold> <packetsize> <csthreshold> <csreturndelay> <markingrate>
+SwitchPortCongestionSetting (SP) <lid|guid> <portnum> <valid> <control_type> <threshold> <packet_size> <cong_parm_marking_rate>
+CACongestionSetting (CS) <lid|guid> <port_control> <control_map> <ccti_timer> <ccti_increase> <trigger_threshold> <ccti_min>
+CongestionControlTable (CT) <lid|guid> <cctilimit> <index> <cctentry> <cctentry> ...
+.UNINDENT
+.sp
+\fB\-\-cckey, \-c, <cckey>\fP
+Specify a congestion control (CC) key.  If none is specified, a key of 0 is used.
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SH EXAMPLES
+.sp
+.nf
+.ft C
+ibccconfig SwitchCongestionSetting 2 0x1F 0x1FFFFFFFFF 0x0 0xF 8 0 0:0 1  # Configure Switch Congestion Settings
+ibccconfig CACongestionSetting 1 0 0x3 150 1 0 0                          # Configure CA Congestion Settings to SL 0 and SL 1
+ibccconfig CACongestionSetting 1 0 0x4 200 1 0 0                          # Configure CA Congestion Settings to SL 2
+ibccconfig CongestionControlTable 1 63 0 0:0 0:1 ...                      # Configure first block of Congestion Control Table
+ibccconfig CongestionControlTable 1 127 0 0:64 0:65 ...                   # Configure second block of Congestion Control Table
+.ft P
+.fi
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibccconfig.8.in b/doc/man/ibccconfig.8.in
new file mode 100644
index 0000000..0df5fbf
--- /dev/null
+++ b/doc/man/ibccconfig.8.in
@@ -0,0 +1,197 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCCCONFIG 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBCCCONFIG \- configure congestion control settings
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibccconfig [common_options] [\-c cckey] <op> <lid|guid> [port]
+.SH DESCRIPTION
+.sp
+\fBibccconfig\fP
+supports the configuration of congestion control settings on switches
+and HCAs.
+.sp
+\fBWARNING \-\- You should understand what you are doing before using this tool.
+Misuse of this tool could result in a broken fabric.\fP
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B Current supported operations and their parameters:
+.
+CongestionKeyInfo (CK) <lid|guid> <cckey> <cckeyprotectbit> <cckeyleaseperiod> <cckeyviolations>
+SwitchCongestionSetting (SS) <lid|guid> <controlmap> <victimmask> <creditmask> <threshold> <packetsize> <csthreshold> <csreturndelay> <markingrate>
+SwitchPortCongestionSetting (SP) <lid|guid> <portnum> <valid> <control_type> <threshold> <packet_size> <cong_parm_marking_rate>
+CACongestionSetting (CS) <lid|guid> <port_control> <control_map> <ccti_timer> <ccti_increase> <trigger_threshold> <ccti_min>
+CongestionControlTable (CT) <lid|guid> <cctilimit> <index> <cctentry> <cctentry> ...
+.UNINDENT
+.sp
+\fB\-\-cckey, \-c, <cckey>\fP
+Specify a congestion control (CC) key.  If none is specified, a key of 0 is used.
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SH EXAMPLES
+.sp
+.nf
+.ft C
+ibccconfig SwitchCongestionSetting 2 0x1F 0x1FFFFFFFFF 0x0 0xF 8 0 0:0 1  # Configure Switch Congestion Settings
+ibccconfig CACongestionSetting 1 0 0x3 150 1 0 0                          # Configure CA Congestion Settings to SL 0 and SL 1
+ibccconfig CACongestionSetting 1 0 0x4 200 1 0 0                          # Configure CA Congestion Settings to SL 2
+ibccconfig CongestionControlTable 1 63 0 0:0 0:1 ...                      # Configure first block of Congestion Control Table
+ibccconfig CongestionControlTable 1 127 0 0:64 0:65 ...                   # Configure second block of Congestion Control Table
+.ft P
+.fi
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibccquery.8 b/doc/man/ibccquery.8
new file mode 100644
index 0000000..cfca977
--- /dev/null
+++ b/doc/man/ibccquery.8
@@ -0,0 +1,194 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCCQUERY 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBCCQUERY \- query congestion control settings/info
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibccquery [common_options] [\-c cckey] <op> <lid|guid> [port]
+.SH DESCRIPTION
+.sp
+ibccquery support the querying of settings and other information related
+to congestion control.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B Current supported operations and their parameters:
+.
+CongestionInfo (CI) <addr>
+CongestionKeyInfo (CK) <addr>
+CongestionLog (CL) <addr>
+SwitchCongestionSetting (SS) <addr>
+SwitchPortCongestionSetting (SP) <addr> [<portnum>]
+CACongestionSetting (CS) <addr>
+CongestionControlTable (CT) <addr>
+Timestamp (TI) <addr>
+.UNINDENT
+.sp
+\fB\-\-cckey, \-c <cckey>\fP
+Specify a congestion control (CC) key.  If none is specified, a key of 0 is used.
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH EXAMPLES
+.sp
+.nf
+.ft C
+ibccquery CongestionInfo 3              # Congestion Info by lid
+ibccquery SwitchPortCongestionSetting 3 # Query all Switch Port Congestion Settings
+ibccquery SwitchPortCongestionSetting 3 1 # Query Switch Port Congestion Setting for port 1
+.ft P
+.fi
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibccquery.8.in b/doc/man/ibccquery.8.in
new file mode 100644
index 0000000..a282c99
--- /dev/null
+++ b/doc/man/ibccquery.8.in
@@ -0,0 +1,194 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCCQUERY 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBCCQUERY \- query congestion control settings/info
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibccquery [common_options] [\-c cckey] <op> <lid|guid> [port]
+.SH DESCRIPTION
+.sp
+ibccquery support the querying of settings and other information related
+to congestion control.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B Current supported operations and their parameters:
+.
+CongestionInfo (CI) <addr>
+CongestionKeyInfo (CK) <addr>
+CongestionLog (CL) <addr>
+SwitchCongestionSetting (SS) <addr>
+SwitchPortCongestionSetting (SP) <addr> [<portnum>]
+CACongestionSetting (CS) <addr>
+CongestionControlTable (CT) <addr>
+Timestamp (TI) <addr>
+.UNINDENT
+.sp
+\fB\-\-cckey, \-c <cckey>\fP
+Specify a congestion control (CC) key.  If none is specified, a key of 0 is used.
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH EXAMPLES
+.sp
+.nf
+.ft C
+ibccquery CongestionInfo 3              # Congestion Info by lid
+ibccquery SwitchPortCongestionSetting 3 # Query all Switch Port Congestion Settings
+ibccquery SwitchPortCongestionSetting 3 1 # Query Switch Port Congestion Setting for port 1
+.ft P
+.fi
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Albert Chu
+.
+< \fI\%chu11 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibclearcounters.8.in b/doc/man/ibclearcounters.8.in
new file mode 100644
index 0000000..106c643
--- /dev/null
+++ b/doc/man/ibclearcounters.8.in
@@ -0,0 +1,101 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBCLEARCOUNTERS 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBCLEARCOUNTERS \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH clear port counters in IB subnet
+.SS SYNOPSIS
+.sp
+ibclearcounters [\-h] [<topology\-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
+.SS DESCRIPTION
+.sp
+ibclearcounters is a script that clears the PMA port counters by either walking
+the IB subnet topology or using an already saved topology file.
+.SS OPTIONS
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SS SEE ALSO
+.sp
+\fBibnetdiscover(8), perfquery(8)\fP
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibfindnodesusing.8 b/doc/man/ibfindnodesusing.8
new file mode 100644
index 0000000..fe0850f
--- /dev/null
+++ b/doc/man/ibfindnodesusing.8
@@ -0,0 +1,123 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBFINDNODESUSING 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBFINDNODESUSING \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH find a list of end nodes which are routed through the specified switch and port
+.SS SYNOPSIS
+.sp
+ibfindnodesusing.pl [options] <switch_guid|switch_name> <port>
+.SS DESCRIPTION
+.sp
+ibfindnodesusing.pl uses ibroute and detects the current nodes which are routed
+through both directions of the link specified.  The link is specified by one
+switch port end; the script finds the remote end automatically.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-h\fP
+.sp
+show help
+.TP
+.B \fB\-R\fP
+.sp
+Recalculate the ibnetdiscover information, ie do not use the cached
+information.  This option is slower but should be used if the diag
+tools have not been used for some time or if there are other reasons to
+believe that the fabric has changed.
+.UNINDENT
+.sp
+\fB\-C <ca_name>\fP    use the specified ca_name.
+.sp
+\fB\-P <ca_port>\fP    use the specified ca_port.
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibfindnodesusing.8.in b/doc/man/ibfindnodesusing.8.in
new file mode 100644
index 0000000..23a3a5c
--- /dev/null
+++ b/doc/man/ibfindnodesusing.8.in
@@ -0,0 +1,123 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBFINDNODESUSING 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBFINDNODESUSING \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH find a list of end nodes which are routed through the specified switch and port
+.SS SYNOPSIS
+.sp
+ibfindnodesusing.pl [options] <switch_guid|switch_name> <port>
+.SS DESCRIPTION
+.sp
+ibfindnodesusing.pl uses ibroute and detects the current nodes which are routed
+through both directions of the link specified.  The link is specified by one
+switch port end; the script finds the remote end automatically.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-h\fP
+.sp
+show help
+.TP
+.B \fB\-R\fP
+.sp
+Recalculate the ibnetdiscover information, ie do not use the cached
+information.  This option is slower but should be used if the diag
+tools have not been used for some time or if there are other reasons to
+believe that the fabric has changed.
+.UNINDENT
+.sp
+\fB\-C <ca_name>\fP    use the specified ca_name.
+.sp
+\fB\-P <ca_port>\fP    use the specified ca_port.
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibhosts.8 b/doc/man/ibhosts.8
new file mode 100644
index 0000000..2e7d82e
--- /dev/null
+++ b/doc/man/ibhosts.8
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBHOSTS 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBHOSTS \- show InfiniBand host nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibhosts [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibhosts is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the CA nodes.
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibhosts.8.in b/doc/man/ibhosts.8.in
new file mode 100644
index 0000000..ceadee3
--- /dev/null
+++ b/doc/man/ibhosts.8.in
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBHOSTS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBHOSTS \- show InfiniBand host nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibhosts [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibhosts is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the CA nodes.
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibidsverify.8 b/doc/man/ibidsverify.8
new file mode 100644
index 0000000..ac1e596
--- /dev/null
+++ b/doc/man/ibidsverify.8
@@ -0,0 +1,82 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBIDSVERIFY 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBIDSVERIFY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH validate IB identifiers in subnet and report errors
+.SS SYNOPSIS
+.sp
+ibidsverify.pl [\-h] [\-R]
+.SS DESCRIPTION
+.sp
+ibidsverify.pl is a perl script which uses a full topology file that was
+created by ibnetdiscover, scans the network to validate the LIDs and GUIDs
+in the subnet. The validation consists of checking that there are no zero
+or duplicate identifiers.
+.sp
+Finally, ibidsverify.pl will also reuse the cached ibnetdiscover output from
+some of the other diag tools which makes it a bit faster than running
+ibnetdiscover from scratch.
+.SS OPTIONS
+.sp
+\fB\-R\fP
+Recalculate the ibnetdiscover information, ie do not use the cached
+information.  This option is slower but should be used if the diag tools have
+not been used for some time or if there are other reasons to believe the
+fabric has changed.
+.sp
+\fB\-C <ca_name>\fP    use the specified ca_name.
+.sp
+\fB\-P <ca_port>\fP    use the specified ca_port.
+.SS EXIT STATUS
+.sp
+Exit status is 1 if errors are found, 0 otherwise.
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS SEE ALSO
+.sp
+\fBibnetdiscover(8)\fP
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibidsverify.8.in b/doc/man/ibidsverify.8.in
new file mode 100644
index 0000000..3933e67
--- /dev/null
+++ b/doc/man/ibidsverify.8.in
@@ -0,0 +1,82 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBIDSVERIFY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBIDSVERIFY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH validate IB identifiers in subnet and report errors
+.SS SYNOPSIS
+.sp
+ibidsverify.pl [\-h] [\-R]
+.SS DESCRIPTION
+.sp
+ibidsverify.pl is a perl script which uses a full topology file that was
+created by ibnetdiscover, scans the network to validate the LIDs and GUIDs
+in the subnet. The validation consists of checking that there are no zero
+or duplicate identifiers.
+.sp
+Finally, ibidsverify.pl will also reuse the cached ibnetdiscover output from
+some of the other diag tools which makes it a bit faster than running
+ibnetdiscover from scratch.
+.SS OPTIONS
+.sp
+\fB\-R\fP
+Recalculate the ibnetdiscover information, ie do not use the cached
+information.  This option is slower but should be used if the diag tools have
+not been used for some time or if there are other reasons to believe the
+fabric has changed.
+.sp
+\fB\-C <ca_name>\fP    use the specified ca_name.
+.sp
+\fB\-P <ca_port>\fP    use the specified ca_port.
+.SS EXIT STATUS
+.sp
+Exit status is 1 if errors are found, 0 otherwise.
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS SEE ALSO
+.sp
+\fBibnetdiscover(8)\fP
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/iblinkinfo.8 b/doc/man/iblinkinfo.8
new file mode 100644
index 0000000..ef371cb
--- /dev/null
+++ b/doc/man/iblinkinfo.8
@@ -0,0 +1,315 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBLINKINFO 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBLINKINFO \- report link info for all links in the fabric
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+iblinkinfo <options>
+.SH DESCRIPTION
+.sp
+iblinkinfo reports link info for each port in an IB fabric, node by node.
+Optionally, iblinkinfo can do partial scans and limit its output to parts of a
+fabric.
+.SH OPTIONS
+.sp
+\fB\-\-down, \-d\fP
+Print only nodes which have a port in the "Down" state.
+.sp
+\fB\-\-line, \-l\fP
+Print all information for each link on one line. Default is to print a header
+with the node information and then a list for each port (useful for
+grep\(aqing output).
+.sp
+\fB\-\-additional, \-p\fP
+Print additional port settings (<LifeTime>,<HoqLife>,<VLStallCount>)
+.sp
+\fB\-\-switches\-only\fP
+Show only switches in output.
+.sp
+\fB\-\-cas\-only\fP
+Show only CAs in output.
+.SS Partial Scan flags
+.sp
+The node to start a partial scan can be specified with the following addresses.
+.\" Define the common option -G
+.
+.sp
+\fB\-\-port\-guid, \-G <port_guid>\fP  Specify a port_guid
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   \-D "0"          # self port
+   \-D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.sp
+\fBNote:\fP For switches results are printed for all ports not just switch port 0.
+.sp
+\fB\-\-switch, \-S <port_guid>\fP same as "\-G". (provided only for backward compatibility)
+.sp
+How much of the scan to be printed can be controled with the following.
+.sp
+\fB\-\-all, \-a\fP
+Print all nodes found in a partial fabric scan.  Normally a
+partial fabric scan will return only the node specified.  This option will
+print the other nodes found as well.
+.sp
+\fB\-\-hops, \-n <hops>\fP
+Specify the number of hops away from a specified node to scan.  This is useful
+to expand a partial fabric scan beyond the node specified.
+.SS Cache File flags
+.\" Define the common option load-cache
+.
+.sp
+\fB\-\-load\-cache <filename>\fP
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+.\" Define the common option diff
+.
+.sp
+\fB\-\-diff <filename>\fP
+Load cached ibnetdiscover data and do a diff comparison to the current
+network or another cache.  A special diff output for ibnetdiscover
+output will be displayed showing differences between the old and current
+fabric.  By default, the following are compared for differences: switches,
+channel adapters, routers, and port connections.
+.\" Define the common option diffcheck
+.
+.sp
+\fB\-\-diffcheck <key(s)>\fP
+Specify what diff checks should be done in the \fB\-\-diff\fP option above.
+Comma separate multiple diff check key(s).  The available diff checks
+are: \fBsw = switches\fP, \fBca = channel adapters\fP, \fBrouter\fP = routers,
+\fBport\fP = port connections, \fBlid\fP = lids, \fBnodedesc\fP = node
+descriptions.  Note that \fBport\fP, \fBlid\fP, and \fBnodedesc\fP are
+checked only for the node types that are specified (e.g. \fBsw\fP,
+\fBca\fP, \fBrouter\fP).  If \fBport\fP is specified alongside \fBlid\fP
+or \fBnodedesc\fP, remote port lids and node descriptions will also be compared.
+.sp
+\fB\-\-filterdownports <filename>\fP
+Filter downports indicated in a ibnetdiscover cache.  If a port was previously
+indicated as down in the specified cache, and is still down, do not output it in the
+resulting output.  This option may be particularly useful for environments
+where switches are not fully populated, thus much of the default iblinkinfo
+info is considered unuseful.  See \fBibnetdiscover\fP for information on caching
+ibnetdiscover output.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.sp
+\fB\-R\fP (This option is obsolete and does nothing)
+.SH EXIT STATUS
+.sp
+0 on success, \-1 on failure to scan the fabric, 1 if check mode is used and
+inconsistencies are found.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/iblinkinfo.8.in b/doc/man/iblinkinfo.8.in
new file mode 100644
index 0000000..d5fd476
--- /dev/null
+++ b/doc/man/iblinkinfo.8.in
@@ -0,0 +1,315 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBLINKINFO 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBLINKINFO \- report link info for all links in the fabric
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+iblinkinfo <options>
+.SH DESCRIPTION
+.sp
+iblinkinfo reports link info for each port in an IB fabric, node by node.
+Optionally, iblinkinfo can do partial scans and limit its output to parts of a
+fabric.
+.SH OPTIONS
+.sp
+\fB\-\-down, \-d\fP
+Print only nodes which have a port in the "Down" state.
+.sp
+\fB\-\-line, \-l\fP
+Print all information for each link on one line. Default is to print a header
+with the node information and then a list for each port (useful for
+grep\(aqing output).
+.sp
+\fB\-\-additional, \-p\fP
+Print additional port settings (<LifeTime>,<HoqLife>,<VLStallCount>)
+.sp
+\fB\-\-switches\-only\fP
+Show only switches in output.
+.sp
+\fB\-\-cas\-only\fP
+Show only CAs in output.
+.SS Partial Scan flags
+.sp
+The node to start a partial scan can be specified with the following addresses.
+.\" Define the common option -G
+.
+.sp
+\fB\-\-port\-guid, \-G <port_guid>\fP  Specify a port_guid
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   \-D "0"          # self port
+   \-D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.sp
+\fBNote:\fP For switches results are printed for all ports not just switch port 0.
+.sp
+\fB\-\-switch, \-S <port_guid>\fP same as "\-G". (provided only for backward compatibility)
+.sp
+How much of the scan to be printed can be controled with the following.
+.sp
+\fB\-\-all, \-a\fP
+Print all nodes found in a partial fabric scan.  Normally a
+partial fabric scan will return only the node specified.  This option will
+print the other nodes found as well.
+.sp
+\fB\-\-hops, \-n <hops>\fP
+Specify the number of hops away from a specified node to scan.  This is useful
+to expand a partial fabric scan beyond the node specified.
+.SS Cache File flags
+.\" Define the common option load-cache
+.
+.sp
+\fB\-\-load\-cache <filename>\fP
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+.\" Define the common option diff
+.
+.sp
+\fB\-\-diff <filename>\fP
+Load cached ibnetdiscover data and do a diff comparison to the current
+network or another cache.  A special diff output for ibnetdiscover
+output will be displayed showing differences between the old and current
+fabric.  By default, the following are compared for differences: switches,
+channel adapters, routers, and port connections.
+.\" Define the common option diffcheck
+.
+.sp
+\fB\-\-diffcheck <key(s)>\fP
+Specify what diff checks should be done in the \fB\-\-diff\fP option above.
+Comma separate multiple diff check key(s).  The available diff checks
+are: \fBsw = switches\fP, \fBca = channel adapters\fP, \fBrouter\fP = routers,
+\fBport\fP = port connections, \fBlid\fP = lids, \fBnodedesc\fP = node
+descriptions.  Note that \fBport\fP, \fBlid\fP, and \fBnodedesc\fP are
+checked only for the node types that are specified (e.g. \fBsw\fP,
+\fBca\fP, \fBrouter\fP).  If \fBport\fP is specified alongside \fBlid\fP
+or \fBnodedesc\fP, remote port lids and node descriptions will also be compared.
+.sp
+\fB\-\-filterdownports <filename>\fP
+Filter downports indicated in a ibnetdiscover cache.  If a port was previously
+indicated as down in the specified cache, and is still down, do not output it in the
+resulting output.  This option may be particularly useful for environments
+where switches are not fully populated, thus much of the default iblinkinfo
+info is considered unuseful.  See \fBibnetdiscover\fP for information on caching
+ibnetdiscover output.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.sp
+\fB\-R\fP (This option is obsolete and does nothing)
+.SH EXIT STATUS
+.sp
+0 on success, \-1 on failure to scan the fabric, 1 if check mode is used and
+inconsistencies are found.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibnetdiscover.8 b/doc/man/ibnetdiscover.8
new file mode 100644
index 0000000..966638b
--- /dev/null
+++ b/doc/man/ibnetdiscover.8
@@ -0,0 +1,393 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBNETDISCOVER 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBNETDISCOVER \- discover InfiniBand topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibnetdiscover [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibnetdiscover performs IB subnet discovery and outputs a human readable
+topology file. GUIDs, node types, and port numbers are displayed
+as well as port LIDs and NodeDescriptions.  All nodes (and links) are displayed
+(full topology).  Optionally, this utility can be used to list the current
+connected nodes by nodetype.  The output is printed to standard output
+unless a topology file is specified.
+.SH OPTIONS
+.sp
+\fB\-l, \-\-list\fP
+List of connected nodes
+.sp
+\fB\-g, \-\-grouping\fP
+Show grouping.  Grouping correlates IB nodes by different vendor specific
+schemes.  It may also show the switch external ports correspondence.
+.sp
+\fB\-H, \-\-Hca_list\fP
+List of connected CAs
+.sp
+\fB\-S, \-\-Switch_list\fP
+List of connected switches
+.sp
+\fB\-R, \-\-Router_list\fP
+List of connected routers
+.sp
+\fB\-s, \-\-show\fP
+Show progress information during discovery.
+.sp
+\fB\-p, \-\-ports\fP
+Obtain a ports report which is a
+list of connected ports with relevant information (like LID, portnum,
+GUID, width, speed, and NodeDescription).
+.sp
+\fB\-m, \-\-max_hops\fP
+Report max hops discovered.
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.SS Cache File flags
+.\" Define the common option cache
+.
+.sp
+\fB\-\-cache <filename>\fP
+Cache the ibnetdiscover network data in the specified filename.  This
+cache may be used by other tools for later analysis.
+.\" Define the common option load-cache
+.
+.sp
+\fB\-\-load\-cache <filename>\fP
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+.\" Define the common option diff
+.
+.sp
+\fB\-\-diff <filename>\fP
+Load cached ibnetdiscover data and do a diff comparison to the current
+network or another cache.  A special diff output for ibnetdiscover
+output will be displayed showing differences between the old and current
+fabric.  By default, the following are compared for differences: switches,
+channel adapters, routers, and port connections.
+.\" Define the common option diffcheck
+.
+.sp
+\fB\-\-diffcheck <key(s)>\fP
+Specify what diff checks should be done in the \fB\-\-diff\fP option above.
+Comma separate multiple diff check key(s).  The available diff checks
+are: \fBsw = switches\fP, \fBca = channel adapters\fP, \fBrouter\fP = routers,
+\fBport\fP = port connections, \fBlid\fP = lids, \fBnodedesc\fP = node
+descriptions.  Note that \fBport\fP, \fBlid\fP, and \fBnodedesc\fP are
+checked only for the node types that are specified (e.g. \fBsw\fP,
+\fBca\fP, \fBrouter\fP).  If \fBport\fP is specified alongside \fBlid\fP
+or \fBnodedesc\fP, remote port lids and node descriptions will also be compared.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.\" Common text to describe the Topology file.
+.
+.SS TOPOLOGY FILE FORMAT
+.sp
+The topology file format is human readable and largely intuitive.
+Most identifiers are given textual names like vendor ID (vendid), device ID
+(device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).
+PortGUIDs are shown in parentheses ().  For switches, this is shown on the
+switchguid line.  For CA and router ports, it is shown on the connectivity
+lines.  The IB node is identified followed by the number of ports and a quoted
+the node GUID.  On the right of this line is a comment (#) followed by the
+NodeDescription in quotes.  If the node is a switch, this line also contains
+whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
+Subsequent lines pertaining to this node show the connectivity.   On the
+left is the port number of the current node.  On the right is the peer node
+(node at other end of link). It is identified in quotes with nodetype
+followed by \- followed by NodeGUID with the port number in square brackets.
+Further on the right is a comment (#).  What follows the comment is
+dependent on the node type.  If it it a switch node, it is followed by
+the NodeDescription in quotes and the LID of the peer node.  If it is a
+CA or router node, it is followed by the local LID and LMC and then
+followed by the NodeDescription in quotes and the LID of the peer node.
+The active link width and speed are then appended to the end of this
+output line.
+.sp
+An example of this is:
+.sp
+.nf
+.ft C
+#
+# Topology file: generated on Tue Jun  5 14:15:10 2007
+#
+# Max of 3 hops discovered
+# Initiated from node 0008f10403960558 port 0008f10403960559
+
+Non\-Chassis Nodes
+
+vendid=0x8f1
+devid=0x5a06
+sysimgguid=0x5442ba00003000
+switchguid=0x5442ba00003080(5442ba00003080)
+Switch  24 "S\-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
+[22]    "H\-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
+[10]    "S\-0008f10400410015"[1]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[8]     "H\-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
+[6]     "S\-0008f10400410015"[3]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[12]    "H\-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
+
+vendid=0x8f1
+devid=0x5a05
+switchguid=0x8f10400410015(8f10400410015)
+Switch  8 "S\-0008f10400410015"          # "SW\-6IB4 Voltaire" base port 0 lid 3 lmc 0
+[6]     "H\-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
+[4]     "H\-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
+[1]     "S\-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
+[3]     "S\-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960984
+Ca      2 "H\-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403960985)     "S\-0008f10400410015"[6]         # lid 16 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x5442b100004900
+Ca      2 "H\-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](5442b100004901)     "S\-0008f10400410015"[4]         # lid 12 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403961354
+Ca      2 "H\-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403961355)     "S\-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960558
+Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
+[2](8f1040396055a)     "S\-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+[1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
+.ft P
+.fi
+.sp
+When grouping is used, IB nodes are organized into chassis which are
+numbered. Nodes which cannot be determined to be in a chassis are
+displayed as "Non\-Chassis Nodes".  External ports are also shown on the
+connectivity lines.
+.SH AUTHORS
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibnetdiscover.8.in b/doc/man/ibnetdiscover.8.in
new file mode 100644
index 0000000..dbb7851
--- /dev/null
+++ b/doc/man/ibnetdiscover.8.in
@@ -0,0 +1,393 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBNETDISCOVER 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBNETDISCOVER \- discover InfiniBand topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibnetdiscover [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibnetdiscover performs IB subnet discovery and outputs a human readable
+topology file. GUIDs, node types, and port numbers are displayed
+as well as port LIDs and NodeDescriptions.  All nodes (and links) are displayed
+(full topology).  Optionally, this utility can be used to list the current
+connected nodes by nodetype.  The output is printed to standard output
+unless a topology file is specified.
+.SH OPTIONS
+.sp
+\fB\-l, \-\-list\fP
+List of connected nodes
+.sp
+\fB\-g, \-\-grouping\fP
+Show grouping.  Grouping correlates IB nodes by different vendor specific
+schemes.  It may also show the switch external ports correspondence.
+.sp
+\fB\-H, \-\-Hca_list\fP
+List of connected CAs
+.sp
+\fB\-S, \-\-Switch_list\fP
+List of connected switches
+.sp
+\fB\-R, \-\-Router_list\fP
+List of connected routers
+.sp
+\fB\-s, \-\-show\fP
+Show progress information during discovery.
+.sp
+\fB\-p, \-\-ports\fP
+Obtain a ports report which is a
+list of connected ports with relevant information (like LID, portnum,
+GUID, width, speed, and NodeDescription).
+.sp
+\fB\-m, \-\-max_hops\fP
+Report max hops discovered.
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.SS Cache File flags
+.\" Define the common option cache
+.
+.sp
+\fB\-\-cache <filename>\fP
+Cache the ibnetdiscover network data in the specified filename.  This
+cache may be used by other tools for later analysis.
+.\" Define the common option load-cache
+.
+.sp
+\fB\-\-load\-cache <filename>\fP
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+.\" Define the common option diff
+.
+.sp
+\fB\-\-diff <filename>\fP
+Load cached ibnetdiscover data and do a diff comparison to the current
+network or another cache.  A special diff output for ibnetdiscover
+output will be displayed showing differences between the old and current
+fabric.  By default, the following are compared for differences: switches,
+channel adapters, routers, and port connections.
+.\" Define the common option diffcheck
+.
+.sp
+\fB\-\-diffcheck <key(s)>\fP
+Specify what diff checks should be done in the \fB\-\-diff\fP option above.
+Comma separate multiple diff check key(s).  The available diff checks
+are: \fBsw = switches\fP, \fBca = channel adapters\fP, \fBrouter\fP = routers,
+\fBport\fP = port connections, \fBlid\fP = lids, \fBnodedesc\fP = node
+descriptions.  Note that \fBport\fP, \fBlid\fP, and \fBnodedesc\fP are
+checked only for the node types that are specified (e.g. \fBsw\fP,
+\fBca\fP, \fBrouter\fP).  If \fBport\fP is specified alongside \fBlid\fP
+or \fBnodedesc\fP, remote port lids and node descriptions will also be compared.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.\" Common text to describe the Topology file.
+.
+.SS TOPOLOGY FILE FORMAT
+.sp
+The topology file format is human readable and largely intuitive.
+Most identifiers are given textual names like vendor ID (vendid), device ID
+(device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).
+PortGUIDs are shown in parentheses ().  For switches, this is shown on the
+switchguid line.  For CA and router ports, it is shown on the connectivity
+lines.  The IB node is identified followed by the number of ports and a quoted
+the node GUID.  On the right of this line is a comment (#) followed by the
+NodeDescription in quotes.  If the node is a switch, this line also contains
+whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
+Subsequent lines pertaining to this node show the connectivity.   On the
+left is the port number of the current node.  On the right is the peer node
+(node at other end of link). It is identified in quotes with nodetype
+followed by \- followed by NodeGUID with the port number in square brackets.
+Further on the right is a comment (#).  What follows the comment is
+dependent on the node type.  If it it a switch node, it is followed by
+the NodeDescription in quotes and the LID of the peer node.  If it is a
+CA or router node, it is followed by the local LID and LMC and then
+followed by the NodeDescription in quotes and the LID of the peer node.
+The active link width and speed are then appended to the end of this
+output line.
+.sp
+An example of this is:
+.sp
+.nf
+.ft C
+#
+# Topology file: generated on Tue Jun  5 14:15:10 2007
+#
+# Max of 3 hops discovered
+# Initiated from node 0008f10403960558 port 0008f10403960559
+
+Non\-Chassis Nodes
+
+vendid=0x8f1
+devid=0x5a06
+sysimgguid=0x5442ba00003000
+switchguid=0x5442ba00003080(5442ba00003080)
+Switch  24 "S\-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
+[22]    "H\-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
+[10]    "S\-0008f10400410015"[1]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[8]     "H\-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
+[6]     "S\-0008f10400410015"[3]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[12]    "H\-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
+
+vendid=0x8f1
+devid=0x5a05
+switchguid=0x8f10400410015(8f10400410015)
+Switch  8 "S\-0008f10400410015"          # "SW\-6IB4 Voltaire" base port 0 lid 3 lmc 0
+[6]     "H\-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
+[4]     "H\-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
+[1]     "S\-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
+[3]     "S\-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960984
+Ca      2 "H\-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403960985)     "S\-0008f10400410015"[6]         # lid 16 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x5442b100004900
+Ca      2 "H\-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](5442b100004901)     "S\-0008f10400410015"[4]         # lid 12 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403961354
+Ca      2 "H\-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403961355)     "S\-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960558
+Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
+[2](8f1040396055a)     "S\-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+[1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
+.ft P
+.fi
+.sp
+When grouping is used, IB nodes are organized into chassis which are
+numbered. Nodes which cannot be determined to be in a chassis are
+displayed as "Non\-Chassis Nodes".  External ports are also shown on the
+connectivity lines.
+.SH AUTHORS
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibnodes.8 b/doc/man/ibnodes.8
new file mode 100644
index 0000000..4f3a65b
--- /dev/null
+++ b/doc/man/ibnodes.8
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBNODES 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBNODES \- show InfiniBand nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibnodes [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibnodes is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the IB nodes (CAs and switches).
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibnodes.8.in b/doc/man/ibnodes.8.in
new file mode 100644
index 0000000..6f5521f
--- /dev/null
+++ b/doc/man/ibnodes.8.in
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBNODES 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBNODES \- show InfiniBand nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibnodes [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibnodes is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the IB nodes (CAs and switches).
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibping.8 b/doc/man/ibping.8
new file mode 100644
index 0000000..ec02a52
--- /dev/null
+++ b/doc/man/ibping.8
@@ -0,0 +1,178 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBPING 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBPING \- ping an InfiniBand address
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibping [options] <dest lid | guid>
+.SH DESCRIPTION
+.sp
+ibping uses vendor mads to validate connectivity between IB nodes.
+On exit, (IP) ping like output is show. ibping is run as client/server.
+Default is to run as client. Note also that a default ping server is
+implemented within the kernel.
+.SH OPTIONS
+.sp
+\fB\-c, \-\-count\fP
+stop after count packets
+.sp
+\fB\-f, \-\-flood\fP
+flood destination: send packets back to back without delay
+.sp
+\fB\-o, \-\-oui\fP
+use specified OUI number to multiplex vendor mads
+.sp
+\fB\-S, \-\-Server\fP
+start in server mode (do not return)
+.SS Addressing Flags
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SS Debugging flags
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibping.8.in b/doc/man/ibping.8.in
new file mode 100644
index 0000000..ecb6176
--- /dev/null
+++ b/doc/man/ibping.8.in
@@ -0,0 +1,178 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBPING 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBPING \- ping an InfiniBand address
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibping [options] <dest lid | guid>
+.SH DESCRIPTION
+.sp
+ibping uses vendor mads to validate connectivity between IB nodes.
+On exit, (IP) ping like output is show. ibping is run as client/server.
+Default is to run as client. Note also that a default ping server is
+implemented within the kernel.
+.SH OPTIONS
+.sp
+\fB\-c, \-\-count\fP
+stop after count packets
+.sp
+\fB\-f, \-\-flood\fP
+flood destination: send packets back to back without delay
+.sp
+\fB\-o, \-\-oui\fP
+use specified OUI number to multiplex vendor mads
+.sp
+\fB\-S, \-\-Server\fP
+start in server mode (do not return)
+.SS Addressing Flags
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.SS Debugging flags
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibportstate.8 b/doc/man/ibportstate.8
new file mode 100644
index 0000000..bb55e0d
--- /dev/null
+++ b/doc/man/ibportstate.8
@@ -0,0 +1,259 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBPORTSTATE 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBPORTSTATE \- handle port (physical) state and link speed of an InfiniBand port
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibportstate [options] <dest dr_path|lid|guid> <portnum> [<op>]
+.SH DESCRIPTION
+.sp
+ibportstate allows the port state and port physical state of an IB port
+to be queried (in addition to link width and speed being validated
+relative to the peer port when the port queried is a switch port),
+or a switch port to be disabled, enabled, or reset. It
+also allows the link speed/width enabled on any IB port to be adjusted.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B \fB<op>\fP
+.INDENT 7.0
+.TP
+.B Supported ops: enable, disable, reset, speed, espeed, fdr10, width, query,
+.
+down, arm, active, vls, mtu, lid, smlid, lmc,
+mkey, mkeylease, mkeyprot
+(Default is query)
+.UNINDENT
+.sp
+\fBenable, disable, and reset\fP are only allowed on switch ports (An
+error is indicated if attempted on CA or router ports)
+.sp
+\fBspeed and width\fP are allowed on any port
+.sp
+\fBspeed\fP values are the legal values for PortInfo:LinkSpeedEnabled (An
+error is indicated if PortInfo:LinkSpeedSupported does not support this
+setting)
+.sp
+\fBespeed\fP is allowed on any port supporting extended link speeds
+.sp
+\fBfdr10\fP is allowed on any port supporting fdr10 (An error is
+indicated if port\(aqs capability mask indicates extended link speeds are
+not supported or if PortInfo:LinkSpeedExtSupported does not support
+this setting)
+.sp
+\fBwidth\fP values are legal values for PortInfo:LinkWidthEnabled (An
+error is indicated if PortInfo:LinkWidthSupported does not support this
+setting) (NOTE: Speed and width changes are not effected until the port
+goes through link renegotiation)
+.sp
+\fBquery\fP also validates port characteristics (link width, speed,
+espeed, and fdr10) based on the peer port. This checking is done when
+the port queried is a switch port as it relies on combined routing (an
+initial LID route with directed routing to the peer) which can only be
+done on a switch. This peer port validation feature of query op
+requires LID routing to be functioning in the subnet.
+.sp
+\fBmkey, mkeylease, and mkeyprot\fP are only allowed on CAs, routers, or
+switch port 0 (An error is generated if attempted on external switch
+ports).  Hexadecimal and octal mkeys may be specified by prepending the
+key with \(aq0x\(aq or \(aq0\(aq, respectively.  If a non\-numeric value (like \(aqx\(aq)
+is specified for the mkey, then ibportstate will prompt for a value.
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -K
+.
+.INDENT 0.0
+.TP
+.B \fB\-K, \-\-show_keys\fP
+.sp
+show security keys (mkey, smkey, etc.) associated with the request.
+.UNINDENT
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+ibportstate 3 1 disable                  # by lid
+ibportstate \-G 0x2C9000100D051 1 enable  # by guid
+ibportstate \-D 0 1                       # (query) by direct route
+ibportstate 3 1 reset                    # by lid
+ibportstate 3 1 speed 1                  # by lid
+ibportstate 3 1 width 1                  # by lid
+ibportstate \-D 0 1 lid 0x1234 arm        # by direct route
+.UNINDENT
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal.rosenstock at gmail.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibportstate.8.in b/doc/man/ibportstate.8.in
new file mode 100644
index 0000000..e45c37a
--- /dev/null
+++ b/doc/man/ibportstate.8.in
@@ -0,0 +1,259 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBPORTSTATE 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBPORTSTATE \- handle port (physical) state and link speed of an InfiniBand port
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibportstate [options] <dest dr_path|lid|guid> <portnum> [<op>]
+.SH DESCRIPTION
+.sp
+ibportstate allows the port state and port physical state of an IB port
+to be queried (in addition to link width and speed being validated
+relative to the peer port when the port queried is a switch port),
+or a switch port to be disabled, enabled, or reset. It
+also allows the link speed/width enabled on any IB port to be adjusted.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B \fB<op>\fP
+.INDENT 7.0
+.TP
+.B Supported ops: enable, disable, reset, speed, espeed, fdr10, width, query,
+.
+down, arm, active, vls, mtu, lid, smlid, lmc,
+mkey, mkeylease, mkeyprot
+(Default is query)
+.UNINDENT
+.sp
+\fBenable, disable, and reset\fP are only allowed on switch ports (An
+error is indicated if attempted on CA or router ports)
+.sp
+\fBspeed and width\fP are allowed on any port
+.sp
+\fBspeed\fP values are the legal values for PortInfo:LinkSpeedEnabled (An
+error is indicated if PortInfo:LinkSpeedSupported does not support this
+setting)
+.sp
+\fBespeed\fP is allowed on any port supporting extended link speeds
+.sp
+\fBfdr10\fP is allowed on any port supporting fdr10 (An error is
+indicated if port\(aqs capability mask indicates extended link speeds are
+not supported or if PortInfo:LinkSpeedExtSupported does not support
+this setting)
+.sp
+\fBwidth\fP values are legal values for PortInfo:LinkWidthEnabled (An
+error is indicated if PortInfo:LinkWidthSupported does not support this
+setting) (NOTE: Speed and width changes are not effected until the port
+goes through link renegotiation)
+.sp
+\fBquery\fP also validates port characteristics (link width, speed,
+espeed, and fdr10) based on the peer port. This checking is done when
+the port queried is a switch port as it relies on combined routing (an
+initial LID route with directed routing to the peer) which can only be
+done on a switch. This peer port validation feature of query op
+requires LID routing to be functioning in the subnet.
+.sp
+\fBmkey, mkeylease, and mkeyprot\fP are only allowed on CAs, routers, or
+switch port 0 (An error is generated if attempted on external switch
+ports).  Hexadecimal and octal mkeys may be specified by prepending the
+key with \(aq0x\(aq or \(aq0\(aq, respectively.  If a non\-numeric value (like \(aqx\(aq)
+is specified for the mkey, then ibportstate will prompt for a value.
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -K
+.
+.INDENT 0.0
+.TP
+.B \fB\-K, \-\-show_keys\fP
+.sp
+show security keys (mkey, smkey, etc.) associated with the request.
+.UNINDENT
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SH EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+ibportstate 3 1 disable                  # by lid
+ibportstate \-G 0x2C9000100D051 1 enable  # by guid
+ibportstate \-D 0 1                       # (query) by direct route
+ibportstate 3 1 reset                    # by lid
+ibportstate 3 1 speed 1                  # by lid
+ibportstate 3 1 width 1                  # by lid
+ibportstate \-D 0 1 lid 0x1234 arm        # by direct route
+.UNINDENT
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal.rosenstock at gmail.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibqueryerrors.8 b/doc/man/ibqueryerrors.8
new file mode 100644
index 0000000..a963449
--- /dev/null
+++ b/doc/man/ibqueryerrors.8
@@ -0,0 +1,327 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBQUERYERRORS 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBQUERYERRORS \- query and report IB port counters
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibqueryerrors [options]
+.SH DESCRIPTION
+.sp
+The default behavior is to report the port error counters which exceed a
+threshold for each port in the fabric.  The default threshold is zero (0).
+Error fields can also be suppressed entirely.
+.sp
+In addition to reporting errors on every port.  ibqueryerrors can report the
+port transmit and receive data as well as report full link information to the
+remote port if available.
+.SH OPTIONS
+.sp
+\fB\-s, \-\-suppress <err1,err2,...>\fP
+Suppress the errors listed in the comma separated list provided.
+.sp
+\fB\-c, \-\-suppress\-common\fP
+Suppress some of the common "side effect" counters.  These counters usually do
+not indicate an error condition and can be usually be safely ignored.
+.sp
+\fB\-r, \-\-report\-port\fP
+Report the port information.  This includes LID, port, external port (if
+applicable), link speed setting, remote GUID, remote port, remote external port
+(if applicable), and remote node description information.
+.sp
+\fB\-\-data\fP
+Include the optional transmit and receive data counters.
+.sp
+\fB\-\-threshold\-file <filename>\fP
+Specify an alternate threshold file.  The default is /usr/local/etc/infiniband-diags/error_thresholds
+.sp
+\fB\-\-switch\fP  print data for switch\(aqs only
+.sp
+\fB\-\-ca\fP  print data for CA\(aqs only
+.sp
+\fB\-\-router\fP  print data for routers only
+.sp
+\fB\-\-clear\-errors \-k\fP Clear error counters after read.
+.sp
+\fB\-\-clear\-counts \-K\fP Clear data counters after read.
+.sp
+\fBCAUTION\fP clearing data or error counters will occur regardless of if they
+are printed or not.  See \fB\-\-counters\fP and \fB\-\-data\fP for details on
+controling which counters are printed.
+.sp
+\fB\-\-details\fP include receive error and transmit discard details
+.sp
+\fB\-\-counters\fP print data counters only
+.SS Partial Scan flags
+.sp
+The node to start a partial scan can be specified with the following addresses.
+.\" Define the common option -G
+.
+.sp
+\fB\-\-port\-guid, \-G <port_guid>\fP  Specify a port_guid
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   \-D "0"          # self port
+   \-D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.sp
+\fBNote:\fP For switches results are printed for all ports not just switch port 0.
+.sp
+\fB\-S <port_guid>\fP same as "\-G". (provided only for backward compatibility)
+.SS Cache File flags
+.\" Define the common option load-cache
+.
+.sp
+\fB\-\-load\-cache <filename>\fP
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.sp
+\fB\-R\fP  (This option is obsolete and does nothing)
+.SH EXIT STATUS
+.sp
+\fB\-1\fP if scan fails.
+.sp
+\fB0\fP if scan succeeds without errors beyond thresholds
+.sp
+\fB1\fP if errors are found beyond thresholds or inconsistencies are found in check mode.
+.SH FILES
+.SS ERROR THRESHOLD
+.sp
+/usr/local/etc/infiniband-diags/error_thresholds
+.sp
+Define threshold values for errors.  File format is simple "name=val".
+Comments begin with \(aq#\(aq
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# Define thresholds for error counters
+SymbolErrorCounter=10
+LinkErrorRecoveryCounter=10
+VL15Dropped=100
+.ft P
+.fi
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibqueryerrors.8.in b/doc/man/ibqueryerrors.8.in
new file mode 100644
index 0000000..31158aa
--- /dev/null
+++ b/doc/man/ibqueryerrors.8.in
@@ -0,0 +1,327 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBQUERYERRORS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBQUERYERRORS \- query and report IB port counters
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibqueryerrors [options]
+.SH DESCRIPTION
+.sp
+The default behavior is to report the port error counters which exceed a
+threshold for each port in the fabric.  The default threshold is zero (0).
+Error fields can also be suppressed entirely.
+.sp
+In addition to reporting errors on every port.  ibqueryerrors can report the
+port transmit and receive data as well as report full link information to the
+remote port if available.
+.SH OPTIONS
+.sp
+\fB\-s, \-\-suppress <err1,err2,...>\fP
+Suppress the errors listed in the comma separated list provided.
+.sp
+\fB\-c, \-\-suppress\-common\fP
+Suppress some of the common "side effect" counters.  These counters usually do
+not indicate an error condition and can be usually be safely ignored.
+.sp
+\fB\-r, \-\-report\-port\fP
+Report the port information.  This includes LID, port, external port (if
+applicable), link speed setting, remote GUID, remote port, remote external port
+(if applicable), and remote node description information.
+.sp
+\fB\-\-data\fP
+Include the optional transmit and receive data counters.
+.sp
+\fB\-\-threshold\-file <filename>\fP
+Specify an alternate threshold file.  The default is @IBDIAG_CONFIG_PATH@/error_thresholds
+.sp
+\fB\-\-switch\fP  print data for switch\(aqs only
+.sp
+\fB\-\-ca\fP  print data for CA\(aqs only
+.sp
+\fB\-\-router\fP  print data for routers only
+.sp
+\fB\-\-clear\-errors \-k\fP Clear error counters after read.
+.sp
+\fB\-\-clear\-counts \-K\fP Clear data counters after read.
+.sp
+\fBCAUTION\fP clearing data or error counters will occur regardless of if they
+are printed or not.  See \fB\-\-counters\fP and \fB\-\-data\fP for details on
+controling which counters are printed.
+.sp
+\fB\-\-details\fP include receive error and transmit discard details
+.sp
+\fB\-\-counters\fP print data counters only
+.SS Partial Scan flags
+.sp
+The node to start a partial scan can be specified with the following addresses.
+.\" Define the common option -G
+.
+.sp
+\fB\-\-port\-guid, \-G <port_guid>\fP  Specify a port_guid
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   \-D "0"          # self port
+   \-D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.sp
+\fBNote:\fP For switches results are printed for all ports not just switch port 0.
+.sp
+\fB\-S <port_guid>\fP same as "\-G". (provided only for backward compatibility)
+.SS Cache File flags
+.\" Define the common option load-cache
+.
+.sp
+\fB\-\-load\-cache <filename>\fP
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.sp
+\fB\-R\fP  (This option is obsolete and does nothing)
+.SH EXIT STATUS
+.sp
+\fB\-1\fP if scan fails.
+.sp
+\fB0\fP if scan succeeds without errors beyond thresholds
+.sp
+\fB1\fP if errors are found beyond thresholds or inconsistencies are found in check mode.
+.SH FILES
+.SS ERROR THRESHOLD
+.sp
+ at IBDIAG_CONFIG_PATH@/error_thresholds
+.sp
+Define threshold values for errors.  File format is simple "name=val".
+Comments begin with \(aq#\(aq
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# Define thresholds for error counters
+SymbolErrorCounter=10
+LinkErrorRecoveryCounter=10
+VL15Dropped=100
+.ft P
+.fi
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibroute.8 b/doc/man/ibroute.8
new file mode 100644
index 0000000..3b59684
--- /dev/null
+++ b/doc/man/ibroute.8
@@ -0,0 +1,235 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBROUTE 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBROUTE \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand switch forwarding tables
+.SS SYNOPSIS
+.sp
+ibroute [options] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
+.SS DESCRIPTION
+.sp
+ibroute uses SMPs to display the forwarding tables (unicast
+(LinearForwardingTable or LFT) or multicast (MulticastForwardingTable or MFT))
+for the specified switch LID and the optional lid (mlid) range.
+The default range is all valid entries in the range 1...FDBTop.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-a, \-\-all\fP
+.sp
+show all lids in range, even invalid entries
+.TP
+.B \fB\-n, \-\-no_dests\fP
+.sp
+do not try to resolve destinations
+.TP
+.B \fB\-M, \-\-Multicast\fP
+.sp
+show multicast forwarding tables
+In this case, the range parameters are specifying the mlid range.
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.sp
+Unicast examples
+.INDENT 0.0
+.TP
+.B ::
+.
+ibroute 4               # dump all lids with valid out ports of switch with lid 4
+ibroute \-a 4            # same, but dump all lids, even with invalid out ports
+ibroute \-n 4            # simple dump format \- no destination resolution
+ibroute 4 10            # dump lids starting from 10 (up to FDBTop)
+ibroute 4 0x10 0x20     # dump lid range
+ibroute \-G 0x08f1040023 # resolve switch by GUID
+ibroute \-D 0,1          # resolve switch by direct path
+.UNINDENT
+.sp
+Multicast examples
+.INDENT 0.0
+.TP
+.B ::
+.
+ibroute \-M 4                # dump all non empty mlids of switch with lid 4
+ibroute \-M 4 0xc010 0xc020  # same, but with range
+ibroute \-M \-n 4             # simple dump format
+.UNINDENT
+.SS SEE ALSO
+.sp
+ibtracert (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibroute.8.in b/doc/man/ibroute.8.in
new file mode 100644
index 0000000..53992cd
--- /dev/null
+++ b/doc/man/ibroute.8.in
@@ -0,0 +1,235 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBROUTE 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBROUTE \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand switch forwarding tables
+.SS SYNOPSIS
+.sp
+ibroute [options] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
+.SS DESCRIPTION
+.sp
+ibroute uses SMPs to display the forwarding tables (unicast
+(LinearForwardingTable or LFT) or multicast (MulticastForwardingTable or MFT))
+for the specified switch LID and the optional lid (mlid) range.
+The default range is all valid entries in the range 1...FDBTop.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-a, \-\-all\fP
+.sp
+show all lids in range, even invalid entries
+.TP
+.B \fB\-n, \-\-no_dests\fP
+.sp
+do not try to resolve destinations
+.TP
+.B \fB\-M, \-\-Multicast\fP
+.sp
+show multicast forwarding tables
+In this case, the range parameters are specifying the mlid range.
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.sp
+Unicast examples
+.INDENT 0.0
+.TP
+.B ::
+.
+ibroute 4               # dump all lids with valid out ports of switch with lid 4
+ibroute \-a 4            # same, but dump all lids, even with invalid out ports
+ibroute \-n 4            # simple dump format \- no destination resolution
+ibroute 4 10            # dump lids starting from 10 (up to FDBTop)
+ibroute 4 0x10 0x20     # dump lid range
+ibroute \-G 0x08f1040023 # resolve switch by GUID
+ibroute \-D 0,1          # resolve switch by direct path
+.UNINDENT
+.sp
+Multicast examples
+.INDENT 0.0
+.TP
+.B ::
+.
+ibroute \-M 4                # dump all non empty mlids of switch with lid 4
+ibroute \-M 4 0xc010 0xc020  # same, but with range
+ibroute \-M \-n 4             # simple dump format
+.UNINDENT
+.SS SEE ALSO
+.sp
+ibtracert (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibrouters.8 b/doc/man/ibrouters.8
new file mode 100644
index 0000000..1429834
--- /dev/null
+++ b/doc/man/ibrouters.8
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBROUTERS 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBROUTERS \- show InfiniBand router nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibrouters [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibrouters is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the router nodes.
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibrouters.8.in b/doc/man/ibrouters.8.in
new file mode 100644
index 0000000..3419cc4
--- /dev/null
+++ b/doc/man/ibrouters.8.in
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBROUTERS 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBROUTERS \- show InfiniBand router nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibrouters [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibrouters is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the router nodes.
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibstat.8 b/doc/man/ibstat.8
new file mode 100644
index 0000000..98e6aa5
--- /dev/null
+++ b/doc/man/ibstat.8
@@ -0,0 +1,129 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSTAT 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBSTAT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query basic status of InfiniBand device(s)
+.SS SYNOPSIS
+.sp
+ibstat [options] <ca_name> [portnum]
+.SS DESCRIPTION
+.sp
+ibstat is a binary which displays basic information obtained from the local
+IB driver. Output includes LID, SMLID, port state, link width active, and port
+physical state.
+.sp
+It is similar to the ibstatus utility but implemented as a binary rather
+than a script. It has options to list CAs and/or ports and displays more
+information than ibstatus.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-l, \-\-list_of_cas\fP
+.sp
+list all IB devices
+.TP
+.B \fB\-s, \-\-short\fP
+.sp
+short output
+.TP
+.B \fB\-p, \-\-port_list\fP
+.sp
+show port list
+.TP
+.B \fBca_name\fP
+.sp
+InfiniBand device name
+.TP
+.B \fBportnum\fP
+.sp
+port number of InfiniBand device
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+ibstat            # display status of all ports on all IB devices
+ibstat \-l         # list all IB devices
+ibstat \-p         # show port guids
+ibstat mthca0 2   # show status of port 2 of \(aqmthca0\(aq
+.UNINDENT
+.SS SEE ALSO
+.sp
+ibstatus (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibstat.8.in b/doc/man/ibstat.8.in
new file mode 100644
index 0000000..c53173a
--- /dev/null
+++ b/doc/man/ibstat.8.in
@@ -0,0 +1,129 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSTAT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBSTAT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query basic status of InfiniBand device(s)
+.SS SYNOPSIS
+.sp
+ibstat [options] <ca_name> [portnum]
+.SS DESCRIPTION
+.sp
+ibstat is a binary which displays basic information obtained from the local
+IB driver. Output includes LID, SMLID, port state, link width active, and port
+physical state.
+.sp
+It is similar to the ibstatus utility but implemented as a binary rather
+than a script. It has options to list CAs and/or ports and displays more
+information than ibstatus.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-l, \-\-list_of_cas\fP
+.sp
+list all IB devices
+.TP
+.B \fB\-s, \-\-short\fP
+.sp
+short output
+.TP
+.B \fB\-p, \-\-port_list\fP
+.sp
+show port list
+.TP
+.B \fBca_name\fP
+.sp
+InfiniBand device name
+.TP
+.B \fBportnum\fP
+.sp
+port number of InfiniBand device
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+ibstat            # display status of all ports on all IB devices
+ibstat \-l         # list all IB devices
+ibstat \-p         # show port guids
+ibstat mthca0 2   # show status of port 2 of \(aqmthca0\(aq
+.UNINDENT
+.SS SEE ALSO
+.sp
+ibstatus (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibstatus.8 b/doc/man/ibstatus.8
new file mode 100644
index 0000000..c5aa3cb
--- /dev/null
+++ b/doc/man/ibstatus.8
@@ -0,0 +1,78 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSTATUS 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBSTATUS \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query basic status of InfiniBand device(s)
+.SS SYNOPSIS
+.sp
+ibstatus [\-h] [devname[:port]]...
+.SS DESCRIPTION
+.sp
+ibstatus is a script which displays basic information obtained from the local
+IB driver. Output includes LID, SMLID, port state, link width active, and port
+physical state.
+.SS OPTIONS
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.INDENT 0.0
+.TP
+.B \fBdevname\fP
+.sp
+InfiniBand device name
+.TP
+.B \fBportnum\fP
+.sp
+port number of InfiniBand device
+.UNINDENT
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+ibstatus                    # display status of all IB ports
+ibstatus mthca1             # status of mthca1 ports
+ibstatus mthca1:1 mthca0:2  # show status of specified ports
+.UNINDENT
+.SS SEE ALSO
+.sp
+\fBibstat (8)\fP
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibstatus.8.in b/doc/man/ibstatus.8.in
new file mode 100644
index 0000000..704f5dc
--- /dev/null
+++ b/doc/man/ibstatus.8.in
@@ -0,0 +1,78 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSTATUS 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBSTATUS \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query basic status of InfiniBand device(s)
+.SS SYNOPSIS
+.sp
+ibstatus [\-h] [devname[:port]]...
+.SS DESCRIPTION
+.sp
+ibstatus is a script which displays basic information obtained from the local
+IB driver. Output includes LID, SMLID, port state, link width active, and port
+physical state.
+.SS OPTIONS
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.INDENT 0.0
+.TP
+.B \fBdevname\fP
+.sp
+InfiniBand device name
+.TP
+.B \fBportnum\fP
+.sp
+port number of InfiniBand device
+.UNINDENT
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+ibstatus                    # display status of all IB ports
+ibstatus mthca1             # status of mthca1 ports
+ibstatus mthca1:1 mthca0:2  # show status of specified ports
+.UNINDENT
+.SS SEE ALSO
+.sp
+\fBibstat (8)\fP
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibswitches.8 b/doc/man/ibswitches.8
new file mode 100644
index 0000000..a2c458e
--- /dev/null
+++ b/doc/man/ibswitches.8
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSWITCHES 8 "" "" "OpenIB Diagnostics"
+.SH NAME
+IBSWITCHES \- show InfiniBand switch nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibswitches [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibswitches is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the switch nodes.
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibswitches.8.in b/doc/man/ibswitches.8.in
new file mode 100644
index 0000000..3f6c7e5
--- /dev/null
+++ b/doc/man/ibswitches.8.in
@@ -0,0 +1,169 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSWITCHES 8 "@BUILD_DATE@" "" "OpenIB Diagnostics"
+.SH NAME
+IBSWITCHES \- show InfiniBand switch nodes in topology
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH SYNOPSIS
+.sp
+ibswitches [options] [<topology\-file>]
+.SH DESCRIPTION
+.sp
+ibswitches is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the switch nodes.
+.SH OPTIONS
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SH FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SH SEE ALSO
+.sp
+ibnetdiscover(8)
+.SH DEPENDENCIES
+.sp
+ibnetdiscover, ibnetdiscover format
+.SH AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibsysstat.8 b/doc/man/ibsysstat.8
new file mode 100644
index 0000000..a21c082
--- /dev/null
+++ b/doc/man/ibsysstat.8
@@ -0,0 +1,184 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSYSSTAT 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBSYSSTAT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH system status on an InfiniBand address
+.SS SYNOPSIS
+.sp
+ibsysstat [options] <dest lid | guid> [<op>]
+.SS DESCRIPTION
+.sp
+ibsysstat uses vendor mads to validate connectivity between IB nodes
+and obtain other information about the IB node. ibsysstat is run as
+client/server. Default is to run as client.
+.SS OPTIONS
+.sp
+Current supported operations:
+.INDENT 0.0
+.TP
+.B ::
+.
+ping \- verify connectivity to server (default)
+host \- obtain host information from server
+cpu  \- obtain cpu information from server
+.TP
+.B \fB\-o, \-\-oui\fP
+.sp
+use specified OUI number to multiplex vendor mads
+.TP
+.B \fB\-S, \-\-Server\fP
+.sp
+start in server mode (do not return)
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibsysstat.8.in b/doc/man/ibsysstat.8.in
new file mode 100644
index 0000000..68f6f51
--- /dev/null
+++ b/doc/man/ibsysstat.8.in
@@ -0,0 +1,184 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBSYSSTAT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBSYSSTAT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH system status on an InfiniBand address
+.SS SYNOPSIS
+.sp
+ibsysstat [options] <dest lid | guid> [<op>]
+.SS DESCRIPTION
+.sp
+ibsysstat uses vendor mads to validate connectivity between IB nodes
+and obtain other information about the IB node. ibsysstat is run as
+client/server. Default is to run as client.
+.SS OPTIONS
+.sp
+Current supported operations:
+.INDENT 0.0
+.TP
+.B ::
+.
+ping \- verify connectivity to server (default)
+host \- obtain host information from server
+cpu  \- obtain cpu information from server
+.TP
+.B \fB\-o, \-\-oui\fP
+.sp
+use specified OUI number to multiplex vendor mads
+.TP
+.B \fB\-S, \-\-Server\fP
+.sp
+start in server mode (do not return)
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibtracert.8 b/doc/man/ibtracert.8
new file mode 100644
index 0000000..3bef111
--- /dev/null
+++ b/doc/man/ibtracert.8
@@ -0,0 +1,268 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBTRACERT 8 "" "" "Open IB Diagnostics"
+.SH NAME
+IBTRACERT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH trace InfiniBand path
+.SS SYNOPSIS
+.sp
+ibtracert [options] [<lid|guid> [<startlid> [<endlid>]]]
+.SS DESCRIPTION
+.sp
+ibtracert uses SMPs to trace the path from a source GID/LID to a
+destination GID/LID. Each hop along the path is displayed until
+the destination is reached or a hop does not respond. By using
+the \-m option, multicast path tracing can be performed between source
+and destination nodes.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-n, \-\-no_info\fP
+.sp
+simple format; don\(aqt show additional information
+.TP
+.B \fB\-m\fP
+.sp
+show the multicast trace of the specified mlid
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS EXAMPLES
+.sp
+Unicast examples
+.INDENT 0.0
+.TP
+.B ::
+.
+ibtracert 4 16                                  # show path between lids 4 and 16
+ibtracert \-n 4 16                               # same, but using simple output format
+ibtracert \-G 0x8f1040396522d 0x002c9000100d051  # use guid addresses
+.UNINDENT
+.sp
+Multicast example
+.INDENT 0.0
+.TP
+.B ::
+.
+ibtracert \-m 0xc000 4 16    # show multicast path of mlid 0xc000 between lids 4 and 16
+.UNINDENT
+.SS SEE ALSO
+.sp
+ibroute (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+<\fI\%hal.rosenstock at gmail.com\fP>
+.TP
+.B Ira Weiny
+.
+<\fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/ibtracert.8.in b/doc/man/ibtracert.8.in
new file mode 100644
index 0000000..0b0ae59
--- /dev/null
+++ b/doc/man/ibtracert.8.in
@@ -0,0 +1,268 @@
+.\" Man page generated from reStructeredText.
+.
+.TH IBTRACERT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+IBTRACERT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH trace InfiniBand path
+.SS SYNOPSIS
+.sp
+ibtracert [options] [<lid|guid> [<startlid> [<endlid>]]]
+.SS DESCRIPTION
+.sp
+ibtracert uses SMPs to trace the path from a source GID/LID to a
+destination GID/LID. Each hop along the path is displayed until
+the destination is reached or a hop does not respond. By using
+the \-m option, multicast path tracing can be performed between source
+and destination nodes.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-n, \-\-no_info\fP
+.sp
+simple format; don\(aqt show additional information
+.TP
+.B \fB\-m\fP
+.sp
+show the multicast trace of the specified mlid
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS EXAMPLES
+.sp
+Unicast examples
+.INDENT 0.0
+.TP
+.B ::
+.
+ibtracert 4 16                                  # show path between lids 4 and 16
+ibtracert \-n 4 16                               # same, but using simple output format
+ibtracert \-G 0x8f1040396522d 0x002c9000100d051  # use guid addresses
+.UNINDENT
+.sp
+Multicast example
+.INDENT 0.0
+.TP
+.B ::
+.
+ibtracert \-m 0xc000 4 16    # show multicast path of mlid 0xc000 between lids 4 and 16
+.UNINDENT
+.SS SEE ALSO
+.sp
+ibroute (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+<\fI\%hal.rosenstock at gmail.com\fP>
+.TP
+.B Ira Weiny
+.
+<\fI\%weiny2 at llnl.gov\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/infiniband-diags.8 b/doc/man/infiniband-diags.8
new file mode 100644
index 0000000..e382db5
--- /dev/null
+++ b/doc/man/infiniband-diags.8
@@ -0,0 +1,447 @@
+.\" Man page generated from reStructeredText.
+.
+.TH INFINIBAND-DIAGS 8 "" "" "Open IB Diagnostics"
+.SH NAME
+INFINIBAND-DIAGS \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH Diagnostics for InfiniBand Fabrics
+.SS DESCRIPTION
+.sp
+infiniband\-diags is a set of utilities designed to help configure, debug, and
+maintain infiniband fabrics.  Many tools and utilities are provided.  Some with
+similar functionality.
+.sp
+The base utilities use directed route MAD\(aqs to perform their operations.  They
+may therefore work even in unconfigured subnets.  Other, higher level
+utilities, require LID routed MAD\(aqs and to some extent SA/SM access.
+.SS THE USE OF SMPs (QP0)
+.sp
+Many of the tools in this package rely on the use of SMPs via QP0 to acquire
+data directly from the SMA.  While this mode of operation is not technically in
+compliance with the InfiniBand specification, practical experience has found
+that this level of diagnostics is valuable when working with a fabric which is
+broken or only partially configured.  For this reason many of these tools may
+require the use of an MKey or operation from Virtual Machines may be restricted
+for security reasons.
+.SS COMMON OPTIONS
+.sp
+Most OpenIB diagnostics take some of the following common flags. The exact list
+of supported flags per utility can be found in the documentation for those
+commands.
+.SS Addressing Flags
+.sp
+The \-D and \-G option have two forms:
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   \-D "0"          # self port
+   \-D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -G
+.
+.sp
+\fB\-\-port\-guid, \-G <port_guid>\fP  Specify a port_guid
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS COMMON FILES
+.sp
+The following config files are common amongst many of the utilities.
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.\" Common text to describe the Topology file.
+.
+.SS TOPOLOGY FILE FORMAT
+.sp
+The topology file format is human readable and largely intuitive.
+Most identifiers are given textual names like vendor ID (vendid), device ID
+(device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).
+PortGUIDs are shown in parentheses ().  For switches, this is shown on the
+switchguid line.  For CA and router ports, it is shown on the connectivity
+lines.  The IB node is identified followed by the number of ports and a quoted
+the node GUID.  On the right of this line is a comment (#) followed by the
+NodeDescription in quotes.  If the node is a switch, this line also contains
+whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
+Subsequent lines pertaining to this node show the connectivity.   On the
+left is the port number of the current node.  On the right is the peer node
+(node at other end of link). It is identified in quotes with nodetype
+followed by \- followed by NodeGUID with the port number in square brackets.
+Further on the right is a comment (#).  What follows the comment is
+dependent on the node type.  If it it a switch node, it is followed by
+the NodeDescription in quotes and the LID of the peer node.  If it is a
+CA or router node, it is followed by the local LID and LMC and then
+followed by the NodeDescription in quotes and the LID of the peer node.
+The active link width and speed are then appended to the end of this
+output line.
+.sp
+An example of this is:
+.sp
+.nf
+.ft C
+#
+# Topology file: generated on Tue Jun  5 14:15:10 2007
+#
+# Max of 3 hops discovered
+# Initiated from node 0008f10403960558 port 0008f10403960559
+
+Non\-Chassis Nodes
+
+vendid=0x8f1
+devid=0x5a06
+sysimgguid=0x5442ba00003000
+switchguid=0x5442ba00003080(5442ba00003080)
+Switch  24 "S\-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
+[22]    "H\-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
+[10]    "S\-0008f10400410015"[1]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[8]     "H\-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
+[6]     "S\-0008f10400410015"[3]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[12]    "H\-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
+
+vendid=0x8f1
+devid=0x5a05
+switchguid=0x8f10400410015(8f10400410015)
+Switch  8 "S\-0008f10400410015"          # "SW\-6IB4 Voltaire" base port 0 lid 3 lmc 0
+[6]     "H\-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
+[4]     "H\-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
+[1]     "S\-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
+[3]     "S\-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960984
+Ca      2 "H\-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403960985)     "S\-0008f10400410015"[6]         # lid 16 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x5442b100004900
+Ca      2 "H\-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](5442b100004901)     "S\-0008f10400410015"[4]         # lid 12 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403961354
+Ca      2 "H\-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403961355)     "S\-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960558
+Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
+[2](8f1040396055a)     "S\-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+[1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
+.ft P
+.fi
+.sp
+When grouping is used, IB nodes are organized into chassis which are
+numbered. Nodes which cannot be determined to be in a chassis are
+displayed as "Non\-Chassis Nodes".  External ports are also shown on the
+connectivity lines.
+.SS Utilities list
+.SS Basic fabric conectivity
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibnetdiscover, iblinkinfo
+.UNINDENT
+.UNINDENT
+.SS Node information
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibnodes, ibswitches, ibhosts, ibrouters
+.UNINDENT
+.UNINDENT
+.SS Port information
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibportstate, ibaddr
+.UNINDENT
+.UNINDENT
+.SS Switch Forwarding Table info
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibtracert, ibroute, dump_lfts, dump_mfts, check_lft_balance, ibfindnodesusing
+.UNINDENT
+.UNINDENT
+.SS Peformance counters
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibqueryerrors, perfquery
+.UNINDENT
+.UNINDENT
+.SS Local HCA info
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibstat, ibstatus
+.UNINDENT
+.UNINDENT
+.SS Connectivity check
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibping, ibsysstat
+.UNINDENT
+.UNINDENT
+.SS Low level query tools
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: smpquery, smpdump, saquery, sminfo
+.UNINDENT
+.UNINDENT
+.SS Fabric verification tools
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibidsverify
+.UNINDENT
+.UNINDENT
+.SS Backwards compatibility scripts
+.sp
+The following scripts have been identified as redundant and/or lower performing
+as compared to the above scripts.  They are provided as legacy scripts when
+\-\-enable\-compat\-utils is specified at build time.
+.sp
+ibcheckerrors, ibclearcounters, ibclearerrors, ibdatacounters
+ibchecknet, ibchecknode, ibcheckport, ibcheckportstate,
+ibcheckportwidth, ibcheckstate, ibcheckwidth, ibswportwatch,
+ibprintca, ibprintrt, ibprintswitch, set_nodedesc.sh
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+<\fI\%weiny2 at llnl.gov\fP>
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/infiniband-diags.8.in b/doc/man/infiniband-diags.8.in
new file mode 100644
index 0000000..80702ed
--- /dev/null
+++ b/doc/man/infiniband-diags.8.in
@@ -0,0 +1,447 @@
+.\" Man page generated from reStructeredText.
+.
+.TH INFINIBAND-DIAGS 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+INFINIBAND-DIAGS \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH Diagnostics for InfiniBand Fabrics
+.SS DESCRIPTION
+.sp
+infiniband\-diags is a set of utilities designed to help configure, debug, and
+maintain infiniband fabrics.  Many tools and utilities are provided.  Some with
+similar functionality.
+.sp
+The base utilities use directed route MAD\(aqs to perform their operations.  They
+may therefore work even in unconfigured subnets.  Other, higher level
+utilities, require LID routed MAD\(aqs and to some extent SA/SM access.
+.SS THE USE OF SMPs (QP0)
+.sp
+Many of the tools in this package rely on the use of SMPs via QP0 to acquire
+data directly from the SMA.  While this mode of operation is not technically in
+compliance with the InfiniBand specification, practical experience has found
+that this level of diagnostics is valuable when working with a fabric which is
+broken or only partially configured.  For this reason many of these tools may
+require the use of an MKey or operation from Virtual Machines may be restricted
+for security reasons.
+.SS COMMON OPTIONS
+.sp
+Most OpenIB diagnostics take some of the following common flags. The exact list
+of supported flags per utility can be found in the documentation for those
+commands.
+.SS Addressing Flags
+.sp
+The \-D and \-G option have two forms:
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct <dr_path>\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   \-D "0"          # self port
+   \-D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -G
+.
+.sp
+\fB\-\-port\-guid, \-G <port_guid>\fP  Specify a port_guid
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS COMMON FILES
+.sp
+The following config files are common amongst many of the utilities.
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.\" Common text to describe the Topology file.
+.
+.SS TOPOLOGY FILE FORMAT
+.sp
+The topology file format is human readable and largely intuitive.
+Most identifiers are given textual names like vendor ID (vendid), device ID
+(device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).
+PortGUIDs are shown in parentheses ().  For switches, this is shown on the
+switchguid line.  For CA and router ports, it is shown on the connectivity
+lines.  The IB node is identified followed by the number of ports and a quoted
+the node GUID.  On the right of this line is a comment (#) followed by the
+NodeDescription in quotes.  If the node is a switch, this line also contains
+whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
+Subsequent lines pertaining to this node show the connectivity.   On the
+left is the port number of the current node.  On the right is the peer node
+(node at other end of link). It is identified in quotes with nodetype
+followed by \- followed by NodeGUID with the port number in square brackets.
+Further on the right is a comment (#).  What follows the comment is
+dependent on the node type.  If it it a switch node, it is followed by
+the NodeDescription in quotes and the LID of the peer node.  If it is a
+CA or router node, it is followed by the local LID and LMC and then
+followed by the NodeDescription in quotes and the LID of the peer node.
+The active link width and speed are then appended to the end of this
+output line.
+.sp
+An example of this is:
+.sp
+.nf
+.ft C
+#
+# Topology file: generated on Tue Jun  5 14:15:10 2007
+#
+# Max of 3 hops discovered
+# Initiated from node 0008f10403960558 port 0008f10403960559
+
+Non\-Chassis Nodes
+
+vendid=0x8f1
+devid=0x5a06
+sysimgguid=0x5442ba00003000
+switchguid=0x5442ba00003080(5442ba00003080)
+Switch  24 "S\-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
+[22]    "H\-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
+[10]    "S\-0008f10400410015"[1]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[8]     "H\-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
+[6]     "S\-0008f10400410015"[3]         # "SW\-6IB4 Voltaire" lid 3 4xSDR
+[12]    "H\-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
+
+vendid=0x8f1
+devid=0x5a05
+switchguid=0x8f10400410015(8f10400410015)
+Switch  8 "S\-0008f10400410015"          # "SW\-6IB4 Voltaire" base port 0 lid 3 lmc 0
+[6]     "H\-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
+[4]     "H\-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
+[1]     "S\-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
+[3]     "S\-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960984
+Ca      2 "H\-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403960985)     "S\-0008f10400410015"[6]         # lid 16 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x5442b100004900
+Ca      2 "H\-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](5442b100004901)     "S\-0008f10400410015"[4]         # lid 12 lmc 1 "SW\-6IB4 Voltaire" lid 3 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403961354
+Ca      2 "H\-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
+[1](8f10403961355)     "S\-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+
+vendid=0x2c9
+devid=0x5a44
+caguid=0x8f10403960558
+Ca      2 "H\-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
+[2](8f1040396055a)     "S\-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+[1](8f10403960559)     "S\-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
+.ft P
+.fi
+.sp
+When grouping is used, IB nodes are organized into chassis which are
+numbered. Nodes which cannot be determined to be in a chassis are
+displayed as "Non\-Chassis Nodes".  External ports are also shown on the
+connectivity lines.
+.SS Utilities list
+.SS Basic fabric conectivity
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibnetdiscover, iblinkinfo
+.UNINDENT
+.UNINDENT
+.SS Node information
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibnodes, ibswitches, ibhosts, ibrouters
+.UNINDENT
+.UNINDENT
+.SS Port information
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibportstate, ibaddr
+.UNINDENT
+.UNINDENT
+.SS Switch Forwarding Table info
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibtracert, ibroute, dump_lfts, dump_mfts, check_lft_balance, ibfindnodesusing
+.UNINDENT
+.UNINDENT
+.SS Peformance counters
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibqueryerrors, perfquery
+.UNINDENT
+.UNINDENT
+.SS Local HCA info
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibstat, ibstatus
+.UNINDENT
+.UNINDENT
+.SS Connectivity check
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibping, ibsysstat
+.UNINDENT
+.UNINDENT
+.SS Low level query tools
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: smpquery, smpdump, saquery, sminfo
+.UNINDENT
+.UNINDENT
+.SS Fabric verification tools
+.INDENT 0.0
+.INDENT 3.5
+.sp
+See: ibidsverify
+.UNINDENT
+.UNINDENT
+.SS Backwards compatibility scripts
+.sp
+The following scripts have been identified as redundant and/or lower performing
+as compared to the above scripts.  They are provided as legacy scripts when
+\-\-enable\-compat\-utils is specified at build time.
+.sp
+ibcheckerrors, ibclearcounters, ibclearerrors, ibdatacounters
+ibchecknet, ibchecknode, ibcheckport, ibcheckportstate,
+ibcheckportwidth, ibcheckstate, ibcheckwidth, ibswportwatch,
+ibprintca, ibprintrt, ibprintswitch, set_nodedesc.sh
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+<\fI\%weiny2 at llnl.gov\fP>
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/perfquery.8 b/doc/man/perfquery.8
new file mode 100644
index 0000000..b1a5701
--- /dev/null
+++ b/doc/man/perfquery.8
@@ -0,0 +1,305 @@
+.\" Man page generated from reStructeredText.
+.
+.TH PERFQUERY 8 "" "" "Open IB Diagnostics"
+.SH NAME
+PERFQUERY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand port counters on a single port
+.SS SYNOPSIS
+.sp
+perfquery [options] [<lid|guid> [[port] [reset_mask]]]
+.SS DESCRIPTION
+.sp
+perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance and
+error counters), PortExtendedCounters, PortXmitDataSL, PortRcvDataSL,
+PortRcvErrorDetails, PortXmitDiscardDetails, PortExtendedSpeedsCounters, or
+PortSamplesControl from the PMA at the node/port specified. Optionally shows
+aggregated counters for all ports of node.  Finally it can, reset after read,
+or just reset the counters.
+.sp
+Note: In PortCounters, PortCountersExtended, PortXmitDataSL, and PortRcvDataSL,
+components that represent Data (e.g. PortXmitData and PortRcvData) indicate
+octets divided by 4 rather than just octets.
+.sp
+Note: Inputting a port of 255 indicates an operation be performed on all ports.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-x, \-\-extended\fP
+.sp
+show extended port counters rather than (basic) port counters.
+Note that extended port counters attribute is optional.
+.TP
+.B \fB\-X, \-\-xmtsl\fP
+.sp
+show transmit data SL counter. This is an optional counter for QoS.
+.TP
+.B \fB\-S, \-\-rcvsl\fP
+.sp
+show receive data SL counter. This is an optional counter for QoS.
+.TP
+.B \fB\-D, \-\-xmtdisc\fP
+.sp
+show transmit discard details. This is an optional counter.
+.TP
+.B \fB\-E, \-\-rcverr\fP
+.sp
+show receive error details. This is an optional counter.
+.TP
+.B \fB\-D, \-\-xmtdisc\fP
+.sp
+show transmit discard details. This is an optional counter.
+.TP
+.B \fB\-T, \-\-extended_speeds\fP
+.sp
+show extended speeds port counters. This is an optional counter.
+.TP
+.B \fB\-\-oprcvcounters\fP
+.sp
+show Rcv Counters per Op code. This is an optional counter.
+.TP
+.B \fB\-\-flowctlcounters\fP
+.sp
+show flow control counters. This is an optional counter.
+.TP
+.B \fB\-\-vloppackets\fP
+.sp
+show packets received per Op code per VL. This is an optional counter.
+.TP
+.B \fB\-\-vlopdata\fP
+.sp
+show data received per Op code per VL. This is an optional counter.
+.TP
+.B \fB\-\-vlxmitflowctlerrors\fP
+.sp
+show flow control update errors per VL. This is an optional counter.
+.TP
+.B \fB\-\-vlxmitcounters\fP
+.sp
+show ticks waiting to transmit counters per VL. This is an optional counter.
+.TP
+.B \fB\-\-swportvlcong\fP
+.sp
+show sw port VL congestion. This is an optional counter.
+.TP
+.B \fB\-\-rcvcc\fP
+.sp
+show Rcv congestion control counters. This is an optional counter.
+.TP
+.B \fB\-\-slrcvfecn\fP
+.sp
+show SL Rcv FECN counters. This is an optional counter.
+.TP
+.B \fB\-\-slrcvbecn\fP
+.sp
+show SL Rcv BECN counters. This is an optional counter.
+.TP
+.B \fB\-\-xmitcc\fP
+.sp
+show Xmit congestion control counters. This is an optional counter.
+.TP
+.B \fB\-\-vlxmittimecc\fP
+.sp
+show VL Xmit Time congestion control counters. This is an optional counter.
+.TP
+.B \fB\-c, \-\-smplctl\fP
+.sp
+show port samples control.
+.TP
+.B \fB\-a, \-\-all_ports\fP
+.sp
+show aggregated counters for all ports of the destination lid or reset
+all counters for all ports.  If the destination lid does not support
+the AllPortSelect flag, all ports will be iterated through to emulate
+AllPortSelect behavior.
+.TP
+.B \fB\-l, \-\-loop_ports\fP
+.sp
+If all ports are selected by the user (either through the \fB\-a\fP option
+or port 255) iterate through each port rather than doing than aggregate
+operation.
+.TP
+.B \fB\-r, \-\-reset_after_read\fP
+.sp
+reset counters after read
+.TP
+.B \fB\-R, \-\-Reset_only\fP
+.sp
+only reset counters
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+perfquery                # read local port performance counters
+perfquery 32 1           # read performance counters from lid 32, port 1
+perfquery \-x 32 1        # read extended performance counters from lid 32, port 1
+perfquery \-a 32          # read perf counters from lid 32, all ports
+perfquery \-r 32 1        # read performance counters and reset
+perfquery \-x \-r 32 1     # read extended performance counters and reset
+perfquery \-R 0x20 1      # reset performance counters of port 1 only
+perfquery \-x \-R 0x20 1   # reset extended performance counters of port 1 only
+perfquery \-R \-a 32       # reset performance counters of all ports
+perfquery \-R 32 2 0x0fff # reset only error counters of port 2
+perfquery \-R 32 2 0xf000 # reset only non\-error counters of port 2
+.UNINDENT
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal.rosenstock at gmail.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/perfquery.8.in b/doc/man/perfquery.8.in
new file mode 100644
index 0000000..5fef288
--- /dev/null
+++ b/doc/man/perfquery.8.in
@@ -0,0 +1,305 @@
+.\" Man page generated from reStructeredText.
+.
+.TH PERFQUERY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+PERFQUERY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand port counters on a single port
+.SS SYNOPSIS
+.sp
+perfquery [options] [<lid|guid> [[port] [reset_mask]]]
+.SS DESCRIPTION
+.sp
+perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance and
+error counters), PortExtendedCounters, PortXmitDataSL, PortRcvDataSL,
+PortRcvErrorDetails, PortXmitDiscardDetails, PortExtendedSpeedsCounters, or
+PortSamplesControl from the PMA at the node/port specified. Optionally shows
+aggregated counters for all ports of node.  Finally it can, reset after read,
+or just reset the counters.
+.sp
+Note: In PortCounters, PortCountersExtended, PortXmitDataSL, and PortRcvDataSL,
+components that represent Data (e.g. PortXmitData and PortRcvData) indicate
+octets divided by 4 rather than just octets.
+.sp
+Note: Inputting a port of 255 indicates an operation be performed on all ports.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-x, \-\-extended\fP
+.sp
+show extended port counters rather than (basic) port counters.
+Note that extended port counters attribute is optional.
+.TP
+.B \fB\-X, \-\-xmtsl\fP
+.sp
+show transmit data SL counter. This is an optional counter for QoS.
+.TP
+.B \fB\-S, \-\-rcvsl\fP
+.sp
+show receive data SL counter. This is an optional counter for QoS.
+.TP
+.B \fB\-D, \-\-xmtdisc\fP
+.sp
+show transmit discard details. This is an optional counter.
+.TP
+.B \fB\-E, \-\-rcverr\fP
+.sp
+show receive error details. This is an optional counter.
+.TP
+.B \fB\-D, \-\-xmtdisc\fP
+.sp
+show transmit discard details. This is an optional counter.
+.TP
+.B \fB\-T, \-\-extended_speeds\fP
+.sp
+show extended speeds port counters. This is an optional counter.
+.TP
+.B \fB\-\-oprcvcounters\fP
+.sp
+show Rcv Counters per Op code. This is an optional counter.
+.TP
+.B \fB\-\-flowctlcounters\fP
+.sp
+show flow control counters. This is an optional counter.
+.TP
+.B \fB\-\-vloppackets\fP
+.sp
+show packets received per Op code per VL. This is an optional counter.
+.TP
+.B \fB\-\-vlopdata\fP
+.sp
+show data received per Op code per VL. This is an optional counter.
+.TP
+.B \fB\-\-vlxmitflowctlerrors\fP
+.sp
+show flow control update errors per VL. This is an optional counter.
+.TP
+.B \fB\-\-vlxmitcounters\fP
+.sp
+show ticks waiting to transmit counters per VL. This is an optional counter.
+.TP
+.B \fB\-\-swportvlcong\fP
+.sp
+show sw port VL congestion. This is an optional counter.
+.TP
+.B \fB\-\-rcvcc\fP
+.sp
+show Rcv congestion control counters. This is an optional counter.
+.TP
+.B \fB\-\-slrcvfecn\fP
+.sp
+show SL Rcv FECN counters. This is an optional counter.
+.TP
+.B \fB\-\-slrcvbecn\fP
+.sp
+show SL Rcv BECN counters. This is an optional counter.
+.TP
+.B \fB\-\-xmitcc\fP
+.sp
+show Xmit congestion control counters. This is an optional counter.
+.TP
+.B \fB\-\-vlxmittimecc\fP
+.sp
+show VL Xmit Time congestion control counters. This is an optional counter.
+.TP
+.B \fB\-c, \-\-smplctl\fP
+.sp
+show port samples control.
+.TP
+.B \fB\-a, \-\-all_ports\fP
+.sp
+show aggregated counters for all ports of the destination lid or reset
+all counters for all ports.  If the destination lid does not support
+the AllPortSelect flag, all ports will be iterated through to emulate
+AllPortSelect behavior.
+.TP
+.B \fB\-l, \-\-loop_ports\fP
+.sp
+If all ports are selected by the user (either through the \fB\-a\fP option
+or port 255) iterate through each port rather than doing than aggregate
+operation.
+.TP
+.B \fB\-r, \-\-reset_after_read\fP
+.sp
+reset counters after read
+.TP
+.B \fB\-R, \-\-Reset_only\fP
+.sp
+only reset counters
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+perfquery                # read local port performance counters
+perfquery 32 1           # read performance counters from lid 32, port 1
+perfquery \-x 32 1        # read extended performance counters from lid 32, port 1
+perfquery \-a 32          # read perf counters from lid 32, all ports
+perfquery \-r 32 1        # read performance counters and reset
+perfquery \-x \-r 32 1     # read extended performance counters and reset
+perfquery \-R 0x20 1      # reset performance counters of port 1 only
+perfquery \-x \-R 0x20 1   # reset extended performance counters of port 1 only
+perfquery \-R \-a 32       # reset performance counters of all ports
+perfquery \-R 32 2 0x0fff # reset only error counters of port 2
+perfquery \-R 32 2 0xf000 # reset only non\-error counters of port 2
+.UNINDENT
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal.rosenstock at gmail.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/saquery.8 b/doc/man/saquery.8
new file mode 100644
index 0000000..50b2966
--- /dev/null
+++ b/doc/man/saquery.8
@@ -0,0 +1,387 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SAQUERY 8 "" "" "Open IB Diagnostics"
+.SH NAME
+SAQUERY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand subnet administration attributes
+.SS SYNOPSIS
+.sp
+saquery [options] [<name> | <lid> | <guid>]
+.SS DESCRIPTION
+.sp
+saquery issues the selected SA query. Node records are queried by default.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-p\fP
+.sp
+get PathRecord info
+.TP
+.B \fB\-N\fP
+.sp
+get NodeRecord info
+.TP
+.B \fB\-D, \-\-list\fP
+.sp
+get NodeDescriptions of CAs only
+.TP
+.B \fB\-S\fP
+.sp
+get ServiceRecord info
+.TP
+.B \fB\-I\fP
+.sp
+get InformInfoRecord (subscription) info
+.TP
+.B \fB\-L\fP
+.sp
+return the Lids of the name specified
+.TP
+.B \fB\-l\fP
+.sp
+return the unique Lid of the name specified
+.TP
+.B \fB\-G\fP
+.sp
+return the Guids of the name specified
+.TP
+.B \fB\-O\fP
+.sp
+return the name for the Lid specified
+.TP
+.B \fB\-U\fP
+.sp
+return the name for the Guid specified
+.TP
+.B \fB\-c\fP
+.sp
+get the SA\(aqs class port info
+.TP
+.B \fB\-s\fP
+.sp
+return the PortInfoRecords with isSM or isSMdisabled capability mask bit on
+.TP
+.B \fB\-g\fP
+.sp
+get multicast group info
+.TP
+.B \fB\-m\fP
+.sp
+get multicast member info.  If a group is specified, limit the output
+to the group specified and print one line containing only the GUID and
+node description for each entry. Example: saquery \-m 0xc000
+.TP
+.B \fB\-x\fP
+.sp
+get LinkRecord info
+.TP
+.B \fB\-\-src\-to\-dst <src:dst>\fP
+.sp
+get a PathRecord for <src:dst>
+where src and dst are either node names or LIDs
+.TP
+.B \fB\-\-sgid\-to\-dgid <sgid:dgid>\fP
+.sp
+get a PathRecord for \fBsgid\fP to \fBdgid\fP
+where both GIDs are in an IPv6 format acceptable to \fBinet_pton (3)\fP
+.TP
+.B \fB\-\-smkey <val>\fP
+.sp
+use SM_Key value for the query. Will be used only with "trusted"
+queries.  If non\-numeric value (like \(aqx\(aq) is specified then saquery
+will prompt for a value.
+Default (when not specified here or in
+/usr/local/etc/infiniband-diags/ibdiag.conf) is to use SM_Key == 0 (or
+"untrusted")
+.UNINDENT
+.\" Define the common option -K
+.
+.INDENT 0.0
+.TP
+.B \fB\-K, \-\-show_keys\fP
+.sp
+show security keys (mkey, smkey, etc.) associated with the request.
+.UNINDENT
+.sp
+\fB\-\-slid <lid>\fP Source LID (PathRecord)
+.sp
+\fB\-\-dlid <lid>\fP Destination LID (PathRecord)
+.sp
+\fB\-\-mlid <lid>\fP Multicast LID (MCMemberRecord)
+.sp
+\fB\-\-sgid <gid>\fP Source GID (IPv6 format) (PathRecord)
+.sp
+\fB\-\-dgid <gid>\fP Destination GID (IPv6 format) (PathRecord)
+.sp
+\fB\-\-gid <gid>\fP Port GID (MCMemberRecord)
+.sp
+\fB\-\-mgid <gid>\fP Multicast GID (MCMemberRecord)
+.sp
+\fB\-\-reversible\fP Reversible path (PathRecord)
+.sp
+\fB\-\-numb_path\fP Number of paths (PathRecord)
+.INDENT 0.0
+.TP
+.B \fB\-\-pkey\fP P_Key (PathRecord, MCMemberRecord). If non\-numeric value (like \(aqx\(aq)
+.sp
+is specified then saquery will prompt for a value
+.UNINDENT
+.sp
+\fB\-\-qos_class\fP QoS Class (PathRecord)
+.sp
+\fB\-\-sl\fP Service level (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-mtu\fP MTU and selector (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-rate\fP Rate and selector (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-pkt_lifetime\fP Packet lifetime and selector (PathRecord, MCMemberRecord)
+.INDENT 0.0
+.TP
+.B \fB\-\-qkey\fP Q_Key (MCMemberRecord). If non\-numeric value (like \(aqx\(aq) is specified
+.sp
+then saquery will prompt for a value
+.UNINDENT
+.sp
+\fB\-\-tclass\fP Traffic Class (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-flow_label\fP Flow Label (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-hop_limit\fP Hop limit (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-scope\fP Scope (MCMemberRecord)
+.sp
+\fB\-\-join_state\fP Join state (MCMemberRecord)
+.sp
+\fB\-\-proxy_join\fP Proxy join (MCMemberRecord)
+.sp
+Supported query names (and aliases):
+.INDENT 0.0
+.TP
+.B ::
+.
+ClassPortInfo (CPI)
+NodeRecord (NR) [lid]
+PortInfoRecord (PIR) [[lid]/[port]/[options]]
+SL2VLTableRecord (SL2VL) [[lid]/[in_port]/[out_port]]
+PKeyTableRecord (PKTR) [[lid]/[port]/[block]]
+VLArbitrationTableRecord (VLAR) [[lid]/[port]/[block]]
+InformInfoRecord (IIR)
+LinkRecord (LR) [[from_lid]/[from_port]] [[to_lid]/[to_port]]
+ServiceRecord (SR)
+PathRecord (PR)
+MCMemberRecord (MCMR)
+LFTRecord (LFTR) [[lid]/[block]]
+MFTRecord (MFTR) [[mlid]/[position]/[block]]
+GUIDInfoRecord (GIR) [[lid]/[block]]
+.UNINDENT
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS COMMON FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS DEPENDENCIES
+.sp
+OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/saquery.8.in b/doc/man/saquery.8.in
new file mode 100644
index 0000000..d7d3a5c
--- /dev/null
+++ b/doc/man/saquery.8.in
@@ -0,0 +1,387 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SAQUERY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+SAQUERY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand subnet administration attributes
+.SS SYNOPSIS
+.sp
+saquery [options] [<name> | <lid> | <guid>]
+.SS DESCRIPTION
+.sp
+saquery issues the selected SA query. Node records are queried by default.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-p\fP
+.sp
+get PathRecord info
+.TP
+.B \fB\-N\fP
+.sp
+get NodeRecord info
+.TP
+.B \fB\-D, \-\-list\fP
+.sp
+get NodeDescriptions of CAs only
+.TP
+.B \fB\-S\fP
+.sp
+get ServiceRecord info
+.TP
+.B \fB\-I\fP
+.sp
+get InformInfoRecord (subscription) info
+.TP
+.B \fB\-L\fP
+.sp
+return the Lids of the name specified
+.TP
+.B \fB\-l\fP
+.sp
+return the unique Lid of the name specified
+.TP
+.B \fB\-G\fP
+.sp
+return the Guids of the name specified
+.TP
+.B \fB\-O\fP
+.sp
+return the name for the Lid specified
+.TP
+.B \fB\-U\fP
+.sp
+return the name for the Guid specified
+.TP
+.B \fB\-c\fP
+.sp
+get the SA\(aqs class port info
+.TP
+.B \fB\-s\fP
+.sp
+return the PortInfoRecords with isSM or isSMdisabled capability mask bit on
+.TP
+.B \fB\-g\fP
+.sp
+get multicast group info
+.TP
+.B \fB\-m\fP
+.sp
+get multicast member info.  If a group is specified, limit the output
+to the group specified and print one line containing only the GUID and
+node description for each entry. Example: saquery \-m 0xc000
+.TP
+.B \fB\-x\fP
+.sp
+get LinkRecord info
+.TP
+.B \fB\-\-src\-to\-dst <src:dst>\fP
+.sp
+get a PathRecord for <src:dst>
+where src and dst are either node names or LIDs
+.TP
+.B \fB\-\-sgid\-to\-dgid <sgid:dgid>\fP
+.sp
+get a PathRecord for \fBsgid\fP to \fBdgid\fP
+where both GIDs are in an IPv6 format acceptable to \fBinet_pton (3)\fP
+.TP
+.B \fB\-\-smkey <val>\fP
+.sp
+use SM_Key value for the query. Will be used only with "trusted"
+queries.  If non\-numeric value (like \(aqx\(aq) is specified then saquery
+will prompt for a value.
+Default (when not specified here or in
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf) is to use SM_Key == 0 (or
+"untrusted")
+.UNINDENT
+.\" Define the common option -K
+.
+.INDENT 0.0
+.TP
+.B \fB\-K, \-\-show_keys\fP
+.sp
+show security keys (mkey, smkey, etc.) associated with the request.
+.UNINDENT
+.sp
+\fB\-\-slid <lid>\fP Source LID (PathRecord)
+.sp
+\fB\-\-dlid <lid>\fP Destination LID (PathRecord)
+.sp
+\fB\-\-mlid <lid>\fP Multicast LID (MCMemberRecord)
+.sp
+\fB\-\-sgid <gid>\fP Source GID (IPv6 format) (PathRecord)
+.sp
+\fB\-\-dgid <gid>\fP Destination GID (IPv6 format) (PathRecord)
+.sp
+\fB\-\-gid <gid>\fP Port GID (MCMemberRecord)
+.sp
+\fB\-\-mgid <gid>\fP Multicast GID (MCMemberRecord)
+.sp
+\fB\-\-reversible\fP Reversible path (PathRecord)
+.sp
+\fB\-\-numb_path\fP Number of paths (PathRecord)
+.INDENT 0.0
+.TP
+.B \fB\-\-pkey\fP P_Key (PathRecord, MCMemberRecord). If non\-numeric value (like \(aqx\(aq)
+.sp
+is specified then saquery will prompt for a value
+.UNINDENT
+.sp
+\fB\-\-qos_class\fP QoS Class (PathRecord)
+.sp
+\fB\-\-sl\fP Service level (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-mtu\fP MTU and selector (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-rate\fP Rate and selector (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-pkt_lifetime\fP Packet lifetime and selector (PathRecord, MCMemberRecord)
+.INDENT 0.0
+.TP
+.B \fB\-\-qkey\fP Q_Key (MCMemberRecord). If non\-numeric value (like \(aqx\(aq) is specified
+.sp
+then saquery will prompt for a value
+.UNINDENT
+.sp
+\fB\-\-tclass\fP Traffic Class (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-flow_label\fP Flow Label (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-hop_limit\fP Hop limit (PathRecord, MCMemberRecord)
+.sp
+\fB\-\-scope\fP Scope (MCMemberRecord)
+.sp
+\fB\-\-join_state\fP Join state (MCMemberRecord)
+.sp
+\fB\-\-proxy_join\fP Proxy join (MCMemberRecord)
+.sp
+Supported query names (and aliases):
+.INDENT 0.0
+.TP
+.B ::
+.
+ClassPortInfo (CPI)
+NodeRecord (NR) [lid]
+PortInfoRecord (PIR) [[lid]/[port]/[options]]
+SL2VLTableRecord (SL2VL) [[lid]/[in_port]/[out_port]]
+PKeyTableRecord (PKTR) [[lid]/[port]/[block]]
+VLArbitrationTableRecord (VLAR) [[lid]/[port]/[block]]
+InformInfoRecord (IIR)
+LinkRecord (LR) [[from_lid]/[from_port]] [[to_lid]/[to_port]]
+ServiceRecord (SR)
+PathRecord (PR)
+MCMemberRecord (MCMR)
+LFTRecord (LFTR) [[lid]/[block]]
+MFTRecord (MFTR) [[mlid]/[position]/[block]]
+GUIDInfoRecord (GIR) [[lid]/[block]]
+.UNINDENT
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.INDENT 0.0
+.TP
+.B \fB\-\-outstanding_smps, \-o <val>\fP
+.sp
+Specify the number of outstanding SMP\(aqs which should be issued during the scan
+.sp
+Default: 2
+.UNINDENT
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS COMMON FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS DEPENDENCIES
+.sp
+OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
+.SS AUTHORS
+.INDENT 0.0
+.TP
+.B Ira Weiny
+.
+< \fI\%weiny2 at llnl.gov\fP >
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/sminfo.8 b/doc/man/sminfo.8
new file mode 100644
index 0000000..8b0fceb
--- /dev/null
+++ b/doc/man/sminfo.8
@@ -0,0 +1,218 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SMINFO 8 "" "" "Open IB Diagnostics"
+.SH NAME
+SMINFO \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand SMInfo attribute
+.SS SYNOPSIS
+.sp
+sminfo [options] sm_lid | sm_dr_path [modifier]
+.SS DESCRIPTION
+.sp
+Optionally set and display the output of a sminfo query in human readable
+format. The target SM is the one listed in the local port info, or the SM
+specified by the optional SM lid or by the SM direct routed path.
+.sp
+Note: using sminfo for any purposes other then simple query may be very
+dangerous, and may result in a malfunction of the target SM.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-s, \-\-state <state>\fP set SM state
+.sp
+0 not active
+.sp
+1 discovering
+.sp
+2 standby
+.sp
+3 master
+.UNINDENT
+.sp
+\fB\-p, \-\-priority <priority>\fP set priority (0\-15)
+.sp
+\fB\-a, \-\-activity <val>\fP set activity count
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+sminfo                  # local port\(aqs sminfo
+sminfo 32               # show sminfo of lid 32
+sminfo  \-G 0x8f1040023  # same but using guid address
+.UNINDENT
+.SS SEE ALSO
+.sp
+smpdump (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/sminfo.8.in b/doc/man/sminfo.8.in
new file mode 100644
index 0000000..8bc9f48
--- /dev/null
+++ b/doc/man/sminfo.8.in
@@ -0,0 +1,218 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SMINFO 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+SMINFO \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand SMInfo attribute
+.SS SYNOPSIS
+.sp
+sminfo [options] sm_lid | sm_dr_path [modifier]
+.SS DESCRIPTION
+.sp
+Optionally set and display the output of a sminfo query in human readable
+format. The target SM is the one listed in the local port info, or the SM
+specified by the optional SM lid or by the SM direct routed path.
+.sp
+Note: using sminfo for any purposes other then simple query may be very
+dangerous, and may result in a malfunction of the target SM.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-s, \-\-state <state>\fP set SM state
+.sp
+0 not active
+.sp
+1 discovering
+.sp
+2 standby
+.sp
+3 master
+.UNINDENT
+.sp
+\fB\-p, \-\-priority <priority>\fP set priority (0\-15)
+.sp
+\fB\-a, \-\-activity <val>\fP set activity count
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+sminfo                  # local port\(aqs sminfo
+sminfo 32               # show sminfo of lid 32
+sminfo  \-G 0x8f1040023  # same but using guid address
+.UNINDENT
+.SS SEE ALSO
+.sp
+smpdump (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/smpdump.8 b/doc/man/smpdump.8
new file mode 100644
index 0000000..64efc79
--- /dev/null
+++ b/doc/man/smpdump.8
@@ -0,0 +1,213 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SMPDUMP 8 "" "" "Open IB Diagnostics"
+.SH NAME
+SMPDUMP \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH dump InfiniBand subnet management attributes
+.SS SYNOPSIS
+.sp
+smpdump [options] <dlid|dr_path> <attribute> [attribute_modifier]
+.SS DESCRIPTION
+.sp
+smpdump is a general purpose SMP utility which gets SM attributes from a
+specified SMA. The result is dumped in hex by default.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fBdlid|drpath\fP
+.sp
+LID or DR path to SMA
+.TP
+.B \fBattribute\fP
+.sp
+IBA attribute ID for SM attribute
+.TP
+.B \fBattribute_modifier\fP
+.sp
+IBA modifier for SM attribute
+.TP
+.B \fB\-s, \-\-string\fP
+.sp
+Print strings in packet if possible
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.sp
+Direct Routed Examples
+.INDENT 0.0
+.TP
+.B ::
+.
+smpdump \-D 0,1,2,3,5 16 # NODE DESC
+smpdump \-D 0,1,2 0x15 2 # PORT INFO, port 2
+.UNINDENT
+.sp
+LID Routed Examples
+.INDENT 0.0
+.TP
+.B ::
+.
+smpdump 3 0x15 2        # PORT INFO, lid 3 port 2
+smpdump 0xa0 0x11       # NODE INFO, lid 0xa0
+.UNINDENT
+.SS SEE ALSO
+.sp
+smpquery (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/smpdump.8.in b/doc/man/smpdump.8.in
new file mode 100644
index 0000000..cebf273
--- /dev/null
+++ b/doc/man/smpdump.8.in
@@ -0,0 +1,213 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SMPDUMP 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+SMPDUMP \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH dump InfiniBand subnet management attributes
+.SS SYNOPSIS
+.sp
+smpdump [options] <dlid|dr_path> <attribute> [attribute_modifier]
+.SS DESCRIPTION
+.sp
+smpdump is a general purpose SMP utility which gets SM attributes from a
+specified SMA. The result is dumped in hex by default.
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fBdlid|drpath\fP
+.sp
+LID or DR path to SMA
+.TP
+.B \fBattribute\fP
+.sp
+IBA attribute ID for SM attribute
+.TP
+.B \fBattribute_modifier\fP
+.sp
+IBA modifier for SM attribute
+.TP
+.B \fB\-s, \-\-string\fP
+.sp
+Print strings in packet if possible
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.sp
+Direct Routed Examples
+.INDENT 0.0
+.TP
+.B ::
+.
+smpdump \-D 0,1,2,3,5 16 # NODE DESC
+smpdump \-D 0,1,2 0x15 2 # PORT INFO, port 2
+.UNINDENT
+.sp
+LID Routed Examples
+.INDENT 0.0
+.TP
+.B ::
+.
+smpdump 3 0x15 2        # PORT INFO, lid 3 port 2
+smpdump 0xa0 0x11       # NODE INFO, lid 0xa0
+.UNINDENT
+.SS SEE ALSO
+.sp
+smpquery (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%halr at voltaire.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/smpquery.8 b/doc/man/smpquery.8
new file mode 100644
index 0000000..72aa23e
--- /dev/null
+++ b/doc/man/smpquery.8
@@ -0,0 +1,292 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SMPQUERY 8 "" "" "Open IB Diagnostics"
+.SH NAME
+SMPQUERY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand subnet management attributes
+.SS SYNOPSIS
+.sp
+smpquery [options] <op> <dest dr_path|lid|guid> [op params]
+.SS DESCRIPTION
+.sp
+smpquery allows a basic subset of standard SMP queries including the following:
+node info, node description, switch info, port info. Fields are displayed in
+human readable format.
+.SS OPTIONS
+.sp
+Current supported operations and their parameters:
+.INDENT 0.0
+.TP
+.B ::
+.
+nodeinfo <addr>
+nodedesc <addr>
+portinfo <addr> [<portnum>]     # default port is zero
+switchinfo <addr>
+pkeys <addr> [<portnum>]
+sl2vl <addr> [<portnum>]
+vlarb <addr> [<portnum>]
+guids <addr>
+mlnxextportinfo <addr> [<portnum>]  # default port is zero
+.TP
+.B \fB\-c, \-\-combined\fP
+.sp
+Use Combined route address argument \fC<lid> <DR_Path>\fP
+.TP
+.B \fB\-x, \-\-extended\fP
+.sp
+Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
+(only impacts PortInfo queries).
+.UNINDENT
+.\" Define the common option -K
+.
+.INDENT 0.0
+.TP
+.B \fB\-K, \-\-show_keys\fP
+.sp
+show security keys (mkey, smkey, etc.) associated with the request.
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+smpquery portinfo 3 1                     # portinfo by lid, with port modifier
+smpquery \-G switchinfo 0x2C9000100D051 1  # switchinfo by guid
+smpquery \-D nodeinfo 0                    # nodeinfo by direct route
+smpquery \-c nodeinfo 6 0,12               # nodeinfo by combined route
+.UNINDENT
+.SS SEE ALSO
+.sp
+smpdump (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal at mellanox.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/smpquery.8.in b/doc/man/smpquery.8.in
new file mode 100644
index 0000000..53d1713
--- /dev/null
+++ b/doc/man/smpquery.8.in
@@ -0,0 +1,292 @@
+.\" Man page generated from reStructeredText.
+.
+.TH SMPQUERY 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+SMPQUERY \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand subnet management attributes
+.SS SYNOPSIS
+.sp
+smpquery [options] <op> <dest dr_path|lid|guid> [op params]
+.SS DESCRIPTION
+.sp
+smpquery allows a basic subset of standard SMP queries including the following:
+node info, node description, switch info, port info. Fields are displayed in
+human readable format.
+.SS OPTIONS
+.sp
+Current supported operations and their parameters:
+.INDENT 0.0
+.TP
+.B ::
+.
+nodeinfo <addr>
+nodedesc <addr>
+portinfo <addr> [<portnum>]     # default port is zero
+switchinfo <addr>
+pkeys <addr> [<portnum>]
+sl2vl <addr> [<portnum>]
+vlarb <addr> [<portnum>]
+guids <addr>
+mlnxextportinfo <addr> [<portnum>]  # default port is zero
+.TP
+.B \fB\-c, \-\-combined\fP
+.sp
+Use Combined route address argument \fC<lid> <DR_Path>\fP
+.TP
+.B \fB\-x, \-\-extended\fP
+.sp
+Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
+(only impacts PortInfo queries).
+.UNINDENT
+.\" Define the common option -K
+.
+.INDENT 0.0
+.TP
+.B \fB\-K, \-\-show_keys\fP
+.sp
+show security keys (mkey, smkey, etc.) associated with the request.
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -D for Directed routes
+.
+.sp
+\fB\-D, \-\-Direct\fP     The address specified is a directed route
+.sp
+.nf
+.ft C
+Examples:
+   [options] \-D [options] "0"          # self port
+   [options] \-D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+   (Note the second number in the path specified must match the port being
+   used.  This can be specified using the port selection flag \(aq\-P\(aq or the
+   port found through the automatic selection process.)
+.ft P
+.fi
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option --node-name-map
+.
+.sp
+\fB\-\-node\-name\-map <node\-name\-map>\fP Specify a node name map.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+This file maps GUIDs to more user friendly names.  See FILES section.
+.UNINDENT
+.UNINDENT
+.\" Define the common option -y
+.
+.INDENT 0.0
+.TP
+.B \fB\-y, \-\-m_key <key>\fP
+.sp
+use the specified M_key for requests. If non\-numeric value (like \(aqx\(aq)
+is specified then a value will be prompted for.
+.UNINDENT
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.\" Common text to describe the node name map file.
+.
+.SS NODE NAME MAP FILE FORMAT
+.sp
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+.sp
+This functionality is provided by the opensm\-libs package.  See \fBopensm(8)\fP
+for the file location for your installation.
+.sp
+\fBGenerically:\fP
+.sp
+.nf
+.ft C
+# comment
+<guid> "<name>"
+.ft P
+.fi
+.sp
+\fBExample:\fP
+.sp
+.nf
+.ft C
+# IB1
+# Line cards
+0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB\-24D"
+0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB\-24D"
+
+# Spines
+0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB\-12D"
+
+# GUID   Node Name
+0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+.ft P
+.fi
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+smpquery portinfo 3 1                     # portinfo by lid, with port modifier
+smpquery \-G switchinfo 0x2C9000100D051 1  # switchinfo by guid
+smpquery \-D nodeinfo 0                    # nodeinfo by direct route
+smpquery \-c nodeinfo 6 0,12               # nodeinfo by combined route
+.UNINDENT
+.SS SEE ALSO
+.sp
+smpdump (8)
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal at mellanox.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/vendstat.8 b/doc/man/vendstat.8
new file mode 100644
index 0000000..a5e9a48
--- /dev/null
+++ b/doc/man/vendstat.8
@@ -0,0 +1,231 @@
+.\" Man page generated from reStructeredText.
+.
+.TH VENDSTAT 8 "" "" "Open IB Diagnostics"
+.SH NAME
+VENDSTAT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand vendor specific functions
+.SS SYNOPSIS
+.sp
+vendstat [options] <lid|guid>
+.SS DESCRIPTION
+.sp
+vendstat uses vendor specific MADs to access beyond the IB spec
+vendor specific functionality. Currently, there is support for
+Mellanox InfiniSwitch\-III (IS3) and InfiniSwitch\-IV (IS4).
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-N\fP
+.sp
+show IS3 or IS4 general information.
+.TP
+.B \fB\-w\fP
+.sp
+show IS3 port xmit wait counters.
+.TP
+.B \fB\-i\fP
+.sp
+show IS4 counter group info.
+.TP
+.B \fB\-c <num,num>\fP
+.sp
+configure IS4 counter groups.
+.sp
+Configure IS4 counter groups 0 and 1. Such configuration is not
+persistent across IS4 reboot.  First number is for counter group 0 and
+second is for counter group 1.
+.sp
+Group 0 counter config values:
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ::
+.INDENT 7.0
+.INDENT 3.5
+.sp
+0 \- PortXmitDataSL0\-7
+1 \- PortXmitDataSL8\-15
+2 \- PortRcvDataSL0\-7
+.UNINDENT
+.UNINDENT
+.sp
+Group 1 counter config values:
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ::
+.
+1 \- PortXmitDataSL8\-15
+2 \- PortRcvDataSL0\-7
+8 \- PortRcvDataSL8\-15
+.TP
+.B \fB\-R, \-\-Read <addr,mask>\fP
+.sp
+Read configuration space record at addr
+.TP
+.B \fB\-W, \-\-Write <addr,val,mask>\fP
+.sp
+Write configuration space record at addr
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: /usr/local/etc/infiniband-diags/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+/usr/local/etc/infiniband-diags/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+vendstat \-N 6           # read IS3 or IS4 general information
+vendstat \-w 6           # read IS3 port xmit wait counters
+vendstat \-i 6 12        # read IS4 port 12 counter group info
+vendstat \-c 0,1 6 12    # configure IS4 port 12 counter groups for PortXmitDataSL
+vendstat \-c 2,8 6 12    # configure IS4 port 12 counter groups for PortRcvDataSL
+.UNINDENT
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal.rosenstock at gmail.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/man/vendstat.8.in b/doc/man/vendstat.8.in
new file mode 100644
index 0000000..ef5ed73
--- /dev/null
+++ b/doc/man/vendstat.8.in
@@ -0,0 +1,231 @@
+.\" Man page generated from reStructeredText.
+.
+.TH VENDSTAT 8 "@BUILD_DATE@" "" "Open IB Diagnostics"
+.SH NAME
+VENDSTAT \- 
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.SH query InfiniBand vendor specific functions
+.SS SYNOPSIS
+.sp
+vendstat [options] <lid|guid>
+.SS DESCRIPTION
+.sp
+vendstat uses vendor specific MADs to access beyond the IB spec
+vendor specific functionality. Currently, there is support for
+Mellanox InfiniSwitch\-III (IS3) and InfiniSwitch\-IV (IS4).
+.SS OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-N\fP
+.sp
+show IS3 or IS4 general information.
+.TP
+.B \fB\-w\fP
+.sp
+show IS3 port xmit wait counters.
+.TP
+.B \fB\-i\fP
+.sp
+show IS4 counter group info.
+.TP
+.B \fB\-c <num,num>\fP
+.sp
+configure IS4 counter groups.
+.sp
+Configure IS4 counter groups 0 and 1. Such configuration is not
+persistent across IS4 reboot.  First number is for counter group 0 and
+second is for counter group 1.
+.sp
+Group 0 counter config values:
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ::
+.INDENT 7.0
+.INDENT 3.5
+.sp
+0 \- PortXmitDataSL0\-7
+1 \- PortXmitDataSL8\-15
+2 \- PortRcvDataSL0\-7
+.UNINDENT
+.UNINDENT
+.sp
+Group 1 counter config values:
+.UNINDENT
+.INDENT 0.0
+.TP
+.B ::
+.
+1 \- PortXmitDataSL8\-15
+2 \- PortRcvDataSL0\-7
+8 \- PortRcvDataSL8\-15
+.TP
+.B \fB\-R, \-\-Read <addr,mask>\fP
+.sp
+Read configuration space record at addr
+.TP
+.B \fB\-W, \-\-Write <addr,val,mask>\fP
+.sp
+Write configuration space record at addr
+.UNINDENT
+.SS Addressing Flags
+.\" Define the common option -G
+.
+.sp
+\fB\-G, \-\-Guid\fP     The address specified is a Port GUID
+.\" Define the common option -L
+.
+.sp
+\fB\-L, \-\-Lid\fP   The address specified is a LID
+.\" Define the common option -s
+.
+.sp
+\fB\-s, \-\-sm_port <smlid>\fP     use \(aqsmlid\(aq as the target lid for SA queries.
+.SS Port Selection flags
+.\" Define the common option -C
+.
+.sp
+\fB\-C, \-\-Ca <ca_name>\fP    use the specified ca_name.
+.\" Define the common option -P
+.
+.sp
+\fB\-P, \-\-Port <ca_port>\fP    use the specified ca_port.
+.\" Explanation of local port selection
+.
+.SS Local port Selection
+.sp
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.IP 1. 3
+.
+the first port that is ACTIVE.
+.IP 2. 3
+.
+if not found, the first port that is UP (physical link up).
+.UNINDENT
+.sp
+If a port and/or CA name is specified, the libibumad library attempts
+to fulfill the user request, and will fail if it is not possible.
+.sp
+For example:
+.sp
+.nf
+.ft C
+ibaddr                 # use the first port (criteria #1 above)
+ibaddr \-C mthca1       # pick the best port from "mthca1" only.
+ibaddr \-P 2            # use the second (active/up) port from the first available IB device.
+ibaddr \-C mthca0 \-P 2  # use the specified port only.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.SS Debugging flags
+.\" Define the common option -d
+.
+.INDENT 0.0
+.TP
+.B \-d
+.
+raise the IB debugging level.
+May be used several times (\-ddd or \-d \-d \-d).
+.UNINDENT
+.\" Define the common option -e
+.
+.INDENT 0.0
+.TP
+.B \-e
+.
+show send and receive errors (timeouts and others)
+.UNINDENT
+.\" Define the common option -h
+.
+.sp
+\fB\-h, \-\-help\fP      show the usage message
+.\" Define the common option -v
+.
+.INDENT 0.0
+.TP
+.B \fB\-v, \-\-verbose\fP
+.sp
+increase the application verbosity level.
+May be used several times (\-vv or \-v \-v \-v)
+.UNINDENT
+.\" Define the common option -V
+.
+.sp
+\fB\-V, \-\-version\fP     show the version info.
+.SS Configuration flags
+.\" Define the common option -t
+.
+.sp
+\fB\-t, \-\-timeout <timeout_ms>\fP override the default timeout for the solicited mads.
+.\" Define the common option -z
+.
+.sp
+\fB\-\-config, \-z  <config_file>\fP Specify alternate config file.
+.INDENT 0.0
+.INDENT 3.5
+.sp
+Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+.UNINDENT
+.UNINDENT
+.SS FILES
+.\" Common text for the config file
+.
+.SS CONFIG FILE
+.sp
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+.sp
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+.SS EXAMPLES
+.INDENT 0.0
+.TP
+.B ::
+.
+vendstat \-N 6           # read IS3 or IS4 general information
+vendstat \-w 6           # read IS3 port xmit wait counters
+vendstat \-i 6 12        # read IS4 port 12 counter group info
+vendstat \-c 0,1 6 12    # configure IS4 port 12 counter groups for PortXmitDataSL
+vendstat \-c 2,8 6 12    # configure IS4 port 12 counter groups for PortRcvDataSL
+.UNINDENT
+.SS AUTHOR
+.INDENT 0.0
+.TP
+.B Hal Rosenstock
+.
+< \fI\%hal.rosenstock at gmail.com\fP >
+.UNINDENT
+.\" Generated by docutils manpage writer.
+.\" 
+.
diff --git a/doc/rst/check_lft_balance.8.in.rst b/doc/rst/check_lft_balance.8.in.rst
new file mode 100644
index 0000000..96c41f2
--- /dev/null
+++ b/doc/rst/check_lft_balance.8.in.rst
@@ -0,0 +1,52 @@
+=================
+CHECK_LFT_BALANCE
+=================
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+--------------------------------------------------
+check InfiniBand unicast forwarding tables balance
+--------------------------------------------------
+
+
+SYNOPSIS
+========
+
+check_lft_balance.sh [-hRv]
+
+
+DESCRIPTION
+===========
+
+check_lft_balance.sh is a script which checks for balancing in Infiniband
+unicast forwarding tables.  It analyzes the output of
+**dump_lfts(8)** and **iblinkinfo(8)**
+
+OPTIONS
+=======
+
+**-h**
+        show help
+
+**-R**
+        Recalculate dump_lfts information, ie do not use the cached
+        information.  This option is slower but should be used if the diag
+        tools have not been used for some time or if there are other reasons to
+        believe that the fabric has changed.
+
+**-v**
+        verbose output
+
+SEE ALSO
+========
+
+**dump_lfts(8)**
+**iblinkinfo(8)**
+
+AUTHORS
+=======
+
+Albert Chu
+        < chu11 at llnl.gov >
diff --git a/doc/rst/common/opt_C.rst b/doc/rst/common/opt_C.rst
new file mode 100644
index 0000000..223edf3
--- /dev/null
+++ b/doc/rst/common/opt_C.rst
@@ -0,0 +1,4 @@
+.. Define the common option -C
+
+**-C, --Ca <ca_name>**    use the specified ca_name.
+
diff --git a/doc/rst/common/opt_D.rst b/doc/rst/common/opt_D.rst
new file mode 100644
index 0000000..5f87a16
--- /dev/null
+++ b/doc/rst/common/opt_D.rst
@@ -0,0 +1,14 @@
+.. Define the common option -D for Directed routes
+
+**-D, --Direct**     The address specified is a directed route
+::
+
+    Examples:
+       [options] -D [options] "0"          # self port
+       [options] -D [options] "0,1,2,1,4"  # out via port 1, then 2, ...
+
+       (Note the second number in the path specified must match the port being
+       used.  This can be specified using the port selection flag '-P' or the
+       port found through the automatic selection process.)
+
+
diff --git a/doc/rst/common/opt_D_with_param.rst b/doc/rst/common/opt_D_with_param.rst
new file mode 100644
index 0000000..f040345
--- /dev/null
+++ b/doc/rst/common/opt_D_with_param.rst
@@ -0,0 +1,14 @@
+.. Define the common option -D for Directed routes
+
+**-D, --Direct <dr_path>**     The address specified is a directed route
+::
+
+    Examples:
+       -D "0"          # self port
+       -D "0,1,2,1,4"  # out via port 1, then 2, ...
+
+       (Note the second number in the path specified must match the port being
+       used.  This can be specified using the port selection flag '-P' or the
+       port found through the automatic selection process.)
+
+
diff --git a/doc/rst/common/opt_G.rst b/doc/rst/common/opt_G.rst
new file mode 100644
index 0000000..2647f88
--- /dev/null
+++ b/doc/rst/common/opt_G.rst
@@ -0,0 +1,4 @@
+.. Define the common option -G
+
+**-G, --Guid**     The address specified is a Port GUID
+
diff --git a/doc/rst/common/opt_G_with_param.rst b/doc/rst/common/opt_G_with_param.rst
new file mode 100644
index 0000000..0edb2d5
--- /dev/null
+++ b/doc/rst/common/opt_G_with_param.rst
@@ -0,0 +1,4 @@
+.. Define the common option -G
+
+**--port-guid, -G <port_guid>**  Specify a port_guid
+
diff --git a/doc/rst/common/opt_K.rst b/doc/rst/common/opt_K.rst
new file mode 100644
index 0000000..2b96bf2
--- /dev/null
+++ b/doc/rst/common/opt_K.rst
@@ -0,0 +1,4 @@
+.. Define the common option -K
+
+**-K, --show_keys**
+  show security keys (mkey, smkey, etc.) associated with the request.
diff --git a/doc/rst/common/opt_L.rst b/doc/rst/common/opt_L.rst
new file mode 100644
index 0000000..46c6b95
--- /dev/null
+++ b/doc/rst/common/opt_L.rst
@@ -0,0 +1,4 @@
+.. Define the common option -L
+
+**-L, --Lid**   The address specified is a LID
+
diff --git a/doc/rst/common/opt_P.rst b/doc/rst/common/opt_P.rst
new file mode 100644
index 0000000..bf9a191
--- /dev/null
+++ b/doc/rst/common/opt_P.rst
@@ -0,0 +1,4 @@
+.. Define the common option -P
+
+**-P, --Port <ca_port>**    use the specified ca_port.
+
diff --git a/doc/rst/common/opt_V.rst b/doc/rst/common/opt_V.rst
new file mode 100644
index 0000000..2ee7526
--- /dev/null
+++ b/doc/rst/common/opt_V.rst
@@ -0,0 +1,4 @@
+.. Define the common option -V
+
+**-V, --version**     show the version info.
+
diff --git a/doc/rst/common/opt_cache.rst b/doc/rst/common/opt_cache.rst
new file mode 100644
index 0000000..4cad3ae
--- /dev/null
+++ b/doc/rst/common/opt_cache.rst
@@ -0,0 +1,7 @@
+.. Define the common option cache
+
+**--cache <filename>**
+Cache the ibnetdiscover network data in the specified filename.  This
+cache may be used by other tools for later analysis.
+
+
diff --git a/doc/rst/common/opt_d.rst b/doc/rst/common/opt_d.rst
new file mode 100644
index 0000000..2a37ccc
--- /dev/null
+++ b/doc/rst/common/opt_d.rst
@@ -0,0 +1,6 @@
+.. Define the common option -d
+
+-d
+        raise the IB debugging level.
+        May be used several times (-ddd or -d -d -d).
+
diff --git a/doc/rst/common/opt_diff.rst b/doc/rst/common/opt_diff.rst
new file mode 100644
index 0000000..44aa1b7
--- /dev/null
+++ b/doc/rst/common/opt_diff.rst
@@ -0,0 +1,9 @@
+.. Define the common option diff
+
+**--diff <filename>**
+Load cached ibnetdiscover data and do a diff comparison to the current
+network or another cache.  A special diff output for ibnetdiscover
+output will be displayed showing differences between the old and current
+fabric.  By default, the following are compared for differences: switches,
+channel adapters, routers, and port connections.
+
diff --git a/doc/rst/common/opt_diffcheck.rst b/doc/rst/common/opt_diffcheck.rst
new file mode 100644
index 0000000..9f478c7
--- /dev/null
+++ b/doc/rst/common/opt_diffcheck.rst
@@ -0,0 +1,13 @@
+.. Define the common option diffcheck
+
+**--diffcheck <key(s)>**
+Specify what diff checks should be done in the **--diff** option above.
+Comma separate multiple diff check key(s).  The available diff checks
+are: **sw = switches**, **ca = channel adapters**, **router** = routers,
+**port** = port connections, **lid** = lids, **nodedesc** = node
+descriptions.  Note that **port**, **lid**, and **nodedesc** are
+checked only for the node types that are specified (e.g. **sw**,
+**ca**, **router**).  If **port** is specified alongside **lid**
+or **nodedesc**, remote port lids and node descriptions will also be compared.
+
+
diff --git a/doc/rst/common/opt_e.rst b/doc/rst/common/opt_e.rst
new file mode 100644
index 0000000..f0c9103
--- /dev/null
+++ b/doc/rst/common/opt_e.rst
@@ -0,0 +1,3 @@
+.. Define the common option -e
+
+-e      show send and receive errors (timeouts and others)
diff --git a/doc/rst/common/opt_h.rst b/doc/rst/common/opt_h.rst
new file mode 100644
index 0000000..2f74999
--- /dev/null
+++ b/doc/rst/common/opt_h.rst
@@ -0,0 +1,4 @@
+.. Define the common option -h
+
+**-h, --help**      show the usage message
+
diff --git a/doc/rst/common/opt_load-cache.rst b/doc/rst/common/opt_load-cache.rst
new file mode 100644
index 0000000..88dc05f
--- /dev/null
+++ b/doc/rst/common/opt_load-cache.rst
@@ -0,0 +1,8 @@
+.. Define the common option load-cache
+
+**--load-cache <filename>**
+Load and use the cached ibnetdiscover data stored in the specified
+filename.  May be useful for outputting and learning about other
+fabrics or a previous state of a fabric.
+
+
diff --git a/doc/rst/common/opt_node_name_map.rst b/doc/rst/common/opt_node_name_map.rst
new file mode 100644
index 0000000..dd2c6cf
--- /dev/null
+++ b/doc/rst/common/opt_node_name_map.rst
@@ -0,0 +1,6 @@
+.. Define the common option --node-name-map
+
+**--node-name-map <node-name-map>** Specify a node name map.
+
+        This file maps GUIDs to more user friendly names.  See FILES section.
+
diff --git a/doc/rst/common/opt_o-outstanding_smps.rst b/doc/rst/common/opt_o-outstanding_smps.rst
new file mode 100644
index 0000000..a52f09e
--- /dev/null
+++ b/doc/rst/common/opt_o-outstanding_smps.rst
@@ -0,0 +1,7 @@
+.. Define the common option -z
+
+**--outstanding_smps, -o <val>**
+        Specify the number of outstanding SMP's which should be issued during the scan
+
+        Default: 2
+
diff --git a/doc/rst/common/opt_s.rst b/doc/rst/common/opt_s.rst
new file mode 100644
index 0000000..c7ada5e
--- /dev/null
+++ b/doc/rst/common/opt_s.rst
@@ -0,0 +1,4 @@
+.. Define the common option -s
+
+**-s, --sm_port <smlid>**     use 'smlid' as the target lid for SA queries.
+
diff --git a/doc/rst/common/opt_t.rst b/doc/rst/common/opt_t.rst
new file mode 100644
index 0000000..59d3694
--- /dev/null
+++ b/doc/rst/common/opt_t.rst
@@ -0,0 +1,4 @@
+.. Define the common option -t
+
+**-t, --timeout <timeout_ms>** override the default timeout for the solicited mads.
+
diff --git a/doc/rst/common/opt_v.rst b/doc/rst/common/opt_v.rst
new file mode 100644
index 0000000..9912007
--- /dev/null
+++ b/doc/rst/common/opt_v.rst
@@ -0,0 +1,6 @@
+.. Define the common option -v
+
+**-v, --verbose**
+        increase the application verbosity level.
+        May be used several times (-vv or -v -v -v)
+
diff --git a/doc/rst/common/opt_y.rst b/doc/rst/common/opt_y.rst
new file mode 100644
index 0000000..91caf0c
--- /dev/null
+++ b/doc/rst/common/opt_y.rst
@@ -0,0 +1,6 @@
+.. Define the common option -y
+
+**-y, --m_key <key>**
+        use the specified M_key for requests. If non-numeric value (like 'x')
+        is specified then a value will be prompted for.
+
diff --git a/doc/rst/common/opt_z-config.rst b/doc/rst/common/opt_z-config.rst
new file mode 100644
index 0000000..449a6ef
--- /dev/null
+++ b/doc/rst/common/opt_z-config.rst
@@ -0,0 +1,6 @@
+.. Define the common option -z
+
+**--config, -z  <config_file>** Specify alternate config file.
+
+        Default: @IBDIAG_CONFIG_PATH@/ibdiag.conf
+
diff --git a/doc/rst/common/sec_config-file.rst b/doc/rst/common/sec_config-file.rst
new file mode 100644
index 0000000..060cf7b
--- /dev/null
+++ b/doc/rst/common/sec_config-file.rst
@@ -0,0 +1,10 @@
+.. Common text for the config file
+
+CONFIG FILE
+-----------
+
+ at IBDIAG_CONFIG_PATH@/ibdiag.conf
+
+A global config file is provided to set some of the common options for all
+tools.  See supplied config file for details.
+
diff --git a/doc/rst/common/sec_node-name-map.rst b/doc/rst/common/sec_node-name-map.rst
new file mode 100644
index 0000000..3e18d1b
--- /dev/null
+++ b/doc/rst/common/sec_node-name-map.rst
@@ -0,0 +1,43 @@
+.. Common text to describe the node name map file.
+
+NODE NAME MAP FILE FORMAT
+-------------------------
+
+The node name map is used to specify user friendly names for nodes in the
+output.  GUIDs are used to perform the lookup.
+
+This functionality is provided by the opensm-libs package.  See **opensm(8)**
+for the file location for your installation.
+
+**Generically:**
+
+::
+
+   # comment
+   <guid> "<name>"
+
+**Example:**
+
+::
+
+   # IB1
+   # Line cards
+   0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB-24D"
+   0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB-24D"
+   0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB-24D"
+   0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB-24D"
+   0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB-24D"
+   
+   # Spines
+   0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB-12D"
+   0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB-12D"
+   0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB-12D"
+   0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB-12D"
+   0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB-12D"
+   
+   # GUID   Node Name
+   0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
+   0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
+   0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
+   0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
+
diff --git a/doc/rst/common/sec_portselection.rst b/doc/rst/common/sec_portselection.rst
new file mode 100644
index 0000000..56936b6
--- /dev/null
+++ b/doc/rst/common/sec_portselection.rst
@@ -0,0 +1,24 @@
+.. Explanation of local port selection
+
+Local port Selection
+--------------------
+
+Multiple port/Multiple CA support: when no IB device or port is specified
+(see the "local umad parameters" below), the libibumad library
+selects the port to use by the following criteria:
+
+	1. the first port that is ACTIVE.
+	2. if not found, the first port that is UP (physical link up).
+
+	If a port and/or CA name is specified, the libibumad library attempts
+	to fulfill the user request, and will fail if it is not possible.
+
+	For example:
+
+        ::
+
+	    ibaddr                 # use the first port (criteria #1 above)
+	    ibaddr -C mthca1       # pick the best port from "mthca1" only.
+	    ibaddr -P 2            # use the second (active/up) port from the first available IB device.
+	    ibaddr -C mthca0 -P 2  # use the specified port only.
+
diff --git a/doc/rst/common/sec_topology-file.rst b/doc/rst/common/sec_topology-file.rst
new file mode 100644
index 0000000..8249f2d
--- /dev/null
+++ b/doc/rst/common/sec_topology-file.rst
@@ -0,0 +1,89 @@
+.. Common text to describe the Topology file.
+
+TOPOLOGY FILE FORMAT
+--------------------
+
+The topology file format is human readable and largely intuitive.
+Most identifiers are given textual names like vendor ID (vendid), device ID
+(device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).
+PortGUIDs are shown in parentheses ().  For switches, this is shown on the
+switchguid line.  For CA and router ports, it is shown on the connectivity
+lines.  The IB node is identified followed by the number of ports and a quoted
+the node GUID.  On the right of this line is a comment (#) followed by the
+NodeDescription in quotes.  If the node is a switch, this line also contains
+whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
+Subsequent lines pertaining to this node show the connectivity.   On the
+left is the port number of the current node.  On the right is the peer node
+(node at other end of link). It is identified in quotes with nodetype
+followed by - followed by NodeGUID with the port number in square brackets.
+Further on the right is a comment (#).  What follows the comment is
+dependent on the node type.  If it it a switch node, it is followed by
+the NodeDescription in quotes and the LID of the peer node.  If it is a
+CA or router node, it is followed by the local LID and LMC and then
+followed by the NodeDescription in quotes and the LID of the peer node.
+The active link width and speed are then appended to the end of this
+output line.
+
+An example of this is:
+
+::
+
+   #
+   # Topology file: generated on Tue Jun  5 14:15:10 2007
+   #
+   # Max of 3 hops discovered
+   # Initiated from node 0008f10403960558 port 0008f10403960559
+   
+   Non-Chassis Nodes
+   
+   vendid=0x8f1
+   devid=0x5a06
+   sysimgguid=0x5442ba00003000
+   switchguid=0x5442ba00003080(5442ba00003080)
+   Switch  24 "S-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
+   [22]    "H-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
+   [10]    "S-0008f10400410015"[1]         # "SW-6IB4 Voltaire" lid 3 4xSDR
+   [8]     "H-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
+   [6]     "S-0008f10400410015"[3]         # "SW-6IB4 Voltaire" lid 3 4xSDR
+   [12]    "H-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
+   
+   vendid=0x8f1
+   devid=0x5a05
+   switchguid=0x8f10400410015(8f10400410015)
+   Switch  8 "S-0008f10400410015"          # "SW-6IB4 Voltaire" base port 0 lid 3 lmc 0
+   [6]     "H-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
+   [4]     "H-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
+   [1]     "S-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
+   [3]     "S-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
+   
+   vendid=0x2c9
+   devid=0x5a44
+   caguid=0x8f10403960984
+   Ca      2 "H-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
+   [1](8f10403960985)     "S-0008f10400410015"[6]         # lid 16 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
+   
+   vendid=0x2c9
+   devid=0x5a44
+   caguid=0x5442b100004900
+   Ca      2 "H-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
+   [1](5442b100004901)     "S-0008f10400410015"[4]         # lid 12 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
+   
+   vendid=0x2c9
+   devid=0x5a44
+   caguid=0x8f10403961354
+   Ca      2 "H-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
+   [1](8f10403961355)     "S-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+   
+   vendid=0x2c9
+   devid=0x5a44
+   caguid=0x8f10403960558
+   Ca      2 "H-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
+   [2](8f1040396055a)     "S-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
+   [1](8f10403960559)     "S-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
+
+
+When grouping is used, IB nodes are organized into chassis which are
+numbered. Nodes which cannot be determined to be in a chassis are
+displayed as "Non-Chassis Nodes".  External ports are also shown on the
+connectivity lines.
+
diff --git a/doc/rst/dump_lfts.8.in.rst b/doc/rst/dump_lfts.8.in.rst
new file mode 100644
index 0000000..9b9ded2
--- /dev/null
+++ b/doc/rst/dump_lfts.8.in.rst
@@ -0,0 +1,73 @@
+============
+DUMP_LFTS.SH
+============
+
+-----------------------------------------
+dump InfiniBand unicast forwarding tables
+-----------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+
+SYNOPSIS
+========
+
+dump_lfts.sh [-h] [-D] [-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] [>/path/to/dump-file]
+
+
+DESCRIPTION
+===========
+
+dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
+tables (MFTs) in the switch nodes in the subnet.
+
+The dump file format is compatible with loading into OpenSM using
+the -R file -U /path/to/dump-file syntax.
+
+OPTIONS
+=======
+
+**-D**
+dump forwarding tables using direct routed rather than LID routed SMPs
+
+**-h**
+show help
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_t.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+
+SEE ALSO
+========
+
+**dump_mfts(8), ibroute(8), ibswitches(8), opensm(8)**
+
+
+AUTHORS
+=======
+
+Sasha Khapyorsky
+        < sashak at voltaire.com >
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/dump_mfts.8.in.rst b/doc/rst/dump_mfts.8.in.rst
new file mode 100644
index 0000000..551effc
--- /dev/null
+++ b/doc/rst/dump_mfts.8.in.rst
@@ -0,0 +1,64 @@
+============
+DUMP_MFTS.SH
+============
+
+-------------------------------------------
+dump InfiniBand multicast forwarding tables
+-------------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+dump_mfts.sh [\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/file]
+
+DESCRIPTION
+===========
+
+dump_mfts.sh is a script which dumps the InfiniBand multicast
+forwarding tables (MFTs) in the switch nodes in the subnet.
+
+OPTIONS
+=======
+
+**-D**
+dump forwarding tables using direct routed rather than LID routed SMPs
+
+**-h**
+show help
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_t.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+
+SEE ALSO
+========
+
+**dump_lfts(8), ibroute(8), ibswitches(8), opensm(8)**
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibaddr.8.in.rst b/doc/rst/ibaddr.8.in.rst
new file mode 100644
index 0000000..6713fcf
--- /dev/null
+++ b/doc/rst/ibaddr.8.in.rst
@@ -0,0 +1,101 @@
+======
+IBADDR
+======
+
+----------------------------
+query InfiniBand address(es)
+----------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibaddr [options]
+
+
+DESCRIPTION
+===========
+
+
+Display the lid (and range) as well as the GID address of the
+port specified (by DR path, lid, or GUID) or the local port by default.
+
+Note: this utility can be used as simple address resolver.
+
+OPTIONS
+=======
+
+**--gid_show, -g**
+show gid address only
+
+**--lid_show, -l**
+show lid range only
+
+**--Lid_show, -L**
+show lid range (in decimal) only
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_D.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_s.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+EXAMPLES
+========
+
+::
+
+        ibaddr                  # local port\'s address
+        ibaddr 32               # show lid range and gid of lid 32
+        ibaddr -G 0x8f1040023   # same but using guid address
+        ibaddr -l 32            # show lid range only
+        ibaddr -L 32            # show decimal lid range only
+        ibaddr -g 32            # show gid address only
+
+SEE ALSO
+========
+
+**ibroute (8), ibtracert (8)**
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibcacheedit.8.in.rst b/doc/rst/ibcacheedit.8.in.rst
new file mode 100644
index 0000000..5d61efb
--- /dev/null
+++ b/doc/rst/ibcacheedit.8.in.rst
@@ -0,0 +1,59 @@
+===========
+IBCACHEEDIT
+===========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+---------------------------
+edit an ibnetdiscover cache
+---------------------------
+
+
+SYNOPSIS
+========
+
+ibcacheedit [options] <orig.cache> <new.cache>
+
+DESCRIPTION
+===========
+
+ibcacheedit allows users to edit an ibnetdiscover cache created through the
+**--cache** option in **ibnetdiscover(8)** .
+
+OPTIONS
+=======
+
+**--switchguid BEFOREGUID:AFTERGUID**
+        Specify a switchguid that should be changed.  The before and after guid
+        should be separated by a colon.  On switches, port guids are identical
+        to the switch guid, so port guids will be adjusted as well on switches.
+
+**--caguid BEFOREGUID:AFTERGUID**
+        Specify a caguid that should be changed.  The before and after guid
+        should be separated by a colon.
+
+**--sysimgguid BEFOREGUID:AFTERGUID**
+        Specify a sysimgguid that should be changed.  The before and after guid
+        should be spearated by a colon.
+
+**--portguid NODEGUID:BEFOREGUID:AFTERGUID**
+        Specify a portguid that should be changed.  The nodeguid of the port
+        (e.g. switchguid or caguid) should be specified first, followed by a
+        colon, the before port guid, another colon, then the after port guid.
+        On switches, port guids are identical to the switch guid, so the switch
+        guid will be adjusted as well on switches.
+
+Debugging flags
+---------------
+
+.. include:: common/opt_h.rst
+.. include:: common/opt_V.rst
+
+
+AUTHORS
+=======
+
+Albert Chu
+        < chu11 at llnl.gov >
diff --git a/doc/rst/ibccconfig.8.in.rst b/doc/rst/ibccconfig.8.in.rst
new file mode 100644
index 0000000..e88d8ac
--- /dev/null
+++ b/doc/rst/ibccconfig.8.in.rst
@@ -0,0 +1,94 @@
+==========
+IBCCCONFIG
+==========
+
+-------------------------------------
+configure congestion control settings
+-------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibccconfig [common_options] [-c cckey] <op> <lid|guid> [port]
+
+DESCRIPTION
+===========
+
+**ibccconfig**
+supports the configuration of congestion control settings on switches
+and HCAs.
+
+**WARNING -- You should understand what you are doing before using this tool.
+Misuse of this tool could result in a broken fabric.**
+
+OPTIONS
+=======
+
+Current supported operations and their parameters:
+  CongestionKeyInfo (CK) <lid|guid> <cckey> <cckeyprotectbit> <cckeyleaseperiod> <cckeyviolations>
+  SwitchCongestionSetting (SS) <lid|guid> <controlmap> <victimmask> <creditmask> <threshold> <packetsize> <csthreshold> <csreturndelay> <markingrate>
+  SwitchPortCongestionSetting (SP) <lid|guid> <portnum> <valid> <control_type> <threshold> <packet_size> <cong_parm_marking_rate> 
+  CACongestionSetting (CS) <lid|guid> <port_control> <control_map> <ccti_timer> <ccti_increase> <trigger_threshold> <ccti_min>
+  CongestionControlTable (CT) <lid|guid> <cctilimit> <index> <cctentry> <cctentry> ...
+
+**--cckey, -c, <cckey>**
+Specify a congestion control (CC) key.  If none is specified, a key of 0 is used.
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+
+EXAMPLES
+========
+
+::
+
+        ibccconfig SwitchCongestionSetting 2 0x1F 0x1FFFFFFFFF 0x0 0xF 8 0 0:0 1  # Configure Switch Congestion Settings
+        ibccconfig CACongestionSetting 1 0 0x3 150 1 0 0                          # Configure CA Congestion Settings to SL 0 and SL 1
+        ibccconfig CACongestionSetting 1 0 0x4 200 1 0 0                          # Configure CA Congestion Settings to SL 2
+        ibccconfig CongestionControlTable 1 63 0 0:0 0:1 ...                      # Configure first block of Congestion Control Table
+        ibccconfig CongestionControlTable 1 127 0 0:64 0:65 ...                   # Configure second block of Congestion Control Table
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+AUTHOR
+======
+
+Albert Chu
+        < chu11 at llnl.gov >
diff --git a/doc/rst/ibccquery.8.in.rst b/doc/rst/ibccquery.8.in.rst
new file mode 100644
index 0000000..773d2f8
--- /dev/null
+++ b/doc/rst/ibccquery.8.in.rst
@@ -0,0 +1,90 @@
+=========
+IBCCQUERY
+=========
+
+--------------------------------------
+query congestion control settings/info
+--------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+ibccquery [common_options] [-c cckey] <op> <lid|guid> [port]
+
+DESCRIPTION
+===========
+
+ibccquery support the querying of settings and other information related
+to congestion control.
+
+OPTIONS
+=======
+
+Current supported operations and their parameters:
+  CongestionInfo (CI) <addr>
+  CongestionKeyInfo (CK) <addr>
+  CongestionLog (CL) <addr>
+  SwitchCongestionSetting (SS) <addr>
+  SwitchPortCongestionSetting (SP) <addr> [<portnum>]
+  CACongestionSetting (CS) <addr>
+  CongestionControlTable (CT) <addr>
+  Timestamp (TI) <addr>
+
+
+**--cckey, -c <cckey>**
+Specify a congestion control (CC) key.  If none is specified, a key of 0 is used.
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+EXAMPLES
+========
+
+::
+
+        ibccquery CongestionInfo 3		# Congestion Info by lid
+        ibccquery SwitchPortCongestionSetting 3	# Query all Switch Port Congestion Settings
+        ibccquery SwitchPortCongestionSetting 3 1 # Query Switch Port Congestion Setting for port 1
+
+AUTHOR
+======
+
+Albert Chu
+        < chu11 at llnl.gov >
diff --git a/doc/rst/ibclearcounters.8.in.rst b/doc/rst/ibclearcounters.8.in.rst
new file mode 100644
index 0000000..62bae25
--- /dev/null
+++ b/doc/rst/ibclearcounters.8.in.rst
@@ -0,0 +1,51 @@
+===============
+IBCLEARCOUNTERS
+===============
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+--------------------------------
+clear port counters in IB subnet
+--------------------------------
+
+
+SYNOPSIS
+========
+
+ibclearcounters [\-h] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
+
+DESCRIPTION
+===========
+
+ibclearcounters is a script that clears the PMA port counters by either walking
+the IB subnet topology or using an already saved topology file.
+
+OPTIONS
+=======
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+
+
+SEE ALSO
+========
+
+**ibnetdiscover(8), perfquery(8)**
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibfindnodesusing.8.in.rst b/doc/rst/ibfindnodesusing.8.in.rst
new file mode 100644
index 0000000..6d19c36
--- /dev/null
+++ b/doc/rst/ibfindnodesusing.8.in.rst
@@ -0,0 +1,54 @@
+================
+IBFINDNODESUSING
+================
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+-------------------------------------------------------------------------------
+find a list of end nodes which are routed through the specified switch and port
+-------------------------------------------------------------------------------
+
+
+SYNOPSIS
+========
+
+ibfindnodesusing.pl [options] <switch_guid|switch_name> <port>
+
+DESCRIPTION
+===========
+
+ibfindnodesusing.pl uses ibroute and detects the current nodes which are routed
+through both directions of the link specified.  The link is specified by one
+switch port end; the script finds the remote end automatically.
+
+
+OPTIONS
+=======
+
+**-h**
+        show help
+
+**-R**
+        Recalculate the ibnetdiscover information, ie do not use the cached
+        information.  This option is slower but should be used if the diag
+        tools have not been used for some time or if there are other reasons to
+        believe that the fabric has changed.
+
+**-C <ca_name>**    use the specified ca_name.
+
+**-P <ca_port>**    use the specified ca_port.
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+AUTHOR
+======
+
+Ira Weiny
+        < weiny2 at llnl.gov >
diff --git a/doc/rst/ibhosts.8.in.rst b/doc/rst/ibhosts.8.in.rst
new file mode 100644
index 0000000..237b89e
--- /dev/null
+++ b/doc/rst/ibhosts.8.in.rst
@@ -0,0 +1,56 @@
+=======
+IBHOSTS
+=======
+
+--------------------------------------
+show InfiniBand host nodes in topology
+--------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+SYNOPSIS
+========
+
+ibhosts [options] [<topology-file>]
+
+
+DESCRIPTION
+===========
+
+ibhosts is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the CA nodes.
+
+OPTIONS
+=======
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_z-config.rst
+
+.. include:: common/sec_portselection.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+SEE ALSO
+========
+
+ibnetdiscover(8)
+
+DEPENDENCIES
+============
+
+ibnetdiscover, ibnetdiscover format
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibidsverify.8.in.rst b/doc/rst/ibidsverify.8.in.rst
new file mode 100644
index 0000000..3614333
--- /dev/null
+++ b/doc/rst/ibidsverify.8.in.rst
@@ -0,0 +1,63 @@
+===========
+IBIDSVERIFY
+===========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+---------------------------------------------------
+validate IB identifiers in subnet and report errors
+---------------------------------------------------
+
+SYNOPSIS
+========
+
+ibidsverify.pl [-h] [-R]
+
+DESCRIPTION
+===========
+
+ibidsverify.pl is a perl script which uses a full topology file that was
+created by ibnetdiscover, scans the network to validate the LIDs and GUIDs
+in the subnet. The validation consists of checking that there are no zero
+or duplicate identifiers.
+
+Finally, ibidsverify.pl will also reuse the cached ibnetdiscover output from
+some of the other diag tools which makes it a bit faster than running
+ibnetdiscover from scratch.
+
+OPTIONS
+=======
+
+**-R**
+Recalculate the ibnetdiscover information, ie do not use the cached
+information.  This option is slower but should be used if the diag tools have
+not been used for some time or if there are other reasons to believe the
+fabric has changed.
+
+**-C <ca_name>**    use the specified ca_name.
+
+**-P <ca_port>**    use the specified ca_port.
+
+EXIT STATUS
+===========
+
+Exit status is 1 if errors are found, 0 otherwise.
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+SEE ALSO
+========
+
+**ibnetdiscover(8)**
+
+AUTHOR
+======
+
+Hal Rosenstock
+	< halr at voltaire.com >
diff --git a/doc/rst/iblinkinfo.8.in.rst b/doc/rst/iblinkinfo.8.in.rst
new file mode 100644
index 0000000..9e13d57
--- /dev/null
+++ b/doc/rst/iblinkinfo.8.in.rst
@@ -0,0 +1,132 @@
+==========
+IBLINKINFO
+==========
+
+--------------------------------------------
+report link info for all links in the fabric
+--------------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+iblinkinfo <options>
+
+DESCRIPTION
+===========
+
+iblinkinfo reports link info for each port in an IB fabric, node by node.
+Optionally, iblinkinfo can do partial scans and limit its output to parts of a
+fabric.
+
+OPTIONS
+=======
+
+**--down, -d**
+Print only nodes which have a port in the "Down" state.
+
+**--line, -l**
+Print all information for each link on one line. Default is to print a header
+with the node information and then a list for each port (useful for
+grep'ing output).
+
+
+**--additional, -p**
+Print additional port settings (<LifeTime>,<HoqLife>,<VLStallCount>)
+
+**--switches-only**
+Show only switches in output.
+
+**--cas-only**
+Show only CAs in output.
+
+
+Partial Scan flags
+------------------
+
+The node to start a partial scan can be specified with the following addresses.
+
+.. include:: common/opt_G_with_param.rst
+.. include:: common/opt_D_with_param.rst
+
+**Note:** For switches results are printed for all ports not just switch port 0.
+
+**--switch, -S <port_guid>** same as "-G". (provided only for backward compatibility)
+
+How much of the scan to be printed can be controled with the following.
+
+**--all, -a**
+Print all nodes found in a partial fabric scan.  Normally a
+partial fabric scan will return only the node specified.  This option will
+print the other nodes found as well.
+
+**--hops, -n <hops>**
+Specify the number of hops away from a specified node to scan.  This is useful
+to expand a partial fabric scan beyond the node specified.
+
+
+Cache File flags
+----------------
+
+.. include:: common/opt_load-cache.rst
+.. include:: common/opt_diff.rst
+.. include:: common/opt_diffcheck.rst
+
+**--filterdownports <filename>**
+Filter downports indicated in a ibnetdiscover cache.  If a port was previously
+indicated as down in the specified cache, and is still down, do not output it in the
+resulting output.  This option may be particularly useful for environments
+where switches are not fully populated, thus much of the default iblinkinfo
+info is considered unuseful.  See **ibnetdiscover** for information on caching
+ibnetdiscover output.
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_o-outstanding_smps.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+**-R** (This option is obsolete and does nothing)
+
+EXIT STATUS
+===========
+
+0 on success, -1 on failure to scan the fabric, 1 if check mode is used and
+inconsistencies are found.
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+.. include:: common/sec_node-name-map.rst
+
+
+AUTHOR
+======
+
+Ira Weiny
+        < weiny2 at llnl.gov >
diff --git a/doc/rst/ibnetdiscover.8.in.rst b/doc/rst/ibnetdiscover.8.in.rst
new file mode 100644
index 0000000..a5b92ca
--- /dev/null
+++ b/doc/rst/ibnetdiscover.8.in.rst
@@ -0,0 +1,115 @@
+=============
+IBNETDISCOVER
+=============
+
+----------------------------
+discover InfiniBand topology
+----------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibnetdiscover [options] [<topology-file>]
+
+
+DESCRIPTION
+===========
+
+ibnetdiscover performs IB subnet discovery and outputs a human readable
+topology file. GUIDs, node types, and port numbers are displayed
+as well as port LIDs and NodeDescriptions.  All nodes (and links) are displayed
+(full topology).  Optionally, this utility can be used to list the current
+connected nodes by nodetype.  The output is printed to standard output
+unless a topology file is specified.
+
+OPTIONS
+=======
+
+**-l, --list**
+List of connected nodes
+
+**-g, --grouping**
+Show grouping.  Grouping correlates IB nodes by different vendor specific
+schemes.  It may also show the switch external ports correspondence.
+
+**-H, --Hca_list**
+List of connected CAs
+
+**-S, --Switch_list**
+List of connected switches
+
+**-R, --Router_list**
+List of connected routers
+
+**-s, --show**
+Show progress information during discovery.
+
+**-p, --ports**
+Obtain a ports report which is a
+list of connected ports with relevant information (like LID, portnum,
+GUID, width, speed, and NodeDescription).
+
+**-m, --max_hops**
+Report max hops discovered.
+
+.. include:: common/opt_o-outstanding_smps.rst
+
+
+Cache File flags
+----------------
+
+.. include:: common/opt_cache.rst
+.. include:: common/opt_load-cache.rst
+.. include:: common/opt_diff.rst
+.. include:: common/opt_diffcheck.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_o-outstanding_smps.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+.. include:: common/sec_topology-file.rst
+
+
+
+AUTHORS
+=======
+
+Hal Rosenstock
+        < halr at voltaire.com >
+
+Ira Weiny
+        < weiny2 at llnl.gov >
diff --git a/doc/rst/ibnodes.8.in.rst b/doc/rst/ibnodes.8.in.rst
new file mode 100644
index 0000000..d36a03e
--- /dev/null
+++ b/doc/rst/ibnodes.8.in.rst
@@ -0,0 +1,58 @@
+=======
+IBNODES
+=======
+
+---------------------------------
+show InfiniBand nodes in topology
+---------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibnodes [options] [<topology-file>]
+
+DESCRIPTION
+===========
+
+ibnodes is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the IB nodes (CAs and switches).
+
+
+OPTIONS
+=======
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_z-config.rst
+
+.. include:: common/sec_portselection.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+
+SEE ALSO
+========
+
+ibnetdiscover(8)
+
+DEPENDENCIES
+============
+
+ibnetdiscover, ibnetdiscover format
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibping.8.in.rst b/doc/rst/ibping.8.in.rst
new file mode 100644
index 0000000..8dd2e41
--- /dev/null
+++ b/doc/rst/ibping.8.in.rst
@@ -0,0 +1,86 @@
+======
+IBPING
+======
+
+--------------------------
+ping an InfiniBand address
+--------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibping [options] <dest lid | guid>
+
+DESCRIPTION
+===========
+
+ibping uses vendor mads to validate connectivity between IB nodes.
+On exit, (IP) ping like output is show. ibping is run as client/server.
+Default is to run as client. Note also that a default ping server is
+implemented within the kernel.
+
+
+OPTIONS
+=======
+
+**-c, --count**
+stop after count packets
+
+**-f, --flood**
+flood destination: send packets back to back without delay
+
+**-o, --oui**
+use specified OUI number to multiplex vendor mads
+
+**-S, --Server**
+start in server mode (do not return)
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_L.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_t.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_h.rst
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibportstate.8.in.rst b/doc/rst/ibportstate.8.in.rst
new file mode 100644
index 0000000..c082638
--- /dev/null
+++ b/doc/rst/ibportstate.8.in.rst
@@ -0,0 +1,125 @@
+===========
+IBPORTSTATE
+===========
+
+-----------------------------------------------------------------
+handle port (physical) state and link speed of an InfiniBand port
+-----------------------------------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibportstate [options] <dest dr_path|lid|guid> <portnum> [<op>]
+
+DESCRIPTION
+===========
+
+ibportstate allows the port state and port physical state of an IB port
+to be queried (in addition to link width and speed being validated
+relative to the peer port when the port queried is a switch port),
+or a switch port to be disabled, enabled, or reset. It
+also allows the link speed/width enabled on any IB port to be adjusted.
+
+OPTIONS
+=======
+
+**<op>**
+        Supported ops: enable, disable, reset, speed, espeed, fdr10, width, query,
+                        down, arm, active, vls, mtu, lid, smlid, lmc,
+                        mkey, mkeylease, mkeyprot
+			(Default is query)
+
+        **enable, disable, and reset** are only allowed on switch ports (An
+        error is indicated if attempted on CA or router ports)
+
+        **speed and width** are allowed on any port
+
+        **speed** values are the legal values for PortInfo:LinkSpeedEnabled (An
+        error is indicated if PortInfo:LinkSpeedSupported does not support this
+        setting)
+
+        **espeed** is allowed on any port supporting extended link speeds
+
+        **fdr10** is allowed on any port supporting fdr10 (An error is
+        indicated if port's capability mask indicates extended link speeds are
+        not supported or if PortInfo:LinkSpeedExtSupported does not support
+        this setting)
+
+        **width** values are legal values for PortInfo:LinkWidthEnabled (An
+        error is indicated if PortInfo:LinkWidthSupported does not support this
+        setting) (NOTE: Speed and width changes are not effected until the port
+        goes through link renegotiation)
+
+        **query** also validates port characteristics (link width, speed,
+        espeed, and fdr10) based on the peer port. This checking is done when
+        the port queried is a switch port as it relies on combined routing (an
+        initial LID route with directed routing to the peer) which can only be
+        done on a switch. This peer port validation feature of query op
+        requires LID routing to be functioning in the subnet.
+
+        **mkey, mkeylease, and mkeyprot** are only allowed on CAs, routers, or
+        switch port 0 (An error is generated if attempted on external switch
+        ports).  Hexadecimal and octal mkeys may be specified by prepending the
+        key with '0x' or '0', respectively.  If a non-numeric value (like 'x')
+        is specified for the mkey, then ibportstate will prompt for a value.
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_L.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_D.rst
+.. include:: common/opt_s.rst
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_h.rst
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_K.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+EXAMPLES
+========
+
+::
+        ibportstate 3 1 disable                  # by lid
+        ibportstate -G 0x2C9000100D051 1 enable  # by guid
+        ibportstate -D 0 1                       # (query) by direct route
+        ibportstate 3 1 reset                    # by lid
+        ibportstate 3 1 speed 1                  # by lid
+        ibportstate 3 1 width 1                  # by lid
+        ibportstate -D 0 1 lid 0x1234 arm        # by direct route
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < hal.rosenstock at gmail.com >
diff --git a/doc/rst/ibqueryerrors.8.in.rst b/doc/rst/ibqueryerrors.8.in.rst
new file mode 100644
index 0000000..9a05e7b
--- /dev/null
+++ b/doc/rst/ibqueryerrors.8.in.rst
@@ -0,0 +1,156 @@
+=============
+IBQUERYERRORS
+=============
+
+---------------------------------
+query and report IB port counters
+---------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibqueryerrors [options]
+
+DESCRIPTION
+===========
+
+The default behavior is to report the port error counters which exceed a
+threshold for each port in the fabric.  The default threshold is zero (0).
+Error fields can also be suppressed entirely.
+
+In addition to reporting errors on every port.  ibqueryerrors can report the
+port transmit and receive data as well as report full link information to the
+remote port if available.
+
+OPTIONS
+=======
+
+**-s, --suppress <err1,err2,...>**
+Suppress the errors listed in the comma separated list provided.
+
+**-c, --suppress-common**
+Suppress some of the common "side effect" counters.  These counters usually do
+not indicate an error condition and can be usually be safely ignored.
+
+**-r, --report-port**
+Report the port information.  This includes LID, port, external port (if
+applicable), link speed setting, remote GUID, remote port, remote external port
+(if applicable), and remote node description information.
+
+**--data**
+Include the optional transmit and receive data counters.
+
+**--threshold-file <filename>**
+Specify an alternate threshold file.  The default is @IBDIAG_CONFIG_PATH@/error_thresholds
+
+**--switch**  print data for switch's only
+
+**--ca**  print data for CA's only
+
+**--router**  print data for routers only
+
+**--clear-errors -k** Clear error counters after read.
+
+**--clear-counts -K** Clear data counters after read.
+
+**CAUTION** clearing data or error counters will occur regardless of if they
+are printed or not.  See **--counters** and **--data** for details on
+controling which counters are printed.
+
+**--details** include receive error and transmit discard details
+
+**--counters** print data counters only
+
+
+Partial Scan flags
+------------------
+
+The node to start a partial scan can be specified with the following addresses.
+
+.. include:: common/opt_G_with_param.rst
+.. include:: common/opt_D_with_param.rst
+
+**Note:** For switches results are printed for all ports not just switch port 0.
+
+**-S <port_guid>** same as "-G". (provided only for backward compatibility)
+
+
+Cache File flags
+----------------
+
+.. include:: common/opt_load-cache.rst
+
+
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_o-outstanding_smps.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+**-R**  (This option is obsolete and does nothing)
+
+EXIT STATUS
+===========
+
+**-1** if scan fails.
+
+**0** if scan succeeds without errors beyond thresholds
+
+**1** if errors are found beyond thresholds or inconsistencies are found in check mode.
+
+FILES
+=====
+
+ERROR THRESHOLD
+---------------
+
+ at IBDIAG_CONFIG_PATH@/error_thresholds
+
+Define threshold values for errors.  File format is simple "name=val".
+Comments begin with '#'
+
+**Example:**
+
+::
+
+	# Define thresholds for error counters
+	SymbolErrorCounter=10
+	LinkErrorRecoveryCounter=10
+	VL15Dropped=100
+
+
+.. include:: common/sec_config-file.rst
+
+.. include:: common/sec_node-name-map.rst
+
+AUTHOR
+======
+
+Ira Weiny
+        < weiny2 at llnl.gov >
diff --git a/doc/rst/ibqueryerrors.8.in.rst.orig b/doc/rst/ibqueryerrors.8.in.rst.orig
new file mode 100644
index 0000000..d71b205
--- /dev/null
+++ b/doc/rst/ibqueryerrors.8.in.rst.orig
@@ -0,0 +1,153 @@
+=============
+IBQUERYERRORS
+=============
+
+---------------------------------
+query and report IB port counters
+---------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibqueryerrors [options]
+
+DESCRIPTION
+===========
+
+The default behavior is to report the port error counters which exceed a
+threshold for each port in the fabric.  The default threshold is zero (0).
+Error fields can also be suppressed entirely.
+
+In addition to reporting errors on every port.  ibqueryerrors can report the
+port transmit and receive data as well as report full link information to the
+remote port if available.
+
+OPTIONS
+=======
+
+**-s, --suppress <err1,err2,...>**
+Suppress the errors listed in the comma separated list provided.
+
+**-c, --suppress-common**
+Suppress some of the common "side effect" counters.  These counters usually do
+not indicate an error condition and can be usually be safely ignored.
+
+**-r, --report-port**
+Report the port information.  This includes LID, port, external port (if
+applicable), link speed setting, remote GUID, remote port, remote external port
+(if applicable), and remote node description information.
+
+**--data**
+Include the optional transmit and receive data counters.
+
+**--threshold-file <filename>**
+Specify an alternate threshold file.  The default is @IBDIAG_CONFIG_PATH@/error_thresholds
+
+**--switch**  print data for switch's only
+
+**--ca**  print data for CA's only
+
+**--router**  print data for routers only
+
+**--clear-errors -k** Clear error counters after read.
+
+**--clear-counts -K** Clear data counters after read.
+
+**CAUTION** clearing data or error counters will occur regardless of if they
+are printed or not.  See **--counters** and **--data** for details on
+controling which counters are printed.
+
+**--details** include receive error and transmit discard details
+
+**--counters** print data counters only
+
+
+Partial Scan flags
+------------------
+
+The node to start a partial scan can be specified with the following addresses.
+
+.. include:: common/opt_G_with_param.rst
+.. include:: common/opt_D_with_param.rst
+
+**Note:** For switches results are printed for all ports not just switch port 0.
+
+**-S <port_guid>** same as "-G". (provided only for backward compatibility)
+
+
+Cache File flags
+----------------
+
+.. include:: common/opt_load-cache.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+.. include:: common/opt_o-outstanding_smps.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_t.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+**-R**  (This option is obsolete and does nothing)
+
+EXIT STATUS
+===========
+
+**-1** if scan fails.
+
+**0** if scan succeeds without errors beyond thresholds
+
+**1** if errors are found beyond thresholds
+
+FILES
+=====
+
+ERROR THRESHOLD
+---------------
+
+ at IBDIAG_CONFIG_PATH@/error_thresholds
+
+Define threshold values for errors.  File format is simple "name=val".
+Comments begin with '#'
+
+**Example:**
+
+::
+
+	# Define thresholds for error counters
+	SymbolErrorCounter=10
+	LinkErrorRecoveryCounter=10
+	VL15Dropped=100
+
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+
+AUTHOR
+======
+
+Ira Weiny
+        < weiny2 at llnl.gov >
diff --git a/doc/rst/ibroute.8.in.rst b/doc/rst/ibroute.8.in.rst
new file mode 100644
index 0000000..c20136f
--- /dev/null
+++ b/doc/rst/ibroute.8.in.rst
@@ -0,0 +1,109 @@
+=======
+IBROUTE
+=======
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+-----------------------------------------
+query InfiniBand switch forwarding tables
+-----------------------------------------
+
+
+SYNOPSIS
+========
+
+ibroute [options] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
+
+DESCRIPTION
+===========
+
+ibroute uses SMPs to display the forwarding tables (unicast
+(LinearForwardingTable or LFT) or multicast (MulticastForwardingTable or MFT))
+for the specified switch LID and the optional lid (mlid) range.
+The default range is all valid entries in the range 1...FDBTop.
+
+OPTIONS
+=======
+
+**-a, --all**
+        show all lids in range, even invalid entries
+
+**-n, --no_dests**
+        do not try to resolve destinations
+
+**-M, --Multicast**
+        show multicast forwarding tables
+        In this case, the range parameters are specifying the mlid range.
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_D.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+EXAMPLES
+========
+
+Unicast examples
+
+::
+        ibroute 4               # dump all lids with valid out ports of switch with lid 4
+        ibroute -a 4            # same, but dump all lids, even with invalid out ports
+        ibroute -n 4            # simple dump format - no destination resolution
+        ibroute 4 10            # dump lids starting from 10 (up to FDBTop)
+        ibroute 4 0x10 0x20     # dump lid range
+        ibroute -G 0x08f1040023 # resolve switch by GUID
+        ibroute -D 0,1          # resolve switch by direct path
+
+Multicast examples
+
+::
+        ibroute -M 4                # dump all non empty mlids of switch with lid 4
+        ibroute -M 4 0xc010 0xc020  # same, but with range
+        ibroute -M -n 4             # simple dump format
+
+SEE ALSO
+========
+
+ibtracert (8)
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibrouters.8.in.rst b/doc/rst/ibrouters.8.in.rst
new file mode 100644
index 0000000..d6c8639
--- /dev/null
+++ b/doc/rst/ibrouters.8.in.rst
@@ -0,0 +1,57 @@
+=========
+IBROUTERS
+=========
+
+----------------------------------------
+show InfiniBand router nodes in topology
+----------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibrouters [options] [<topology-file>]
+
+DESCRIPTION
+===========
+
+ibrouters is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the router nodes.
+
+OPTIONS
+=======
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_z-config.rst
+
+.. include:: common/sec_portselection.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+SEE ALSO
+========
+
+ibnetdiscover(8)
+
+DEPENDENCIES
+============
+
+ibnetdiscover, ibnetdiscover format
+
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibstat.8.in.rst b/doc/rst/ibstat.8.in.rst
new file mode 100644
index 0000000..3e19b3e
--- /dev/null
+++ b/doc/rst/ibstat.8.in.rst
@@ -0,0 +1,83 @@
+======
+IBSTAT
+======
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+------------------------------------------
+query basic status of InfiniBand device(s)
+------------------------------------------
+
+
+SYNOPSIS
+========
+
+ibstat [options] <ca_name> [portnum]
+
+DESCRIPTION
+===========
+
+ibstat is a binary which displays basic information obtained from the local
+IB driver. Output includes LID, SMLID, port state, link width active, and port
+physical state.
+
+It is similar to the ibstatus utility but implemented as a binary rather
+than a script. It has options to list CAs and/or ports and displays more
+information than ibstatus.
+
+OPTIONS
+=======
+
+**-l, --list_of_cas**
+        list all IB devices
+
+**-s, --short**
+        short output
+
+**-p, --port_list**
+        show port list
+
+**ca_name**
+        InfiniBand device name
+
+**portnum**
+        port number of InfiniBand device
+
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_z-config.rst
+
+
+
+EXAMPLES
+========
+
+::
+        ibstat            # display status of all ports on all IB devices
+        ibstat -l         # list all IB devices
+        ibstat -p         # show port guids
+        ibstat mthca0 2   # show status of port 2 of 'mthca0'
+
+SEE ALSO
+========
+ibstatus (8)
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibstatus.8.in.rst b/doc/rst/ibstatus.8.in.rst
new file mode 100644
index 0000000..cfdac68
--- /dev/null
+++ b/doc/rst/ibstatus.8.in.rst
@@ -0,0 +1,54 @@
+========
+IBSTATUS
+========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+------------------------------------------
+query basic status of InfiniBand device(s)
+------------------------------------------
+
+
+SYNOPSIS
+========
+
+ibstatus [\-h] [devname[:port]]...
+
+DESCRIPTION
+===========
+
+ibstatus is a script which displays basic information obtained from the local
+IB driver. Output includes LID, SMLID, port state, link width active, and port
+physical state.
+
+OPTIONS
+=======
+
+.. include:: common/opt_h.rst
+
+**devname**
+        InfiniBand device name
+
+**portnum**
+        port number of InfiniBand device
+
+EXAMPLES
+========
+
+::
+        ibstatus                    # display status of all IB ports
+        ibstatus mthca1             # status of mthca1 ports
+        ibstatus mthca1:1 mthca0:2  # show status of specified ports
+
+SEE ALSO
+========
+
+**ibstat (8)**
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibswitches.8.in.rst b/doc/rst/ibswitches.8.in.rst
new file mode 100644
index 0000000..3a99337
--- /dev/null
+++ b/doc/rst/ibswitches.8.in.rst
@@ -0,0 +1,55 @@
+==========
+IBSWITCHES
+==========
+
+----------------------------------------
+show InfiniBand switch nodes in topology
+----------------------------------------
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: OpenIB Diagnostics
+
+
+SYNOPSIS
+========
+
+ibswitches [options] [<topology-file>]
+
+DESCRIPTION
+===========
+
+ibswitches is a script which either walks the IB subnet topology or uses an
+already saved topology file and extracts the switch nodes.
+
+OPTIONS
+=======
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/opt_t.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_z-config.rst
+
+.. include:: common/sec_portselection.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+SEE ALSO
+========
+ibnetdiscover(8)
+
+DEPENDENCIES
+============
+
+ibnetdiscover, ibnetdiscover format
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibsysstat.8.in.rst b/doc/rst/ibsysstat.8.in.rst
new file mode 100644
index 0000000..5451f39
--- /dev/null
+++ b/doc/rst/ibsysstat.8.in.rst
@@ -0,0 +1,87 @@
+=========
+IBSYSSTAT
+=========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+--------------------------------------
+system status on an InfiniBand address
+--------------------------------------
+
+
+SYNOPSIS
+========
+
+ibsysstat [options] <dest lid | guid> [<op>]
+
+DESCRIPTION
+===========
+
+ibsysstat uses vendor mads to validate connectivity between IB nodes
+and obtain other information about the IB node. ibsysstat is run as
+client/server. Default is to run as client.
+
+OPTIONS
+=======
+
+Current supported operations:
+
+::
+        ping \- verify connectivity to server (default)
+        host \- obtain host information from server
+        cpu  \- obtain cpu information from server
+
+**-o, --oui**
+        use specified OUI number to multiplex vendor mads
+
+**-S, --Server**
+        start in server mode (do not return)
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_z-config.rst
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/ibtracert.8.in.rst b/doc/rst/ibtracert.8.in.rst
new file mode 100644
index 0000000..ab43af0
--- /dev/null
+++ b/doc/rst/ibtracert.8.in.rst
@@ -0,0 +1,108 @@
+=========
+IBTRACERT
+=========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+---------------------
+trace InfiniBand path
+---------------------
+
+SYNOPSIS
+========
+
+ibtracert [options] [<lid|guid> [<startlid> [<endlid>]]]
+
+
+DESCRIPTION
+===========
+
+ibtracert uses SMPs to trace the path from a source GID/LID to a
+destination GID/LID. Each hop along the path is displayed until
+the destination is reached or a hop does not respond. By using
+the -m option, multicast path tracing can be performed between source
+and destination nodes.
+
+OPTIONS
+=======
+
+**-n, --no_info**
+        simple format; don't show additional information
+
+**-m**
+        show the multicast trace of the specified mlid
+
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+.. include:: common/sec_node-name-map.rst
+
+
+EXAMPLES
+========
+
+Unicast examples
+
+::
+        ibtracert 4 16                                  # show path between lids 4 and 16
+        ibtracert -n 4 16                               # same, but using simple output format
+        ibtracert -G 0x8f1040396522d 0x002c9000100d051  # use guid addresses
+
+Multicast example
+
+::
+        ibtracert -m 0xc000 4 16    # show multicast path of mlid 0xc000 between lids 4 and 16
+
+SEE ALSO
+========
+ibroute (8)
+
+
+AUTHOR
+======
+
+Hal Rosenstock
+        <hal.rosenstock at gmail.com>
+
+Ira Weiny
+        <weiny2 at llnl.gov >
diff --git a/doc/rst/infiniband-diags.8.in.rst b/doc/rst/infiniband-diags.8.in.rst
new file mode 100644
index 0000000..e5231c4
--- /dev/null
+++ b/doc/rst/infiniband-diags.8.in.rst
@@ -0,0 +1,166 @@
+================
+INFINIBAND-DIAGS
+================
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+----------------------------------
+Diagnostics for InfiniBand Fabrics
+----------------------------------
+
+
+DESCRIPTION
+===========
+
+infiniband-diags is a set of utilities designed to help configure, debug, and
+maintain infiniband fabrics.  Many tools and utilities are provided.  Some with
+similar functionality.
+
+The base utilities use directed route MAD's to perform their operations.  They
+may therefore work even in unconfigured subnets.  Other, higher level
+utilities, require LID routed MAD's and to some extent SA/SM access.
+
+
+THE USE OF SMPs (QP0)
+=====================
+
+Many of the tools in this package rely on the use of SMPs via QP0 to acquire
+data directly from the SMA.  While this mode of operation is not technically in
+compliance with the InfiniBand specification, practical experience has found
+that this level of diagnostics is valuable when working with a fabric which is
+broken or only partially configured.  For this reason many of these tools may
+require the use of an MKey or operation from Virtual Machines may be restricted
+for security reasons.
+
+
+COMMON OPTIONS
+==============
+
+Most OpenIB diagnostics take some of the following common flags. The exact list
+of supported flags per utility can be found in the documentation for those
+commands.
+
+
+Addressing Flags
+----------------
+
+The -D and -G option have two forms:
+
+.. include:: common/opt_D.rst
+.. include:: common/opt_D_with_param.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_G_with_param.rst
+
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_o-outstanding_smps.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_z-config.rst
+
+
+
+COMMON FILES
+============
+
+The following config files are common amongst many of the utilities.
+
+.. include:: common/sec_config-file.rst
+
+.. include:: common/sec_node-name-map.rst
+.. include:: common/sec_topology-file.rst
+
+
+
+Utilities list
+==============
+
+Basic fabric conectivity
+------------------------
+
+	See: ibnetdiscover, iblinkinfo
+
+Node information
+----------------
+
+	See: ibnodes, ibswitches, ibhosts, ibrouters
+
+Port information
+----------------
+
+	See: ibportstate, ibaddr
+
+Switch Forwarding Table info
+----------------------------
+
+	See: ibtracert, ibroute, dump_lfts, dump_mfts, check_lft_balance, ibfindnodesusing
+
+Peformance counters
+-------------------
+
+	See: ibqueryerrors, perfquery
+
+Local HCA info
+--------------
+
+	See: ibstat, ibstatus
+
+Connectivity check
+------------------
+
+	See: ibping, ibsysstat
+
+Low level query tools
+---------------------
+
+	See: smpquery, smpdump, saquery, sminfo
+
+Fabric verification tools
+-------------------------
+
+        See: ibidsverify
+
+
+Backwards compatibility scripts
+===============================
+
+The following scripts have been identified as redundant and/or lower performing
+as compared to the above scripts.  They are provided as legacy scripts when
+--enable-compat-utils is specified at build time.
+
+ibcheckerrors, ibclearcounters, ibclearerrors, ibdatacounters
+ibchecknet, ibchecknode, ibcheckport, ibcheckportstate,
+ibcheckportwidth, ibcheckstate, ibcheckwidth, ibswportwatch,
+ibprintca, ibprintrt, ibprintswitch, set_nodedesc.sh
+
+
+AUTHORS
+=======
+
+Ira Weiny
+        <weiny2 at llnl.gov>
diff --git a/doc/rst/perfquery.8.in.rst b/doc/rst/perfquery.8.in.rst
new file mode 100644
index 0000000..359c94e
--- /dev/null
+++ b/doc/rst/perfquery.8.in.rst
@@ -0,0 +1,177 @@
+=========
+PERFQUERY
+=========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+-----------------------------------------------
+query InfiniBand port counters on a single port
+-----------------------------------------------
+
+
+SYNOPSIS
+========
+
+perfquery [options] [<lid|guid> [[port] [reset_mask]]]
+
+DESCRIPTION
+===========
+
+perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance and
+error counters), PortExtendedCounters, PortXmitDataSL, PortRcvDataSL,
+PortRcvErrorDetails, PortXmitDiscardDetails, PortExtendedSpeedsCounters, or
+PortSamplesControl from the PMA at the node/port specified. Optionally shows
+aggregated counters for all ports of node.  Finally it can, reset after read,
+or just reset the counters.
+
+Note: In PortCounters, PortCountersExtended, PortXmitDataSL, and PortRcvDataSL,
+components that represent Data (e.g. PortXmitData and PortRcvData) indicate
+octets divided by 4 rather than just octets.
+
+Note: Inputting a port of 255 indicates an operation be performed on all ports.
+
+
+OPTIONS
+=======
+
+**-x, --extended**
+	show extended port counters rather than (basic) port counters.
+	Note that extended port counters attribute is optional.
+
+**-X, --xmtsl**
+	show transmit data SL counter. This is an optional counter for QoS.
+
+**-S, --rcvsl**
+	show receive data SL counter. This is an optional counter for QoS.
+
+**-D, --xmtdisc**
+	show transmit discard details. This is an optional counter.
+
+**-E, --rcverr**
+	show receive error details. This is an optional counter.
+
+**-D, --xmtdisc**
+	show transmit discard details. This is an optional counter.
+
+**-T, --extended_speeds**
+	show extended speeds port counters. This is an optional counter.
+
+**--oprcvcounters**
+	show Rcv Counters per Op code. This is an optional counter.
+
+**--flowctlcounters**
+	show flow control counters. This is an optional counter.
+
+**--vloppackets**
+	show packets received per Op code per VL. This is an optional counter.
+
+**--vlopdata**
+	show data received per Op code per VL. This is an optional counter.
+
+**--vlxmitflowctlerrors**
+	show flow control update errors per VL. This is an optional counter.
+
+**--vlxmitcounters**
+	show ticks waiting to transmit counters per VL. This is an optional counter.
+
+**--swportvlcong**
+	show sw port VL congestion. This is an optional counter.
+
+**--rcvcc**
+	show Rcv congestion control counters. This is an optional counter.
+
+**--slrcvfecn**
+	show SL Rcv FECN counters. This is an optional counter.
+
+**--slrcvbecn**
+	show SL Rcv BECN counters. This is an optional counter.
+
+**--xmitcc**
+	show Xmit congestion control counters. This is an optional counter.
+
+**--vlxmittimecc**
+	show VL Xmit Time congestion control counters. This is an optional counter.
+
+**-c, --smplctl**
+	show port samples control.
+
+**-a, --all_ports**
+	show aggregated counters for all ports of the destination lid or reset
+	all counters for all ports.  If the destination lid does not support
+	the AllPortSelect flag, all ports will be iterated through to emulate
+	AllPortSelect behavior.
+
+**-l, --loop_ports**
+	If all ports are selected by the user (either through the **-a** option
+	or port 255) iterate through each port rather than doing than aggregate
+	operation.
+
+**-r, --reset_after_read**
+	reset counters after read
+
+**-R, --Reset_only**
+	only reset counters
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+EXAMPLES
+========
+
+::
+	perfquery                # read local port performance counters
+	perfquery 32 1           # read performance counters from lid 32, port 1
+	perfquery -x 32 1        # read extended performance counters from lid 32, port 1
+	perfquery -a 32          # read perf counters from lid 32, all ports
+	perfquery -r 32 1        # read performance counters and reset
+	perfquery -x -r 32 1     # read extended performance counters and reset
+	perfquery -R 0x20 1      # reset performance counters of port 1 only
+	perfquery -x -R 0x20 1   # reset extended performance counters of port 1 only
+	perfquery -R -a 32       # reset performance counters of all ports
+	perfquery -R 32 2 0x0fff # reset only error counters of port 2
+	perfquery -R 32 2 0xf000 # reset only non-error counters of port 2
+
+AUTHOR
+======
+
+Hal Rosenstock
+	< hal.rosenstock at gmail.com >
diff --git a/doc/rst/saquery.8.in.rst b/doc/rst/saquery.8.in.rst
new file mode 100644
index 0000000..1a11965
--- /dev/null
+++ b/doc/rst/saquery.8.in.rst
@@ -0,0 +1,207 @@
+=======
+SAQUERY
+=======
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+-------------------------------------------------
+query InfiniBand subnet administration attributes
+-------------------------------------------------
+
+
+SYNOPSIS
+========
+
+saquery [options] [<name> | <lid> | <guid>]
+
+DESCRIPTION
+===========
+
+saquery issues the selected SA query. Node records are queried by default.
+
+OPTIONS
+=======
+
+**-p**
+        get PathRecord info
+
+**-N**
+        get NodeRecord info
+
+**-D, --list**
+        get NodeDescriptions of CAs only
+
+**-S**
+        get ServiceRecord info
+
+**-I**
+        get InformInfoRecord (subscription) info
+
+**-L**
+        return the Lids of the name specified
+
+**-l**
+        return the unique Lid of the name specified
+
+**-G**
+        return the Guids of the name specified
+
+**-O**
+        return the name for the Lid specified
+
+**-U**
+        return the name for the Guid specified
+
+**-c**
+        get the SA's class port info
+
+**-s**
+        return the PortInfoRecords with isSM or isSMdisabled capability mask bit on
+
+**-g**
+        get multicast group info
+
+**-m**
+        get multicast member info.  If a group is specified, limit the output
+        to the group specified and print one line containing only the GUID and
+        node description for each entry. Example: saquery -m 0xc000
+
+**-x**
+        get LinkRecord info
+
+**--src-to-dst <src:dst>**
+        get a PathRecord for <src:dst>
+        where src and dst are either node names or LIDs
+
+**--sgid-to-dgid <sgid:dgid>**
+        get a PathRecord for **sgid** to **dgid**
+        where both GIDs are in an IPv6 format acceptable to **inet_pton (3)**
+
+**--smkey <val>**
+        use SM_Key value for the query. Will be used only with "trusted"
+        queries.  If non-numeric value (like 'x') is specified then saquery
+	will prompt for a value.
+	Default (when not specified here or in
+	@IBDIAG_CONFIG_PATH@/ibdiag.conf) is to use SM_Key == 0 (or
+	\"untrusted\")
+
+.. include:: common/opt_K.rst
+
+**--slid <lid>** Source LID (PathRecord)
+
+**--dlid <lid>** Destination LID (PathRecord)
+
+**--mlid <lid>** Multicast LID (MCMemberRecord)
+
+**--sgid <gid>** Source GID (IPv6 format) (PathRecord)
+
+**--dgid <gid>** Destination GID (IPv6 format) (PathRecord)
+
+**--gid <gid>** Port GID (MCMemberRecord)
+
+**--mgid <gid>** Multicast GID (MCMemberRecord)
+
+**--reversible** Reversible path (PathRecord)
+
+**--numb_path** Number of paths (PathRecord)
+
+**--pkey** P_Key (PathRecord, MCMemberRecord). If non-numeric value (like 'x')
+        is specified then saquery will prompt for a value
+
+**--qos_class** QoS Class (PathRecord)
+
+**--sl** Service level (PathRecord, MCMemberRecord)
+
+**--mtu** MTU and selector (PathRecord, MCMemberRecord)
+
+**--rate** Rate and selector (PathRecord, MCMemberRecord)
+
+**--pkt_lifetime** Packet lifetime and selector (PathRecord, MCMemberRecord)
+
+**--qkey** Q_Key (MCMemberRecord). If non-numeric value (like 'x') is specified
+        then saquery will prompt for a value
+
+**--tclass** Traffic Class (PathRecord, MCMemberRecord)
+
+**--flow_label** Flow Label (PathRecord, MCMemberRecord)
+
+**--hop_limit** Hop limit (PathRecord, MCMemberRecord)
+
+**--scope** Scope (MCMemberRecord)
+
+**--join_state** Join state (MCMemberRecord)
+
+**--proxy_join** Proxy join (MCMemberRecord)
+
+Supported query names (and aliases):
+
+::
+        ClassPortInfo (CPI)
+        NodeRecord (NR) [lid]
+        PortInfoRecord (PIR) [[lid]/[port]/[options]]
+        SL2VLTableRecord (SL2VL) [[lid]/[in_port]/[out_port]]
+        PKeyTableRecord (PKTR) [[lid]/[port]/[block]]
+        VLArbitrationTableRecord (VLAR) [[lid]/[port]/[block]]
+        InformInfoRecord (IIR)
+        LinkRecord (LR) [[from_lid]/[from_port]] [[to_lid]/[to_port]]
+        ServiceRecord (SR)
+        PathRecord (PR)
+        MCMemberRecord (MCMR)
+        LFTRecord (LFTR) [[lid]/[block]]
+        MFTRecord (MFTR) [[mlid]/[position]/[block]]
+        GUIDInfoRecord (GIR) [[lid]/[block]]
+
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_o-outstanding_smps.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_z-config.rst
+
+
+
+COMMON FILES
+============
+
+.. include:: common/sec_config-file.rst
+
+.. include:: common/sec_node-name-map.rst
+
+
+
+DEPENDENCIES
+============
+
+OpenSM (or other running SM/SA), libosmcomp, libibumad, libibmad
+
+AUTHORS
+=======
+
+Ira Weiny
+        < weiny2 at llnl.gov >
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/sminfo.8.in.rst b/doc/rst/sminfo.8.in.rst
new file mode 100644
index 0000000..500d1d0
--- /dev/null
+++ b/doc/rst/sminfo.8.in.rst
@@ -0,0 +1,102 @@
+======
+SMINFO
+======
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+---------------------------------
+query InfiniBand SMInfo attribute
+---------------------------------
+
+SYNOPSIS
+========
+
+sminfo [options] sm_lid | sm_dr_path [modifier]
+
+DESCRIPTION
+===========
+
+Optionally set and display the output of a sminfo query in human readable
+format. The target SM is the one listed in the local port info, or the SM
+specified by the optional SM lid or by the SM direct routed path.
+
+Note: using sminfo for any purposes other then simple query may be very
+dangerous, and may result in a malfunction of the target SM.
+
+OPTIONS
+=======
+
+**-s, --state <state>** set SM state
+        0 not active
+
+        1 discovering
+
+        2 standby
+
+        3 master
+
+**-p, --priority <priority>** set priority (0-15)
+
+**-a, --activity <val>** set activity count
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_D.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+EXAMPLES
+========
+
+::
+        sminfo                  # local port\'s sminfo
+        sminfo 32               # show sminfo of lid 32
+        sminfo  -G 0x8f1040023  # same but using guid address
+
+
+SEE ALSO
+========
+
+smpdump (8)
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/smpdump.8.in.rst b/doc/rst/smpdump.8.in.rst
new file mode 100644
index 0000000..38460de
--- /dev/null
+++ b/doc/rst/smpdump.8.in.rst
@@ -0,0 +1,104 @@
+=======
+SMPDUMP
+=======
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+--------------------------------------------
+dump InfiniBand subnet management attributes
+--------------------------------------------
+
+
+SYNOPSIS
+========
+
+smpdump [options] <dlid|dr_path> <attribute> [attribute_modifier]
+
+DESCRIPTION
+===========
+
+smpdump is a general purpose SMP utility which gets SM attributes from a
+specified SMA. The result is dumped in hex by default.
+
+OPTIONS
+=======
+
+**dlid|drpath**
+        LID or DR path to SMA
+
+**attribute**
+        IBA attribute ID for SM attribute
+
+**attribute_modifier**
+        IBA modifier for SM attribute
+
+**-s, --string**
+        Print strings in packet if possible
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_D.rst
+.. include:: common/opt_L.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_z-config.rst
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+EXAMPLES
+========
+
+Direct Routed Examples
+
+::
+        smpdump -D 0,1,2,3,5 16 # NODE DESC
+        smpdump -D 0,1,2 0x15 2 # PORT INFO, port 2
+
+LID Routed Examples
+
+::
+        smpdump 3 0x15 2        # PORT INFO, lid 3 port 2
+        smpdump 0xa0 0x11       # NODE INFO, lid 0xa0
+
+SEE ALSO
+========
+
+smpquery (8)
+
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < halr at voltaire.com >
diff --git a/doc/rst/smpquery.8.in.rst b/doc/rst/smpquery.8.in.rst
new file mode 100644
index 0000000..989cb08
--- /dev/null
+++ b/doc/rst/smpquery.8.in.rst
@@ -0,0 +1,115 @@
+========
+SMPQUERY
+========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+---------------------------------------------
+query InfiniBand subnet management attributes
+---------------------------------------------
+
+
+SYNOPSIS
+========
+
+smpquery [options] <op> <dest dr_path|lid|guid> [op params]
+
+DESCRIPTION
+===========
+
+smpquery allows a basic subset of standard SMP queries including the following:
+node info, node description, switch info, port info. Fields are displayed in
+human readable format.
+
+OPTIONS
+=======
+
+Current supported operations and their parameters:
+
+::
+        nodeinfo <addr>
+        nodedesc <addr>
+        portinfo <addr> [<portnum>]     # default port is zero
+        switchinfo <addr>
+        pkeys <addr> [<portnum>]
+        sl2vl <addr> [<portnum>]
+        vlarb <addr> [<portnum>]
+        guids <addr>
+        mlnxextportinfo <addr> [<portnum>]  # default port is zero
+
+**-c, --combined**
+        Use Combined route address argument ``<lid> <DR_Path>``
+
+**-x, --extended**
+        Set SMSupportsExtendedSpeeds bit 31 in AttributeModifier
+        (only impacts PortInfo queries).
+
+.. include:: common/opt_K.rst
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_D.rst
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_node_name_map.rst
+.. include:: common/opt_y.rst
+.. include:: common/opt_z-config.rst
+
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+.. include:: common/sec_node-name-map.rst
+
+
+EXAMPLES
+========
+
+::
+        smpquery portinfo 3 1                     # portinfo by lid, with port modifier
+        smpquery -G switchinfo 0x2C9000100D051 1  # switchinfo by guid
+        smpquery -D nodeinfo 0                    # nodeinfo by direct route
+        smpquery -c nodeinfo 6 0,12               # nodeinfo by combined route
+
+SEE ALSO
+========
+
+smpdump (8)
+
+AUTHOR
+======
+
+Hal Rosenstock
+        < hal at mellanox.com >
diff --git a/doc/rst/vendstat.8.in.rst b/doc/rst/vendstat.8.in.rst
new file mode 100644
index 0000000..abb4e33
--- /dev/null
+++ b/doc/rst/vendstat.8.in.rst
@@ -0,0 +1,120 @@
+========
+VENDSTAT
+========
+
+:Date: @BUILD_DATE@
+:Manual section: 8
+:Manual group: Open IB Diagnostics
+
+------------------------------------------
+query InfiniBand vendor specific functions
+------------------------------------------
+
+
+SYNOPSIS
+========
+
+vendstat [options] <lid|guid>
+
+DESCRIPTION
+===========
+
+vendstat uses vendor specific MADs to access beyond the IB spec
+vendor specific functionality. Currently, there is support for
+Mellanox InfiniSwitch-III (IS3) and InfiniSwitch-IV (IS4).
+
+OPTIONS
+=======
+
+**-N**
+	show IS3 or IS4 general information.
+
+**-w**
+	show IS3 port xmit wait counters.
+
+**-i**
+	show IS4 counter group info.
+
+**-c <num,num>**
+	configure IS4 counter groups.
+
+	Configure IS4 counter groups 0 and 1. Such configuration is not
+	persistent across IS4 reboot.  First number is for counter group 0 and
+	second is for counter group 1.
+
+	Group 0 counter config values:
+
+::
+		0 - PortXmitDataSL0-7
+		1 - PortXmitDataSL8-15
+		2 - PortRcvDataSL0-7
+
+	Group 1 counter config values:
+
+::
+		1 - PortXmitDataSL8-15
+		2 - PortRcvDataSL0-7
+		8 - PortRcvDataSL8-15
+
+**-R, --Read <addr,mask>**
+	Read configuration space record at addr
+
+**-W, --Write <addr,val,mask>**
+	Write configuration space record at addr
+
+
+Addressing Flags
+----------------
+
+.. include:: common/opt_G.rst
+.. include:: common/opt_L.rst
+.. include:: common/opt_s.rst
+
+
+Port Selection flags
+--------------------
+
+.. include:: common/opt_C.rst
+.. include:: common/opt_P.rst
+.. include:: common/sec_portselection.rst
+
+
+Debugging flags
+---------------
+
+.. include:: common/opt_d.rst
+.. include:: common/opt_e.rst
+.. include:: common/opt_h.rst
+.. include:: common/opt_v.rst
+.. include:: common/opt_V.rst
+
+
+Configuration flags
+-------------------
+
+.. include:: common/opt_t.rst
+.. include:: common/opt_z-config.rst
+
+
+
+FILES
+=====
+
+.. include:: common/sec_config-file.rst
+
+
+EXAMPLES
+========
+
+::
+	vendstat -N 6		# read IS3 or IS4 general information
+	vendstat -w 6		# read IS3 port xmit wait counters
+	vendstat -i 6 12	# read IS4 port 12 counter group info
+	vendstat -c 0,1 6 12	# configure IS4 port 12 counter groups for PortXmitDataSL
+	vendstat -c 2,8 6 12	# configure IS4 port 12 counter groups for PortRcvDataSL
+
+AUTHOR
+======
+
+Hal Rosenstock
+	< hal.rosenstock at gmail.com >
diff --git a/etc/error_thresholds b/etc/error_thresholds
new file mode 100644
index 0000000..28cd295
--- /dev/null
+++ b/etc/error_thresholds
@@ -0,0 +1,16 @@
+# Define error thresholds here
+
+#SymbolErrorCounter=10
+#LinkErrorRecoveryCounter=10
+#LinkDownedCounter=10
+#PortRcvErrors=10
+#PortRcvRemotePhysicalErrors=100
+#PortRcvSwitchRelayErrors=100
+#PortXmitDiscards=100
+#PortXmitConstraintErrors=100
+#PortRcvConstraintErrors=100
+#LocalLinkIntegrityErrors=10
+#ExcessiveBufferOverrunErrors=10
+#VL15Dropped=100
+#PortXmitWait=1000
+
diff --git a/etc/ibdiag.conf b/etc/ibdiag.conf
new file mode 100644
index 0000000..9686d14
--- /dev/null
+++ b/etc/ibdiag.conf
@@ -0,0 +1,22 @@
+# Define different defaults for all infiniband-diag tools.  These can be
+# defined on the command line but this offers a more global config.
+
+# Defaults are to find the first port with Physical state == "LinkUp"
+#CA=mlx4_0
+
+# NOTE: that using a different Port may require an altered DR path.
+#       for example -D 0,1 will not work with port 2
+#Port=1
+
+# define a different default timeout
+#timeout=50
+
+# disable query of Mellanox Extended PortInfo on ibnetdiscover subnet sweeps
+# Default = true
+#MLX_EPI=false
+
+# define a default m_key
+#m_key=0x00
+
+# default smkey to be used for SA requests
+#sa_key=0x00
diff --git a/include/ibdiag_common.h b/include/ibdiag_common.h
index 39e09d7..7e6d5c1 100644
--- a/include/ibdiag_common.h
+++ b/include/ibdiag_common.h
@@ -1,6 +1,10 @@
 /*
  * Copyright (c) 2006-2007 The Regents of the University of California.
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2011 Lawrence Livermore National Security. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -35,28 +39,126 @@
 #ifndef _IBDIAG_COMMON_H_
 #define _IBDIAG_COMMON_H_
 
-#include <stdio.h>
-#include <inttypes.h>
+#include <stdarg.h>
+#include <infiniband/mad.h>
+#include <infiniband/iba/ib_types.h>
+#include <infiniband/ibnetdisc.h>
 
-extern char *argv0;
-extern int   ibdebug;
+extern int ibverbose;
+extern char *ibd_ca;
+extern int ibd_ca_port;
+extern enum MAD_DEST ibd_dest_type;
+extern ib_portid_t *ibd_sm_id;
+extern int ibd_timeout;
+extern uint32_t ibd_ibnetdisc_flags;
+extern uint64_t ibd_mkey;
+extern uint64_t ibd_sakey;
+extern int show_keys;
 
 /*========================================================*/
 /*                External interface                      */
 /*========================================================*/
 
 #undef DEBUG
-#define	DEBUG	if (ibdebug || verbose) IBWARN
-#define	VERBOSE	if (ibdebug || verbose > 1) IBWARN
-#define IBERROR(fmt, args...)	iberror(__FUNCTION__, fmt, ## args)
+#define DEBUG(fmt, ...) do { \
+	if (ibdebug) IBDEBUG(fmt, ## __VA_ARGS__); \
+} while (0)
+#define VERBOSE(fmt, ...) do { \
+	if (ibverbose) IBVERBOSE(fmt, ## __VA_ARGS__); \
+} while (0)
+#define IBERROR(fmt, ...) iberror(__FUNCTION__, fmt, ## __VA_ARGS__)
 
-void  iberror(const char *fn, char *msg, ...);
+#define NOT_DISPLAYED_STR "<not displayed>"
 
-#include <ibdiag_version.h>
+/* not all versions of ib_types.h will have this define */
+#ifndef IB_PM_PC_XMIT_WAIT_SUP
+#define IB_PM_PC_XMIT_WAIT_SUP (CL_HTON16(((uint16_t)1)<<12))
+#endif
 
-static inline const char* get_build_version(void)
-{
-	return "BUILD VERSION: " IBDIAG_VERSION " Build date: " __DATE__ " " __TIME__ ;
-}
+struct ibdiag_opt {
+	const char *name;
+	char letter;
+	unsigned has_arg;
+	const char *arg_tmpl;
+	const char *description;
+};
 
-#endif	/* _IBDIAG_COMMON_H_ */
+extern int ibdiag_process_opts(int argc, char *const argv[], void *context,
+			       const char *exclude_common_str,
+			       const struct ibdiag_opt custom_opts[],
+			       int (*custom_handler) (void *cxt, int val,
+						      char *optarg),
+			       const char *usage_args,
+			       const char *usage_examples[]);
+extern void ibdiag_show_usage();
+extern void iberror(const char *fn, char *msg, ...);
+
+/* convert counter values to a float with a unit specifier returned (using
+ * binary prefix)
+ * "data" is a flag indicating this counter is a byte counter multiplied by 4
+ * as per PortCounters[Extended]
+ */
+extern char *conv_cnt_human_readable(uint64_t val64, float *val, int data);
+
+int is_mlnx_ext_port_info_supported(uint32_t devid);
+
+/* define an SA query structure to be common
+ * This is by no means optimal but it moves the saquery functionality out of
+ * the saquery tool and provides it to other utilities.
+ */
+struct bind_handle {
+	int fd, agent;
+	ib_portid_t dport;
+	struct ibmad_port *srcport;
+};
+typedef struct bind_handle * bind_handle_t;
+bind_handle_t sa_get_bind_handle(void);
+void sa_free_bind_handle(bind_handle_t h);
+
+struct sa_query_result {
+	uint32_t status;
+	unsigned result_cnt;
+	void *p_result_madw;
+};
+int sa_query(struct bind_handle *h, uint8_t method,
+	     uint16_t attr, uint32_t mod, uint64_t comp_mask, uint64_t sm_key,
+	     void *data, size_t datasz, struct sa_query_result *result);
+void sa_free_result_mad(struct sa_query_result *result);
+void *sa_get_query_rec(void *mad, unsigned i);
+void sa_report_err(int status);
+
+#define cl_hton8(x) (x)
+#define CHECK_AND_SET_VAL(val, size, comp_with, target, name, mask) \
+	if ((int##size##_t) val != (int##size##_t) comp_with) { \
+		target = cl_hton##size((uint##size##_t) val); \
+		comp_mask |= IB_##name##_COMPMASK_##mask; \
+	}
+
+#define CHECK_AND_SET_GID(val, target, name, mask) \
+	if (valid_gid(&(val))) { \
+		memcpy(&(target), &(val), sizeof(val)); \
+		comp_mask |= IB_##name##_COMPMASK_##mask; \
+	}
+
+#define CHECK_AND_SET_VAL_AND_SEL(val, target, name, mask, sel) \
+	if (val) { \
+		target = val; \
+		comp_mask |= IB_##name##_COMPMASK_##mask##sel; \
+		comp_mask |= IB_##name##_COMPMASK_##mask; \
+	}
+
+void get_max_msg(char *width_msg, char *speed_msg, int msg_size,
+		 ibnd_port_t * port);
+
+int resolve_sm_portid(char *ca_name, uint8_t portnum, ib_portid_t *sm_id);
+int resolve_self(char *ca_name, uint8_t ca_port, ib_portid_t *portid,
+                 int *port, ibmad_gid_t *gid);
+int resolve_portid_str(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
+		       char *addr_str, enum MAD_DEST dest_type,
+		       ib_portid_t *sm_id, const struct ibmad_port *srcport);
+int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		   const char *format, va_list va_args);
+int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		  const char *format, ...);
+void dump_portinfo(void *pi, int pisize, int tabs);
+#endif				/* _IBDIAG_COMMON_H_ */
diff --git a/include/ibdiag_version.h b/include/ibdiag_version.h
index 72d14eb..e65dfa4 100644
--- a/include/ibdiag_version.h
+++ b/include/ibdiag_version.h
@@ -34,6 +34,6 @@
 #ifndef _IBDIAG_VERSION_H_
 #define _IBDIAG_VERSION_H_
 
-#define IBDIAG_VERSION "1.4.4_20090314"
+#define IBDIAG_VERSION "1.6.1"
 
 #endif	/* _IBDIAG_VERSION_H_ */
diff --git a/include/ibnetdiscover.h b/include/ibnetdiscover.h
deleted file mode 100644
index 0226615..0000000
--- a/include/ibnetdiscover.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Voltaire Inc.  All rights reserved.
- * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifndef _IBNETDISCOVER_H_
-#define _IBNETDISCOVER_H_
-
-#define MAXHOPS		63
-
-#define CA_NODE		1
-#define SWITCH_NODE	2
-#define ROUTER_NODE	3
-
-#define LIST_CA_NODE	 (1 << CA_NODE)
-#define LIST_SWITCH_NODE (1 << SWITCH_NODE)
-#define LIST_ROUTER_NODE (1 << ROUTER_NODE)
-
-/* Vendor IDs (for chassis based systems) */
-#define VTR_VENDOR_ID			0x8f1	/* Voltaire */
-#define TS_VENDOR_ID			0x5ad	/* Cisco */
-#define SS_VENDOR_ID			0x66a	/* InfiniCon */
-#define XS_VENDOR_ID			0x1397	/* Xsigo */
-
-
-typedef struct Port Port;
-typedef struct Node Node;
-typedef struct ChassisRecord ChassisRecord;
-
-struct ChassisRecord {
-	ChassisRecord *next;
-
-	unsigned char chassisnum;
-	unsigned char anafanum;
-	unsigned char slotnum;
-	unsigned char chassistype;
-	unsigned char chassisslot;
-};
-
-struct Port {
-	Port *next;
-	uint64_t portguid;
-	int portnum;
-	int lid;
-	int lmc;
-	int state;
-	int physstate;
-	int linkwidth;
-	int linkspeed;
-
-	Node *node;
-	Port *remoteport;		/* null if SMA */
-};
-
-struct Node {
-	Node *htnext;
-	Node *dnext;
-	Port *ports;
-	ib_portid_t path;
-	int type;
-	int dist;
-	int numports;
-	int localport;
-	int smalid;
-	int smalmc;
-	int smaenhsp0;
-	uint32_t devid;
-	uint32_t vendid;
-	uint64_t sysimgguid;
-	uint64_t nodeguid;
-	uint64_t portguid;
-	char nodedesc[64];
-	uint8_t nodeinfo[64];
-
-	ChassisRecord *chrecord;
-};
-
-#endif	/* _IBNETDISCOVER_H_ */
diff --git a/infiniband-diags.spec b/infiniband-diags.spec
index 4115a32..cff412a 100644
--- a/infiniband-diags.spec
+++ b/infiniband-diags.spec
@@ -1,17 +1,18 @@
 
-%define RELEASE 1.ofed1.4.1
-%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
+%define RELEASE 1
+%define rel %{?CUSTOM_RELEASE}%{!?CUSTOM_RELEASE:%RELEASE}
 
 Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools
 Name: infiniband-diags
-Version: 1.4.4_20090314
+Version: 1.6.1
 Release: %rel%{?dist}
 License: GPLv2 or BSD
 Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Source: http://www.openfabrics.org/downloads/management/infiniband-diags-1.4.4_20090314.tar.gz
+Source: http://www.openfabrics.org/downloads/management/infiniband-diags-1.6.1.tar.gz
 Url: http://openfabrics.org/
-BuildRequires: libibmad-devel, opensm-devel, libibcommon-devel, libibumad-devel
+BuildRequires: libibmad-devel, opensm-devel, libibumad-devel
+Requires: libibmad, opensm-libs, libibumad
 Provides: perl(IBswcountlimits)
 Obsoletes: openib-diags
 
@@ -19,15 +20,22 @@ Obsoletes: openib-diags
 This package provides IB diagnostic programs and scripts needed to
 diagnose an IB subnet.
 
+%package compat
+Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools
+Group: System Environment/Libraries
+BuildRequires: libibmad-devel, opensm-devel, libibumad-devel
+Requires: libibmad, opensm-libs, libibumad
+
+%description compat
+Deprecated scripts and utilities which provide duplicated functionality, most
+often at a reduced performance.  These are maintained for the time being for
+compatibility reasons.
+
 %prep
 %setup -q
 
-%if %{?_with_node_name_map:1}%{!?_with_node_name_map:0}
-%define _enable_node_name_map --with-node-name-map%{?_with_node_name_map}
-%endif
-
 %build
-%configure %{?_enable_node_name_map}
+%configure --enable-compat-utils
 make
 
 %install
@@ -39,21 +47,122 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files
+%files compat
 %defattr(-,root,root)
+%{_sbindir}/ibcheckerrs
+%{_mandir}/man8/ibcheckerrs.8.gz
+%{_sbindir}/ibchecknet
+%{_mandir}/man8/ibchecknet.8.gz
+%{_sbindir}/ibchecknode
+%{_mandir}/man8/ibchecknode.8.gz
+%{_sbindir}/ibcheckport
+%{_mandir}/man8/ibcheckport.8.gz
+%{_sbindir}/ibcheckportwidth
+%{_mandir}/man8/ibcheckportwidth.8.gz
+%{_sbindir}/ibcheckportstate
+%{_mandir}/man8/ibcheckportstate.8.gz
+%{_sbindir}/ibcheckwidth
+%{_mandir}/man8/ibcheckwidth.8.gz
+%{_sbindir}/ibcheckstate
+%{_mandir}/man8/ibcheckstate.8.gz
+%{_sbindir}/ibcheckerrors
+%{_mandir}/man8/ibcheckerrors.8.gz
+%{_sbindir}/ibdatacounts
+%{_mandir}/man8/ibdatacounts.8.gz
+%{_sbindir}/ibdatacounters
+%{_mandir}/man8/ibdatacounters.8.gz
 %{_sbindir}/ibdiscover.pl
-%{_sbindir}/ib*
+%{_mandir}/man8/ibdiscover.8.gz
+%{_sbindir}/ibswportwatch.pl
+%{_mandir}/man8/ibswportwatch.8.gz
+%{_sbindir}/ibqueryerrors.pl
+%{_sbindir}/iblinkinfo.pl
+%{_sbindir}/ibprintca.pl
+%{_mandir}/man8/ibprintca.8.gz
+%{_sbindir}/ibprintswitch.pl
+%{_mandir}/man8/ibprintswitch.8.gz
+%{_sbindir}/ibprintrt.pl
+%{_mandir}/man8/ibprintrt.8.gz
+%{_sbindir}/set_nodedesc.sh
+
+
+%files
+%defattr(-,root,root)
+# C programs here
+%{_sbindir}/ibaddr
+%{_mandir}/man8/ibaddr.8.gz
+%{_sbindir}/ibnetdiscover
+%{_mandir}/man8/ibnetdiscover.8.gz
+%{_sbindir}/ibping
+%{_mandir}/man8/ibping.8.gz
+%{_sbindir}/ibportstate
+%{_mandir}/man8/ibportstate.8.gz
+%{_sbindir}/ibroute
+%{_mandir}/man8/ibroute.8.gz
+%{_sbindir}/ibstat
+%{_mandir}/man8/ibstat.8.gz
+%{_sbindir}/ibsysstat
+%{_mandir}/man8/ibsysstat.8.gz
+%{_sbindir}/ibtracert
+%{_mandir}/man8/ibtracert.8.gz
 %{_sbindir}/perfquery
+%{_mandir}/man8/perfquery.8.gz
+%{_sbindir}/sminfo
+%{_mandir}/man8/sminfo.8.gz
+%{_sbindir}/smpdump
+%{_mandir}/man8/smpdump.8.gz
+%{_sbindir}/smpquery
+%{_mandir}/man8/smpquery.8.gz
 %{_sbindir}/saquery
+%{_mandir}/man8/saquery.8.gz
 %{_sbindir}/vendstat
-%{_sbindir}/dump_mfts.sh
-%{_sbindir}/dump_lfts.sh
+%{_mandir}/man8/vendstat.8.gz
+%{_sbindir}/iblinkinfo
+%{_mandir}/man8/iblinkinfo.8.gz
+%{_sbindir}/ibqueryerrors
+%{_mandir}/man8/ibqueryerrors.8.gz
+%{_sbindir}/ibcacheedit
+%{_mandir}/man8/ibcacheedit.8.gz
+%{_sbindir}/ibccquery
+%{_mandir}/man8/ibccquery.8.gz
+%{_sbindir}/ibccconfig
+%{_mandir}/man8/ibccconfig.8.gz
+
+# scripts here
+%{_sbindir}/ibhosts
+%{_mandir}/man8/ibhosts.8.gz
+%{_sbindir}/ibswitches
+%{_mandir}/man8/ibswitches.8.gz
+%{_sbindir}/ibnodes
+%{_mandir}/man8/ibnodes.8.gz
+%{_sbindir}/ibrouters
+%{_mandir}/man8/ibrouters.8.gz
+%{_sbindir}/ibfindnodesusing.pl
+%{_mandir}/man8/ibfindnodesusing.8.gz
+%{_sbindir}/ibidsverify.pl
+%{_mandir}/man8/ibidsverify.8.gz
 %{_sbindir}/check_lft_balance.pl
-%{_sbindir}/set_nodedesc.sh
-%{_sbindir}/sm*
-%define _perldir %(perl -e 'use Config; $T=$Config{installsitearch}; $T=~/(.*)\\/site_perl.*/; print $1;')
+%{_mandir}/man8/check_lft_balance.8.gz
+%{_sbindir}/dump_lfts.sh
+%{_mandir}/man8/dump_lfts.8.gz
+%{_sbindir}/dump_mfts.sh
+%{_mandir}/man8/dump_mfts.8.gz
+%{_sbindir}/ibclearerrors
+%{_mandir}/man8/ibclearerrors.8.gz
+%{_sbindir}/ibclearcounters
+%{_mandir}/man8/ibclearcounters.8.gz
+%{_sbindir}/ibstatus
+%{_mandir}/man8/ibstatus.8.gz
+
+# and the rest
+%{_mandir}/man8/infiniband-diags.8.gz
+%{_libdir}/*.a
+%{_libdir}/*.so*
+%{_mandir}/man3/*
+%{_includedir}/infiniband/*.h
+%define _perldir %(perl -e 'use Config; $T=$Config{installvendorlib}; print $T;')
 %{_perldir}/*
-%{_mandir}/man8/*
+%{_sysconfdir}/*
 %doc README COPYING ChangeLog
 
 %changelog
diff --git a/infiniband-diags.spec.in b/infiniband-diags.spec.in
index 9c8c0c4..d3fcd13 100644
--- a/infiniband-diags.spec.in
+++ b/infiniband-diags.spec.in
@@ -1,6 +1,6 @@
 
 %define RELEASE @RELEASE@
-%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
+%define rel %{?CUSTOM_RELEASE}%{!?CUSTOM_RELEASE:%RELEASE}
 
 Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools
 Name: infiniband-diags
@@ -11,7 +11,8 @@ Group: System Environment/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Source: http://www.openfabrics.org/downloads/management/@TARBALL@
 Url: http://openfabrics.org/
-BuildRequires: libibmad-devel, opensm-devel, libibcommon-devel, libibumad-devel
+BuildRequires: libibmad-devel, opensm-devel, libibumad-devel
+Requires: libibmad, opensm-libs, libibumad
 Provides: perl(IBswcountlimits)
 Obsoletes: openib-diags
 
@@ -19,15 +20,22 @@ Obsoletes: openib-diags
 This package provides IB diagnostic programs and scripts needed to
 diagnose an IB subnet.
 
+%package compat
+Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools
+Group: System Environment/Libraries
+BuildRequires: libibmad-devel, opensm-devel, libibumad-devel
+Requires: libibmad, opensm-libs, libibumad
+
+%description compat
+Deprecated scripts and utilities which provide duplicated functionality, most
+often at a reduced performance.  These are maintained for the time being for
+compatibility reasons.
+
 %prep
 %setup -q
 
-%if %{?_with_node_name_map:1}%{!?_with_node_name_map:0}
-%define _enable_node_name_map --with-node-name-map%{?_with_node_name_map}
-%endif
-
 %build
-%configure %{?_enable_node_name_map}
+%configure --enable-compat-utils
 make
 
 %install
@@ -39,21 +47,122 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files
+%files compat
 %defattr(-,root,root)
+%{_sbindir}/ibcheckerrs
+%{_mandir}/man8/ibcheckerrs.8.gz
+%{_sbindir}/ibchecknet
+%{_mandir}/man8/ibchecknet.8.gz
+%{_sbindir}/ibchecknode
+%{_mandir}/man8/ibchecknode.8.gz
+%{_sbindir}/ibcheckport
+%{_mandir}/man8/ibcheckport.8.gz
+%{_sbindir}/ibcheckportwidth
+%{_mandir}/man8/ibcheckportwidth.8.gz
+%{_sbindir}/ibcheckportstate
+%{_mandir}/man8/ibcheckportstate.8.gz
+%{_sbindir}/ibcheckwidth
+%{_mandir}/man8/ibcheckwidth.8.gz
+%{_sbindir}/ibcheckstate
+%{_mandir}/man8/ibcheckstate.8.gz
+%{_sbindir}/ibcheckerrors
+%{_mandir}/man8/ibcheckerrors.8.gz
+%{_sbindir}/ibdatacounts
+%{_mandir}/man8/ibdatacounts.8.gz
+%{_sbindir}/ibdatacounters
+%{_mandir}/man8/ibdatacounters.8.gz
 %{_sbindir}/ibdiscover.pl
-%{_sbindir}/ib*
+%{_mandir}/man8/ibdiscover.8.gz
+%{_sbindir}/ibswportwatch.pl
+%{_mandir}/man8/ibswportwatch.8.gz
+%{_sbindir}/ibqueryerrors.pl
+%{_sbindir}/iblinkinfo.pl
+%{_sbindir}/ibprintca.pl
+%{_mandir}/man8/ibprintca.8.gz
+%{_sbindir}/ibprintswitch.pl
+%{_mandir}/man8/ibprintswitch.8.gz
+%{_sbindir}/ibprintrt.pl
+%{_mandir}/man8/ibprintrt.8.gz
+%{_sbindir}/set_nodedesc.sh
+
+
+%files
+%defattr(-,root,root)
+# C programs here
+%{_sbindir}/ibaddr
+%{_mandir}/man8/ibaddr.8.gz
+%{_sbindir}/ibnetdiscover
+%{_mandir}/man8/ibnetdiscover.8.gz
+%{_sbindir}/ibping
+%{_mandir}/man8/ibping.8.gz
+%{_sbindir}/ibportstate
+%{_mandir}/man8/ibportstate.8.gz
+%{_sbindir}/ibroute
+%{_mandir}/man8/ibroute.8.gz
+%{_sbindir}/ibstat
+%{_mandir}/man8/ibstat.8.gz
+%{_sbindir}/ibsysstat
+%{_mandir}/man8/ibsysstat.8.gz
+%{_sbindir}/ibtracert
+%{_mandir}/man8/ibtracert.8.gz
 %{_sbindir}/perfquery
+%{_mandir}/man8/perfquery.8.gz
+%{_sbindir}/sminfo
+%{_mandir}/man8/sminfo.8.gz
+%{_sbindir}/smpdump
+%{_mandir}/man8/smpdump.8.gz
+%{_sbindir}/smpquery
+%{_mandir}/man8/smpquery.8.gz
 %{_sbindir}/saquery
+%{_mandir}/man8/saquery.8.gz
 %{_sbindir}/vendstat
-%{_sbindir}/dump_mfts.sh
-%{_sbindir}/dump_lfts.sh
+%{_mandir}/man8/vendstat.8.gz
+%{_sbindir}/iblinkinfo
+%{_mandir}/man8/iblinkinfo.8.gz
+%{_sbindir}/ibqueryerrors
+%{_mandir}/man8/ibqueryerrors.8.gz
+%{_sbindir}/ibcacheedit
+%{_mandir}/man8/ibcacheedit.8.gz
+%{_sbindir}/ibccquery
+%{_mandir}/man8/ibccquery.8.gz
+%{_sbindir}/ibccconfig
+%{_mandir}/man8/ibccconfig.8.gz
+
+# scripts here
+%{_sbindir}/ibhosts
+%{_mandir}/man8/ibhosts.8.gz
+%{_sbindir}/ibswitches
+%{_mandir}/man8/ibswitches.8.gz
+%{_sbindir}/ibnodes
+%{_mandir}/man8/ibnodes.8.gz
+%{_sbindir}/ibrouters
+%{_mandir}/man8/ibrouters.8.gz
+%{_sbindir}/ibfindnodesusing.pl
+%{_mandir}/man8/ibfindnodesusing.8.gz
+%{_sbindir}/ibidsverify.pl
+%{_mandir}/man8/ibidsverify.8.gz
 %{_sbindir}/check_lft_balance.pl
-%{_sbindir}/set_nodedesc.sh
-%{_sbindir}/sm*
-%define _perldir %(perl -e 'use Config; $T=$Config{installsitearch}; $T=~/(.*)\\/site_perl.*/; print $1;')
+%{_mandir}/man8/check_lft_balance.8.gz
+%{_sbindir}/dump_lfts.sh
+%{_mandir}/man8/dump_lfts.8.gz
+%{_sbindir}/dump_mfts.sh
+%{_mandir}/man8/dump_mfts.8.gz
+%{_sbindir}/ibclearerrors
+%{_mandir}/man8/ibclearerrors.8.gz
+%{_sbindir}/ibclearcounters
+%{_mandir}/man8/ibclearcounters.8.gz
+%{_sbindir}/ibstatus
+%{_mandir}/man8/ibstatus.8.gz
+
+# and the rest
+%{_mandir}/man8/infiniband-diags.8.gz
+%{_libdir}/*.a
+%{_libdir}/*.so*
+%{_mandir}/man3/*
+%{_includedir}/infiniband/*.h
+%define _perldir %(perl -e 'use Config; $T=$Config{installvendorlib}; print $T;')
 %{_perldir}/*
-%{_mandir}/man8/*
+%{_sysconfdir}/*
 %doc README COPYING ChangeLog
 
 %changelog
diff --git a/libibnetdisc/Makefile.am b/libibnetdisc/Makefile.am
new file mode 100644
index 0000000..fbf0e60
--- /dev/null
+++ b/libibnetdisc/Makefile.am
@@ -0,0 +1,52 @@
+
+#SUBDIRS = .
+
+INCLUDES = -I$(srcdir)/include -I$(includedir) -I$(includedir)/infiniband
+
+lib_LTLIBRARIES = libibnetdisc.la
+sbin_PROGRAMS =
+
+if ENABLE_TEST_UTILS
+sbin_PROGRAMS += test/testleaks
+endif
+
+if DEBUG
+DBGFLAGS = -ggdb -D_DEBUG_
+else
+DBGFLAGS =
+endif
+
+if HAVE_LD_VERSION_SCRIPT
+libibnetdisc_version_script = -Wl,--version-script=$(srcdir)/src/libibnetdisc.map
+else
+libibnetdisc_version_script =
+endif
+
+libibnetdisc_la_SOURCES = src/ibnetdisc.c src/ibnetdisc_cache.c src/chassis.c \
+			  src/chassis.h src/internal.h src/query_smp.c
+libibnetdisc_la_CFLAGS = -Wall $(DBGFLAGS)
+libibnetdisc_la_LDFLAGS = -version-info $(ibnetdisc_api_version) \
+	-export-dynamic $(libibnetdisc_version_script) \
+	-libmad
+libibnetdisc_la_DEPENDENCIES = $(srcdir)/src/libibnetdisc.map
+
+libibnetdiscincludedir = $(includedir)/infiniband
+
+test_testleaks_SOURCES = test/testleaks.c
+test_testleaks_CFLAGS = -Wall $(DBGFLAGS)
+test_testleaks_LDFLAGS = -libnetdisc
+
+libibnetdiscinclude_HEADERS = $(srcdir)/include/infiniband/ibnetdisc.h \
+				$(srcdir)/include/infiniband/ibnetdisc_osd.h
+
+man_MANS = man/ibnd_debug.3 \
+	man/ibnd_destroy_fabric.3 \
+	man/ibnd_discover_fabric.3 \
+	man/ibnd_find_node_dr.3 \
+	man/ibnd_find_node_guid.3 \
+	man/ibnd_iter_nodes.3 \
+	man/ibnd_iter_nodes_type.3 \
+	man/ibnd_show_progress.3
+
+EXTRA_DIST = $(srcdir)/src/libibnetdisc.map libibnetdisc.ver $(man_MANS)
+
diff --git a/libibnetdisc/Makefile.in b/libibnetdisc/Makefile.in
new file mode 100644
index 0000000..43fce8a
--- /dev/null
+++ b/libibnetdisc/Makefile.in
@@ -0,0 +1,755 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  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.
+
+ at SET_MAKE@
+
+#SUBDIRS = .
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+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 = :
+build_triplet = @build@
+host_triplet = @host@
+sbin_PROGRAMS = $(am__EXEEXT_1)
+ at ENABLE_TEST_UTILS_TRUE@am__append_1 = test/testleaks
+subdir = libibnetdisc
+DIST_COMMON = $(libibnetdiscinclude_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+	$(top_srcdir)/config/ltoptions.m4 \
+	$(top_srcdir)/config/ltsugar.m4 \
+	$(top_srcdir)/config/ltversion.m4 \
+	$(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" \
+	"$(DESTDIR)$(man3dir)" "$(DESTDIR)$(libibnetdiscincludedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libibnetdisc_la_LIBADD =
+am_libibnetdisc_la_OBJECTS = libibnetdisc_la-ibnetdisc.lo \
+	libibnetdisc_la-ibnetdisc_cache.lo libibnetdisc_la-chassis.lo \
+	libibnetdisc_la-query_smp.lo
+libibnetdisc_la_OBJECTS = $(am_libibnetdisc_la_OBJECTS)
+libibnetdisc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libibnetdisc_la_CFLAGS) \
+	$(CFLAGS) $(libibnetdisc_la_LDFLAGS) $(LDFLAGS) -o $@
+ at ENABLE_TEST_UTILS_TRUE@am__EXEEXT_1 = test/testleaks$(EXEEXT)
+PROGRAMS = $(sbin_PROGRAMS)
+am_test_testleaks_OBJECTS = test_testleaks-testleaks.$(OBJEXT)
+test_testleaks_OBJECTS = $(am_test_testleaks_OBJECTS)
+test_testleaks_LDADD = $(LDADD)
+test_testleaks_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_testleaks_CFLAGS) \
+	$(CFLAGS) $(test_testleaks_LDFLAGS) $(LDFLAGS) -o $@
+am__dirstamp = $(am__leading_dot)dirstamp
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libibnetdisc_la_SOURCES) $(test_testleaks_SOURCES)
+DIST_SOURCES = $(libibnetdisc_la_SOURCES) $(test_testleaks_SOURCES)
+man3dir = $(mandir)/man3
+NROFF = nroff
+MANS = $(man_MANS)
+HEADERS = $(libibnetdiscinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_DATE = @BUILD_DATE@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+IBDIAG_CONFIG_PATH = @IBDIAG_CONFIG_PATH@
+IBSCRIPTPATH = @IBSCRIPTPATH@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+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@
+PERL = @PERL@
+PERL_INSTALLDIR = @PERL_INSTALLDIR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TARBALL = @TARBALL@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+have_rst2man = @have_rst2man@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+ibnetdisc_api_version = @ibnetdisc_api_version@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+INCLUDES = -I$(srcdir)/include -I$(includedir) -I$(includedir)/infiniband
+lib_LTLIBRARIES = libibnetdisc.la
+ at DEBUG_FALSE@DBGFLAGS = 
+ at DEBUG_TRUE@DBGFLAGS = -ggdb -D_DEBUG_
+ at HAVE_LD_VERSION_SCRIPT_FALSE@libibnetdisc_version_script = 
+ at HAVE_LD_VERSION_SCRIPT_TRUE@libibnetdisc_version_script = -Wl,--version-script=$(srcdir)/src/libibnetdisc.map
+libibnetdisc_la_SOURCES = src/ibnetdisc.c src/ibnetdisc_cache.c src/chassis.c \
+			  src/chassis.h src/internal.h src/query_smp.c
+
+libibnetdisc_la_CFLAGS = -Wall $(DBGFLAGS)
+libibnetdisc_la_LDFLAGS = -version-info $(ibnetdisc_api_version) \
+	-export-dynamic $(libibnetdisc_version_script) \
+	-libmad
+
+libibnetdisc_la_DEPENDENCIES = $(srcdir)/src/libibnetdisc.map
+libibnetdiscincludedir = $(includedir)/infiniband
+test_testleaks_SOURCES = test/testleaks.c
+test_testleaks_CFLAGS = -Wall $(DBGFLAGS)
+test_testleaks_LDFLAGS = -libnetdisc
+libibnetdiscinclude_HEADERS = $(srcdir)/include/infiniband/ibnetdisc.h \
+				$(srcdir)/include/infiniband/ibnetdisc_osd.h
+
+man_MANS = man/ibnd_debug.3 \
+	man/ibnd_destroy_fabric.3 \
+	man/ibnd_discover_fabric.3 \
+	man/ibnd_find_node_dr.3 \
+	man/ibnd_find_node_guid.3 \
+	man/ibnd_iter_nodes.3 \
+	man/ibnd_iter_nodes_type.3 \
+	man/ibnd_show_progress.3
+
+EXTRA_DIST = $(srcdir)/src/libibnetdisc.map libibnetdisc.ver $(man_MANS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libibnetdisc/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign libibnetdisc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libibnetdisc.la: $(libibnetdisc_la_OBJECTS) $(libibnetdisc_la_DEPENDENCIES) 
+	$(libibnetdisc_la_LINK) -rpath $(libdir) $(libibnetdisc_la_OBJECTS) $(libibnetdisc_la_LIBADD) $(LIBS)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+test/$(am__dirstamp):
+	@$(MKDIR_P) test
+	@: > test/$(am__dirstamp)
+test/testleaks$(EXEEXT): $(test_testleaks_OBJECTS) $(test_testleaks_DEPENDENCIES) test/$(am__dirstamp)
+	@rm -f test/testleaks$(EXEEXT)
+	$(test_testleaks_LINK) $(test_testleaks_OBJECTS) $(test_testleaks_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libibnetdisc_la-chassis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libibnetdisc_la-ibnetdisc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libibnetdisc_la-ibnetdisc_cache.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libibnetdisc_la-query_smp.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_testleaks-testleaks.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+libibnetdisc_la-ibnetdisc.lo: src/ibnetdisc.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -MT libibnetdisc_la-ibnetdisc.lo -MD -MP -MF $(DEPDIR)/libibnetdisc_la-ibnetdisc.Tpo -c -o libibnetdisc_la-ibnetdisc.lo `test -f 'src/ibnetdisc.c' || echo '$(srcdir)/'`src/ibnetdisc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libibnetdisc_la-ibnetdisc.Tpo $(DEPDIR)/libibnetdisc_la-ibnetdisc.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibnetdisc.c' object='libibnetdisc_la-ibnetdisc.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -c -o libibnetdisc_la-ibnetdisc.lo `test -f 'src/ibnetdisc.c' || echo '$(srcdir)/'`src/ibnetdisc.c
+
+libibnetdisc_la-ibnetdisc_cache.lo: src/ibnetdisc_cache.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -MT libibnetdisc_la-ibnetdisc_cache.lo -MD -MP -MF $(DEPDIR)/libibnetdisc_la-ibnetdisc_cache.Tpo -c -o libibnetdisc_la-ibnetdisc_cache.lo `test -f 'src/ibnetdisc_cache.c' || echo '$(srcdir)/'`src/ibnetdisc_cache.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libibnetdisc_la-ibnetdisc_cache.Tpo $(DEPDIR)/libibnetdisc_la-ibnetdisc_cache.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/ibnetdisc_cache.c' object='libibnetdisc_la-ibnetdisc_cache.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -c -o libibnetdisc_la-ibnetdisc_cache.lo `test -f 'src/ibnetdisc_cache.c' || echo '$(srcdir)/'`src/ibnetdisc_cache.c
+
+libibnetdisc_la-chassis.lo: src/chassis.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -MT libibnetdisc_la-chassis.lo -MD -MP -MF $(DEPDIR)/libibnetdisc_la-chassis.Tpo -c -o libibnetdisc_la-chassis.lo `test -f 'src/chassis.c' || echo '$(srcdir)/'`src/chassis.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libibnetdisc_la-chassis.Tpo $(DEPDIR)/libibnetdisc_la-chassis.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/chassis.c' object='libibnetdisc_la-chassis.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -c -o libibnetdisc_la-chassis.lo `test -f 'src/chassis.c' || echo '$(srcdir)/'`src/chassis.c
+
+libibnetdisc_la-query_smp.lo: src/query_smp.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -MT libibnetdisc_la-query_smp.lo -MD -MP -MF $(DEPDIR)/libibnetdisc_la-query_smp.Tpo -c -o libibnetdisc_la-query_smp.lo `test -f 'src/query_smp.c' || echo '$(srcdir)/'`src/query_smp.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libibnetdisc_la-query_smp.Tpo $(DEPDIR)/libibnetdisc_la-query_smp.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='src/query_smp.c' object='libibnetdisc_la-query_smp.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libibnetdisc_la_CFLAGS) $(CFLAGS) -c -o libibnetdisc_la-query_smp.lo `test -f 'src/query_smp.c' || echo '$(srcdir)/'`src/query_smp.c
+
+test_testleaks-testleaks.o: test/testleaks.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_testleaks_CFLAGS) $(CFLAGS) -MT test_testleaks-testleaks.o -MD -MP -MF $(DEPDIR)/test_testleaks-testleaks.Tpo -c -o test_testleaks-testleaks.o `test -f 'test/testleaks.c' || echo '$(srcdir)/'`test/testleaks.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/test_testleaks-testleaks.Tpo $(DEPDIR)/test_testleaks-testleaks.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='test/testleaks.c' object='test_testleaks-testleaks.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_testleaks_CFLAGS) $(CFLAGS) -c -o test_testleaks-testleaks.o `test -f 'test/testleaks.c' || echo '$(srcdir)/'`test/testleaks.c
+
+test_testleaks-testleaks.obj: test/testleaks.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_testleaks_CFLAGS) $(CFLAGS) -MT test_testleaks-testleaks.obj -MD -MP -MF $(DEPDIR)/test_testleaks-testleaks.Tpo -c -o test_testleaks-testleaks.obj `if test -f 'test/testleaks.c'; then $(CYGPATH_W) 'test/testleaks.c'; else $(CYGPATH_W) '$(srcdir)/test/testleaks.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/test_testleaks-testleaks.Tpo $(DEPDIR)/test_testleaks-testleaks.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='test/testleaks.c' object='test_testleaks-testleaks.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_testleaks_CFLAGS) $(CFLAGS) -c -o test_testleaks-testleaks.obj `if test -f 'test/testleaks.c'; then $(CYGPATH_W) 'test/testleaks.c'; else $(CYGPATH_W) '$(srcdir)/test/testleaks.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+	-rm -rf test/.libs test/_libs
+install-man3: $(man_MANS)
+	@$(NORMAL_INSTALL)
+	test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
+	@list=''; test -n "$(man3dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.3[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man3:
+	@$(NORMAL_UNINSTALL)
+	@list=''; test -n "$(man3dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.3[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man3dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man3dir)" && rm -f $$files; }
+install-libibnetdiscincludeHEADERS: $(libibnetdiscinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	test -z "$(libibnetdiscincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libibnetdiscincludedir)"
+	@list='$(libibnetdiscinclude_HEADERS)'; test -n "$(libibnetdiscincludedir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libibnetdiscincludedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(libibnetdiscincludedir)" || exit $$?; \
+	done
+
+uninstall-libibnetdiscincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(libibnetdiscinclude_HEADERS)'; test -n "$(libibnetdiscincludedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libibnetdiscincludedir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libibnetdiscincludedir)" && rm -f $$files
+
+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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	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; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$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 $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(libibnetdiscincludedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+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:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+	-rm -f test/$(am__dirstamp)
+
+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-generic clean-libLTLIBRARIES clean-libtool \
+	clean-sbinPROGRAMS 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:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-libibnetdiscincludeHEADERS install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES install-sbinPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man3
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+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 \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES \
+	uninstall-libibnetdiscincludeHEADERS uninstall-man \
+	uninstall-sbinPROGRAMS
+
+uninstall-man: uninstall-man3
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool clean-sbinPROGRAMS ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-libLTLIBRARIES \
+	install-libibnetdiscincludeHEADERS install-man install-man3 \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-sbinPROGRAMS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-libLTLIBRARIES \
+	uninstall-libibnetdiscincludeHEADERS uninstall-man \
+	uninstall-man3 uninstall-sbinPROGRAMS
+
+
+# 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:
diff --git a/libibnetdisc/include/infiniband/ibnetdisc.h b/libibnetdisc/include/infiniband/ibnetdisc.h
new file mode 100644
index 0000000..335ad83
--- /dev/null
+++ b/libibnetdisc/include/infiniband/ibnetdisc.h
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2009 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2010-2011 Mellanox Technologies LTD.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _IBNETDISC_H_
+#define _IBNETDISC_H_
+
+#include <stdio.h>
+#include <infiniband/mad.h>
+#include <iba/ib_types.h>
+
+#include <infiniband/ibnetdisc_osd.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct ibnd_chassis;		/* forward declare */
+struct ibnd_port;		/* forward declare */
+
+#define CHASSIS_TYPE_SIZE 20
+
+/** =========================================================================
+ * Node
+ */
+typedef struct ibnd_node {
+	struct ibnd_node *next;	/* all node list in fabric */
+
+	ib_portid_t path_portid;	/* path from "from_node" */
+	uint16_t smalid;
+	uint8_t smalmc;
+
+	/* quick cache of switchinfo below */
+	int smaenhsp0;
+	/* use libibmad decoder functions for switchinfo */
+	uint8_t switchinfo[IB_SMP_DATA_SIZE];
+
+	/* quick cache of info below */
+	uint64_t guid;
+	int type;
+	int numports;
+	/* use libibmad decoder functions for info */
+	uint8_t info[IB_SMP_DATA_SIZE];
+
+	char nodedesc[IB_SMP_DATA_SIZE];
+
+	struct ibnd_port **ports;	/* array of ports, indexed by port number
+					   ports[1] == port 1,
+					   ports[2] == port 2,
+					   etc...
+					   Any port in the array MAY BE NULL!
+					   Most notable is non-switches have no
+					   port 0 therefore node.ports[0] == NULL
+					   for those nodes */
+
+	/* chassis info */
+	struct ibnd_node *next_chassis_node;	/* next node in ibnd_chassis_t->nodes */
+	struct ibnd_chassis *chassis;	/* if != NULL the chassis this node belongs to */
+	unsigned char ch_type;
+	char ch_type_str[CHASSIS_TYPE_SIZE];
+	unsigned char ch_anafanum;
+	unsigned char ch_slotnum;
+	unsigned char ch_slot;
+
+	/* internal use only */
+	unsigned char ch_found;
+	struct ibnd_node *htnext;	/* hash table list */
+	struct ibnd_node *type_next;	/* next based on type */
+} ibnd_node_t;
+
+/** =========================================================================
+ * Port
+ */
+typedef struct ibnd_port {
+	uint64_t guid;
+	int portnum;
+	int ext_portnum;	/* optional if != 0 external port num */
+	ibnd_node_t *node;	/* node this port belongs to */
+	struct ibnd_port *remoteport;	/* null if SMA, or does not exist */
+	/* quick cache of info below */
+	uint16_t base_lid;
+	uint8_t lmc;
+	/* use libibmad decoder functions for info */
+	uint8_t info[IB_SMP_DATA_SIZE];
+	uint8_t ext_info[IB_SMP_DATA_SIZE];
+
+	/* internal use only */
+	struct ibnd_port *htnext;
+} ibnd_port_t;
+
+/** =========================================================================
+ * Chassis
+ */
+typedef struct ibnd_chassis {
+	struct ibnd_chassis *next;
+	uint64_t chassisguid;
+	unsigned char chassisnum;
+
+	/* generic grouping by SystemImageGUID */
+	unsigned char nodecount;
+	ibnd_node_t *nodes;
+
+	/* specific to voltaire type nodes */
+#define SPINES_MAX_NUM 18
+#define LINES_MAX_NUM 36
+	ibnd_node_t *spinenode[SPINES_MAX_NUM + 1];
+	ibnd_node_t *linenode[LINES_MAX_NUM + 1];
+} ibnd_chassis_t;
+
+#define HTSZ 137
+
+/* define config flags */
+#define IBND_CONFIG_MLX_EPI (1 << 0)
+
+typedef struct ibnd_config {
+	unsigned max_smps;
+	unsigned show_progress;
+	unsigned max_hops;
+	unsigned debug;
+	unsigned timeout_ms;
+	unsigned retries;
+	uint32_t flags;
+	uint64_t mkey;
+	uint8_t pad[44];
+} ibnd_config_t;
+
+/** =========================================================================
+ * Fabric
+ * Main fabric object which is returned and represents the data discovered
+ */
+typedef struct ibnd_fabric {
+	/* the node the discover was initiated from
+	 * "from" parameter in ibnd_discover_fabric
+	 * or by default the node you ar running on
+	 */
+	ibnd_node_t *from_node;
+	int from_portnum;
+
+	/* NULL term list of all nodes in the fabric */
+	ibnd_node_t *nodes;
+	/* NULL terminated list of all chassis found in the fabric */
+	ibnd_chassis_t *chassis;
+	unsigned maxhops_discovered;
+	unsigned total_mads_used;
+
+	/* internal use only */
+	ibnd_node_t *nodestbl[HTSZ];
+	ibnd_port_t *portstbl[HTSZ];
+	ibnd_node_t *switches;
+	ibnd_node_t *ch_adapters;
+	ibnd_node_t *routers;
+} ibnd_fabric_t;
+
+/** =========================================================================
+ * Initialization (fabric operations)
+ */
+
+IBND_EXPORT ibnd_fabric_t *ibnd_discover_fabric(char * ca_name,
+					       int ca_port,
+					       ib_portid_t * from,
+					       struct ibnd_config *config);
+	/**
+	 * ca_name: (optional) name of the CA to use
+	 * ca_port: (optional) CA port to use
+	 * from: (optional) specify the node to start scanning from.
+	 *       If NULL start from the CA/CA port specified
+	 * config: (optional) additional config options for the scan
+	 */
+IBND_EXPORT void ibnd_destroy_fabric(ibnd_fabric_t * fabric);
+
+IBND_EXPORT ibnd_fabric_t *ibnd_load_fabric(const char *file,
+					   unsigned int flags);
+
+IBND_EXPORT int ibnd_cache_fabric(ibnd_fabric_t * fabric, const char *file,
+				 unsigned int flags);
+
+#define IBND_CACHE_FABRIC_FLAG_DEFAULT      0x0000
+#define IBND_CACHE_FABRIC_FLAG_NO_OVERWRITE 0x0001
+
+/** =========================================================================
+ * Node operations
+ */
+IBND_EXPORT ibnd_node_t *ibnd_find_node_guid(ibnd_fabric_t * fabric,
+					    uint64_t guid);
+IBND_EXPORT ibnd_node_t *ibnd_find_node_dr(ibnd_fabric_t * fabric, char *dr_str);
+
+typedef void (*ibnd_iter_node_func_t) (ibnd_node_t * node, void *user_data);
+IBND_EXPORT void ibnd_iter_nodes(ibnd_fabric_t * fabric,
+				ibnd_iter_node_func_t func, void *user_data);
+IBND_EXPORT void ibnd_iter_nodes_type(ibnd_fabric_t * fabric,
+				     ibnd_iter_node_func_t func,
+				     int node_type, void *user_data);
+
+/** =========================================================================
+ * Port operations
+ */
+IBND_EXPORT ibnd_port_t *ibnd_find_port_guid(ibnd_fabric_t * fabric,
+					uint64_t guid);
+IBND_EXPORT ibnd_port_t *ibnd_find_port_dr(ibnd_fabric_t * fabric,
+					char *dr_str);
+typedef void (*ibnd_iter_port_func_t) (ibnd_port_t * port, void *user_data);
+IBND_EXPORT void ibnd_iter_ports(ibnd_fabric_t * fabric,
+				ibnd_iter_port_func_t func, void *user_data);
+
+/** =========================================================================
+ * Chassis queries
+ */
+IBND_EXPORT uint64_t ibnd_get_chassis_guid(ibnd_fabric_t * fabric,
+					  unsigned char chassisnum);
+IBND_EXPORT char *ibnd_get_chassis_type(ibnd_node_t * node);
+IBND_EXPORT char *ibnd_get_chassis_slot_str(ibnd_node_t * node,
+					   char *str, size_t size);
+
+IBND_EXPORT int ibnd_is_xsigo_guid(uint64_t guid);
+IBND_EXPORT int ibnd_is_xsigo_tca(uint64_t guid);
+IBND_EXPORT int ibnd_is_xsigo_hca(uint64_t guid);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif				/* _IBNETDISC_H_ */
diff --git a/include/ibdiag_version.h b/libibnetdisc/include/infiniband/ibnetdisc_osd.h
similarity index 82%
copy from include/ibdiag_version.h
copy to libibnetdisc/include/infiniband/ibnetdisc_osd.h
index 72d14eb..44288d3 100644
--- a/include/ibdiag_version.h
+++ b/libibnetdisc/include/infiniband/ibnetdisc_osd.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Lawrence Livermore National Security.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -31,9 +31,20 @@
  *
  */
 
-#ifndef _IBDIAG_VERSION_H_
-#define _IBDIAG_VERSION_H_
+#ifndef _IBNETDISC_OSD_H_
+#define _IBNETDISC_OSD_H_
 
-#define IBDIAG_VERSION "1.4.4_20090314"
+#ifdef __cplusplus
+extern "C" {
+#endif
 
-#endif	/* _IBDIAG_VERSION_H_ */
+/* Define OS specific bits */
+
+/* Linux */
+#define IBND_EXPORT
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif				/* _IBNETDISC_OSD_H_ */
diff --git a/libibnetdisc/libibnetdisc.ver b/libibnetdisc/libibnetdisc.ver
new file mode 100644
index 0000000..c513f2a
--- /dev/null
+++ b/libibnetdisc/libibnetdisc.ver
@@ -0,0 +1,9 @@
+# In this file we track the current API version
+# of the IB net discover interface (and libraries)
+# The version is built of the following
+# tree numbers:
+# API_REV:RUNNING_REV:AGE
+# API_REV - advance on any added API
+# RUNNING_REV - advance any change to the vendor files
+# AGE - number of backward versions the API still supports
+LIBVERSION=7:0:2
diff --git a/libibnetdisc/man/ibnd_debug.3 b/libibnetdisc/man/ibnd_debug.3
new file mode 100644
index 0000000..a4076fc
--- /dev/null
+++ b/libibnetdisc/man/ibnd_debug.3
@@ -0,0 +1,2 @@
+.\".TH IBND_DEBUG 3  "Aug 04, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.so man3/ibnd_discover_fabric.3
diff --git a/libibnetdisc/man/ibnd_destroy_fabric.3 b/libibnetdisc/man/ibnd_destroy_fabric.3
new file mode 100644
index 0000000..8fe20ae
--- /dev/null
+++ b/libibnetdisc/man/ibnd_destroy_fabric.3
@@ -0,0 +1,2 @@
+.\".TH IBND_DESTROY_FABRIC 3  "Aug 04, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.so man3/ibnd_discover_fabric.3
diff --git a/libibnetdisc/man/ibnd_discover_fabric.3 b/libibnetdisc/man/ibnd_discover_fabric.3
new file mode 100644
index 0000000..5471af0
--- /dev/null
+++ b/libibnetdisc/man/ibnd_discover_fabric.3
@@ -0,0 +1,65 @@
+.TH IBND_DISCOVER_FABRIC 3  "July 25, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.SH "NAME"
+ibnd_discover_fabric, ibnd_destroy_fabric, ibnd_debug ibnd_show_progress \- initialize ibnetdiscover library.
+.SH "SYNOPSIS"
+.nf
+.B #include <infiniband/ibnetdisc.h>
+.sp
+.bi "ibnd_fabric_t *ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms, ib_portid_t *from, int hops)"
+.BI "void ibnd_destroy_fabric(ibnd_fabric_t *fabric)"
+.BI "void ibnd_debug(int i)"
+.BI "void ibnd_show_progress(int i)"
+.BI "int ibnd_set_max_smps_on_wire(int i)"
+.SH "DESCRIPTION"
+.B ibnd_discover_fabric()
+Discover the fabric connected to the port specified by ibmad_port, using a timeout specified.  The "from" and "hops" parameters are optional and allow one to scan part of a fabric by specifying a node "from" and a number of hops away from that node to scan, "hops".  This gives the user a "sub-fabric" which is "centered" anywhere they chose.
+
+ibmad_port must be opened with at least IB_SMI_CLASS and IB_SMI_DIRECT_CLASS
+classes for ibnd_discover_fabric to work.
+
+.B ibnd_destroy_fabric()
+free all memory and resources associated with the fabric.
+
+.B ibnd_debug()
+Set the debug level to be printed as library operations take place.
+
+.B ibnd_show_progress()
+Indicate that the library should print debug output which shows it's progress
+through the fabric.
+
+.B ibnd_set_max_smps_on_wire()
+Set the number of SMP\'s which will be issued on the wire simultaneously.
+
+.SH "RETURN VALUE"
+.B ibnd_discover_fabric()
+return NULL on failure, otherwise a valid ibnd_fabric_t object.
+
+.B ibnd_destory_fabric(), ibnd_debug()
+NONE
+
+.B ibnd_set_max_smps_on_wire()
+The previous value is returned
+
+.SH "EXAMPLES"
+
+.B Discover the entire fabric connected to device "mthca0", port 1.
+
+	int mgmt_classes[2] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS};
+	struct ibmad_port *ibmad_port = mad_rpc_open_port(ca, ca_port, mgmt_classes, 2);
+	ibnd_fabric_t *fabric = ibnd_discover_fabric(ibmad_port, 100, NULL, 0);
+	...
+	ibnd_destroy_fabric(fabric);
+	mad_rpc_close_port(ibmad_port);
+
+.B Discover only a single node and those nodes connected to it.
+
+	...
+	str2drpath(&(port_id.drpath), from, 0, 0);
+	...
+	ibnd_discover_fabric(ibmad_port, 100, &port_id, 1);
+	...
+.SH "SEE ALSO"
+	libibmad, mad_rpc_open_port
+.SH "AUTHORS"
+.TP
+Ira Weiny <weiny2 at llnl.gov>
diff --git a/libibnetdisc/man/ibnd_find_node_dr.3 b/libibnetdisc/man/ibnd_find_node_dr.3
new file mode 100644
index 0000000..612e501
--- /dev/null
+++ b/libibnetdisc/man/ibnd_find_node_dr.3
@@ -0,0 +1,2 @@
+.\".TH IBND_FIND_NODE_DR 3  "Aug 04, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.so man3/ibnd_find_node_guid.3
diff --git a/libibnetdisc/man/ibnd_find_node_guid.3 b/libibnetdisc/man/ibnd_find_node_guid.3
new file mode 100644
index 0000000..2d0cb63
--- /dev/null
+++ b/libibnetdisc/man/ibnd_find_node_guid.3
@@ -0,0 +1,21 @@
+.TH IBND_FIND_NODE_GUID 3  "July 25, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.SH "NAME"
+ibnd_find_node_guid, ibnd_find_node_dr \- given a fabric object find the node object within it which matches the guid or directed route specified.
+.SH "SYNOPSIS"
+.nf
+.B #include <infiniband/ibnetdisc.h>
+.sp
+.BI "ibnd_node_t *ibnd_find_node_guid(ibnd_fabric_t *fabric, uint64_t guid)"
+.BI "ibnd_node_t *ibnd_find_node_dr(ibnd_fabric_t *fabric, char *dr_str)"
+.SH "DESCRIPTION"
+.B ibnd_find_node_guid()
+Given a fabric object and a guid, return the ibnd_node_t object with that node guid.
+.B ibnd_find_node_dr()
+Given a fabric object and a directed route, return the ibnd_node_t object with
+that directed route.
+.SH "RETURN VALUE"
+.B ibnd_find_node_guid(), ibnd_find_node_dr()
+return NULL on failure, otherwise a valid ibnd_node_t object.
+.SH "AUTHORS"
+.TP
+Ira Weiny <weiny2 at llnl.gov>
diff --git a/libibnetdisc/man/ibnd_iter_nodes.3 b/libibnetdisc/man/ibnd_iter_nodes.3
new file mode 100644
index 0000000..469f07b
--- /dev/null
+++ b/libibnetdisc/man/ibnd_iter_nodes.3
@@ -0,0 +1,20 @@
+.TH IBND_ITER_NODES 3  "July 25, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.SH "NAME"
+ibnd_iter_nodes, ibnd_iter_nodes_type \- given a fabric object and a function itterate over the nodes in the fabric.
+.SH "SYNOPSIS"
+.nf
+.B #include <infiniband/ibnetdisc.h>
+.sp
+.BI "void ibnd_iter_nodes(ibnd_fabric_t *fabric, ibnd_iter_func_t func, void *user_data)"
+.BI "void ibnd_iter_nodes_type(ibnd_fabric_t *fabric, ibnd_iter_func_t func, ibnd_node_type_t type, void *user_data)"
+.SH "DESCRIPTION"
+.B ibnd_iter_nodes()
+Itterate through all the nodes in the fabric and call "func" on them.
+.B ibnd_iter_nodes_type()
+The same as ibnd_iter_nodes except to limit the iteration to the nodes with the specified type.
+.SH "RETURN VALUE"
+.B ibnd_iter_nodes(), ibnd_iter_nodes_type()
+NONE
+.SH "AUTHORS"
+.TP
+Ira Weiny <weiny2 at llnl.gov>
diff --git a/libibnetdisc/man/ibnd_iter_nodes_type.3 b/libibnetdisc/man/ibnd_iter_nodes_type.3
new file mode 100644
index 0000000..dc3ac8f
--- /dev/null
+++ b/libibnetdisc/man/ibnd_iter_nodes_type.3
@@ -0,0 +1,2 @@
+.\".TH IBND_FIND_NODES_TYPE 3  "Aug 04, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.so man3/ibnd_iter_nodes.3
diff --git a/libibnetdisc/man/ibnd_show_progress.3 b/libibnetdisc/man/ibnd_show_progress.3
new file mode 100644
index 0000000..280af31
--- /dev/null
+++ b/libibnetdisc/man/ibnd_show_progress.3
@@ -0,0 +1,2 @@
+.\".TH IBND_SHOW_PROGRESS 3  "Nov 26, 2008" "OpenIB" "OpenIB Programmer's Manual"
+.so man3/ibnd_discover_fabric.3
diff --git a/libibnetdisc/src/chassis.c b/libibnetdisc/src/chassis.c
new file mode 100644
index 0000000..5726f8e
--- /dev/null
+++ b/libibnetdisc/src/chassis.c
@@ -0,0 +1,1344 @@
+/*
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2010 HNR Consulting.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+/*========================================================*/
+/*               FABRIC SCANNER SPECIFIC DATA             */
+/*========================================================*/
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include <infiniband/mad.h>
+
+#include "internal.h"
+#include "chassis.h"
+
+static char *ChassisTypeStr[] =
+{ "", "ISR9288", "ISR9096", "ISR2012", "ISR2004", "ISR4700", "ISR4200" };
+static char *ChassisSlotTypeStr[] = { "", "Line", "Spine", "SRBD" };
+
+typedef struct chassis_scan {
+	ibnd_chassis_t *first_chassis;
+	ibnd_chassis_t *current_chassis;
+	ibnd_chassis_t *last_chassis;
+} chassis_scan_t;
+
+char *ibnd_get_chassis_type(ibnd_node_t * node)
+{
+	int chassis_type;
+
+	if (!node) {
+		IBND_DEBUG("node parameter NULL\n");
+		return NULL;
+	}
+
+	if (!node->chassis)
+		return NULL;
+
+	chassis_type = mad_get_field(node->info, 0, IB_NODE_VENDORID_F);
+
+	switch (chassis_type)
+	{
+		case VTR_VENDOR_ID: /* Voltaire chassis */
+		{
+			if (node->ch_type == UNRESOLVED_CT || node->ch_type > ISR4200_CT)
+				return NULL;
+			return ChassisTypeStr[node->ch_type];
+		}
+		case MLX_VENDOR_ID:
+		{
+			if (node->ch_type_str[0] == '\0')
+				return NULL;
+			return node->ch_type_str;
+		}
+		default:
+		{
+			break;
+		}
+	}
+	return NULL;
+}
+
+char *ibnd_get_chassis_slot_str(ibnd_node_t * node, char *str, size_t size)
+{
+	int vendor_id;
+
+	if (!node) {
+		IBND_DEBUG("node parameter NULL\n");
+		return NULL;
+	}
+
+	/* Currently, only if Voltaire or Mellanox chassis */
+	vendor_id = mad_get_field(node->info, 0,IB_NODE_VENDORID_F);
+
+	if ((vendor_id != VTR_VENDOR_ID) && (vendor_id != MLX_VENDOR_ID))
+		return NULL;
+	if (!node->chassis)
+		return NULL;
+	if (node->ch_slot == UNRESOLVED_CS || node->ch_slot > SRBD_CS)
+		return NULL;
+	if (!str)
+		return NULL;
+	snprintf(str, size, "%s %d Chip %d", ChassisSlotTypeStr[node->ch_slot],
+		 node->ch_slotnum, node->ch_anafanum);
+	return str;
+}
+
+static ibnd_chassis_t *find_chassisnum(ibnd_fabric_t * fabric,
+				       unsigned char chassisnum)
+{
+	ibnd_chassis_t *current;
+
+	for (current = fabric->chassis; current; current = current->next)
+		if (current->chassisnum == chassisnum)
+			return current;
+
+	return NULL;
+}
+
+static uint64_t topspin_chassisguid(uint64_t guid)
+{
+	/* Byte 3 in system image GUID is chassis type, and */
+	/* Byte 4 is location ID (slot) so just mask off byte 4 */
+	return guid & 0xffffffff00ffffffULL;
+}
+
+int ibnd_is_xsigo_guid(uint64_t guid)
+{
+	if ((guid & 0xffffff0000000000ULL) == 0x0013970000000000ULL)
+		return 1;
+	else
+		return 0;
+}
+
+static int is_xsigo_leafone(uint64_t guid)
+{
+	if ((guid & 0xffffffffff000000ULL) == 0x0013970102000000ULL)
+		return 1;
+	else
+		return 0;
+}
+
+int ibnd_is_xsigo_hca(uint64_t guid)
+{
+	/* NodeType 2 is HCA */
+	if ((guid & 0xffffffff00000000ULL) == 0x0013970200000000ULL)
+		return 1;
+	else
+		return 0;
+}
+
+int ibnd_is_xsigo_tca(uint64_t guid)
+{
+	/* NodeType 3 is TCA */
+	if ((guid & 0xffffffff00000000ULL) == 0x0013970300000000ULL)
+		return 1;
+	else
+		return 0;
+}
+
+static int is_xsigo_ca(uint64_t guid)
+{
+	if (ibnd_is_xsigo_hca(guid) || ibnd_is_xsigo_tca(guid))
+		return 1;
+	else
+		return 0;
+}
+
+static int is_xsigo_switch(uint64_t guid)
+{
+	if ((guid & 0xffffffff00000000ULL) == 0x0013970100000000ULL)
+		return 1;
+	else
+		return 0;
+}
+
+static uint64_t xsigo_chassisguid(ibnd_node_t * node)
+{
+	uint64_t sysimgguid =
+	    mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F);
+	uint64_t remote_sysimgguid;
+
+	if (!is_xsigo_ca(sysimgguid)) {
+		/* Byte 3 is NodeType and byte 4 is PortType */
+		/* If NodeType is 1 (switch), PortType is masked */
+		if (is_xsigo_switch(sysimgguid))
+			return sysimgguid & 0xffffffff00ffffffULL;
+		else
+			return sysimgguid;
+	} else {
+		if (!node->ports || !node->ports[1])
+			return 0;
+
+		/* Is there a peer port ? */
+		if (!node->ports[1]->remoteport)
+			return sysimgguid;
+
+		/* If peer port is Leaf 1, use its chassis GUID */
+		remote_sysimgguid =
+		    mad_get_field64(node->ports[1]->remoteport->node->info, 0,
+				    IB_NODE_SYSTEM_GUID_F);
+		if (is_xsigo_leafone(remote_sysimgguid))
+			return remote_sysimgguid & 0xffffffff00ffffffULL;
+		else
+			return sysimgguid;
+	}
+}
+
+static uint64_t get_chassisguid(ibnd_node_t * node)
+{
+	uint32_t vendid = mad_get_field(node->info, 0, IB_NODE_VENDORID_F);
+	uint64_t sysimgguid =
+	    mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F);
+
+	if (vendid == TS_VENDOR_ID || vendid == SS_VENDOR_ID)
+		return topspin_chassisguid(sysimgguid);
+	else if (vendid == XS_VENDOR_ID || ibnd_is_xsigo_guid(sysimgguid))
+		return xsigo_chassisguid(node);
+	else
+		return sysimgguid;
+}
+
+static ibnd_chassis_t *find_chassisguid(ibnd_fabric_t * fabric,
+					ibnd_node_t * node)
+{
+	ibnd_chassis_t *current;
+	uint64_t chguid;
+
+	chguid = get_chassisguid(node);
+	for (current = fabric->chassis; current; current = current->next)
+		if (current->chassisguid == chguid)
+			return current;
+
+	return NULL;
+}
+
+uint64_t ibnd_get_chassis_guid(ibnd_fabric_t * fabric, unsigned char chassisnum)
+{
+	ibnd_chassis_t *chassis;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return 0;
+	}
+
+	chassis = find_chassisnum(fabric, chassisnum);
+	if (chassis)
+		return chassis->chassisguid;
+	else
+		return 0;
+}
+
+static int is_router(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_IB_FC_ROUTER ||
+		devid == VTR_DEVID_IB_IP_ROUTER);
+}
+
+static int is_spine_9096(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB4 || devid == VTR_DEVID_SFB4_DDR);
+}
+
+static int is_spine_9288(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB12 || devid == VTR_DEVID_SFB12_DDR);
+}
+
+static int is_spine_2004(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB2004);
+}
+
+static int is_spine_2012(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB2012);
+}
+
+static int is_spine_4700(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB4700);
+}
+
+static int is_spine_4700x2(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB4700X2);
+}
+
+static int is_spine_4200(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB4200);
+}
+
+static int is_spine(ibnd_node_t * n)
+{
+	return (is_spine_9096(n) || is_spine_9288(n) ||
+		is_spine_2004(n) || is_spine_2012(n) ||
+		is_spine_4700(n) || is_spine_4700x2(n) ||
+		is_spine_4200(n));
+}
+
+static int is_line_24(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SLB24 ||
+		devid == VTR_DEVID_SLB24_DDR || devid == VTR_DEVID_SRB2004);
+}
+
+static int is_line_8(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SLB8);
+}
+
+static int is_line_2024(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SLB2024);
+}
+
+static int is_line_4700(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SLB4018);
+}
+
+static int is_line(ibnd_node_t * n)
+{
+	return (is_line_24(n) || is_line_8(n) ||
+		is_line_2024(n) || is_line_4700(n));
+}
+
+int is_chassis_switch(ibnd_node_t * n)
+{
+	return (is_spine(n) || is_line(n));
+}
+
+/* these structs help find Line (Anafa) slot number while using spine portnum */
+char line_slot_2_sfb4[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
+	4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_line_slot_2_sfb4[37] = {
+	0,
+	1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2,
+	1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+char line_slot_2_sfb12[37] = {
+	0,
+	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
+	10, 10, 11, 11, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_line_slot_2_sfb12[37] = {
+	0,
+	1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
+	1, 2, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* LB slot = table[spine port] */
+char line_slot_2_sfb18[37] = {
+	0,
+	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
+	10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18};
+/* LB asic num = table[spine port] */
+char anafa_line_slot_2_sfb18[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+};
+
+/* LB slot = table[spine port] */
+char line_slot_2_sfb18x2[37] = {
+	0,
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
+	0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0};
+/* LB asic num = table[spine port] */
+char anafa_line_slot_2_sfb18x2[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* LB slot = table[spine port] */
+char line_slot_2_sfb4200[37] = {
+	0,
+	1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5,
+	5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9};
+/* LB asic num = table[spine port] */
+char anafa_line_slot_2_sfb4200[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+};
+
+/* IPR FCR modules connectivity while using sFB4 port as reference */
+char ipr_slot_2_sfb4_port[37] = {
+	0,
+	3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1,
+	3, 2, 1, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* these structs help find Spine (Anafa) slot number while using spine portnum */
+char spine12_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_spine12_slot_2_slb[37] = {
+	0,
+	1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+char spine4_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_spine4_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* FB slot = table[line port] */
+char spine18_slot_2_slb[37] = {
+	0,
+	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+/* FB asic = table[line port] */
+char anafa_spine18_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_spine18x2_slot_2_slb[37] = {
+	0,
+	2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* FB slot = table[line port] */
+char sfb4200_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 1, 0, 0, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+/* FB asic = table[line port] */
+char anafa_sfb4200_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*	reference                     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */
+
+static int get_sfb_slot(ibnd_node_t * n, ibnd_port_t * lineport)
+{
+	n->ch_slot = SPINE_CS;
+	if (is_spine_9096(n)) {
+		n->ch_type = ISR9096_CT;
+		n->ch_slotnum = spine4_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine4_slot_2_slb[lineport->portnum];
+	} else if (is_spine_9288(n)) {
+		n->ch_type = ISR9288_CT;
+		n->ch_slotnum = spine12_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine12_slot_2_slb[lineport->portnum];
+	} else if (is_spine_2012(n)) {
+		n->ch_type = ISR2012_CT;
+		n->ch_slotnum = spine12_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine12_slot_2_slb[lineport->portnum];
+	} else if (is_spine_2004(n)) {
+		n->ch_type = ISR2004_CT;
+		n->ch_slotnum = spine4_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine4_slot_2_slb[lineport->portnum];
+	} else if (is_spine_4700(n)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = spine18_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine18_slot_2_slb[lineport->portnum];
+	} else if (is_spine_4700x2(n)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = spine18_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine18x2_slot_2_slb[lineport->portnum];
+	} else if (is_spine_4200(n)) {
+		n->ch_type = ISR4200_CT;
+		n->ch_slotnum = sfb4200_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_sfb4200_slot_2_slb[lineport->portnum];
+	} else {
+		IBND_ERROR("Unexpected node found: guid 0x%016" PRIx64 "\n",
+			   n->guid);
+	}
+	return 0;
+}
+
+static int get_router_slot(ibnd_node_t * n, ibnd_port_t * spineport)
+{
+	uint64_t guessnum = 0;
+
+	n->ch_found = 1;
+
+	n->ch_slot = SRBD_CS;
+	if (is_spine_9096(spineport->node)) {
+		n->ch_type = ISR9096_CT;
+		n->ch_slotnum = line_slot_2_sfb4[spineport->portnum];
+		n->ch_anafanum = ipr_slot_2_sfb4_port[spineport->portnum];
+	} else if (is_spine_9288(spineport->node)) {
+		n->ch_type = ISR9288_CT;
+		n->ch_slotnum = line_slot_2_sfb12[spineport->portnum];
+		/* this is a smart guess based on nodeguids order on sFB-12 module */
+		guessnum = spineport->node->guid % 4;
+		/* module 1 <--> remote anafa 3 */
+		/* module 2 <--> remote anafa 2 */
+		/* module 3 <--> remote anafa 1 */
+		n->ch_anafanum = (guessnum == 3 ? 1 : (guessnum == 1 ? 3 : 2));
+	} else if (is_spine_2012(spineport->node)) {
+		n->ch_type = ISR2012_CT;
+		n->ch_slotnum = line_slot_2_sfb12[spineport->portnum];
+		/* this is a smart guess based on nodeguids order on sFB-12 module */
+		guessnum = spineport->node->guid % 4;
+		// module 1 <--> remote anafa 3
+		// module 2 <--> remote anafa 2
+		// module 3 <--> remote anafa 1
+		n->ch_anafanum = (guessnum == 3 ? 1 : (guessnum == 1 ? 3 : 2));
+	} else if (is_spine_2004(spineport->node)) {
+		n->ch_type = ISR2004_CT;
+		n->ch_slotnum = line_slot_2_sfb4[spineport->portnum];
+		n->ch_anafanum = ipr_slot_2_sfb4_port[spineport->portnum];
+	} else {
+		IBND_ERROR("Unexpected node found: guid 0x%016" PRIx64 "\n",
+			   spineport->node->guid);
+	}
+	return 0;
+}
+
+static int get_slb_slot(ibnd_node_t * n, ibnd_port_t * spineport)
+{
+	n->ch_slot = LINE_CS;
+	if (is_spine_9096(spineport->node)) {
+		n->ch_type = ISR9096_CT;
+		n->ch_slotnum = line_slot_2_sfb4[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb4[spineport->portnum];
+	} else if (is_spine_9288(spineport->node)) {
+		n->ch_type = ISR9288_CT;
+		n->ch_slotnum = line_slot_2_sfb12[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb12[spineport->portnum];
+	} else if (is_spine_2012(spineport->node)) {
+		n->ch_type = ISR2012_CT;
+		n->ch_slotnum = line_slot_2_sfb12[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb12[spineport->portnum];
+	} else if (is_spine_2004(spineport->node)) {
+		n->ch_type = ISR2004_CT;
+		n->ch_slotnum = line_slot_2_sfb4[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb4[spineport->portnum];
+	} else if (is_spine_4700(spineport->node)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = line_slot_2_sfb18[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb18[spineport->portnum];
+	} else if (is_spine_4700x2(spineport->node)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = line_slot_2_sfb18x2[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb18x2[spineport->portnum];
+	} else if (is_spine_4200(spineport->node)) {
+		n->ch_type = ISR4200_CT;
+		n->ch_slotnum = line_slot_2_sfb4200[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb4200[spineport->portnum];
+	} else {
+		IBND_ERROR("Unexpected node found: guid 0x%016" PRIx64 "\n",
+			   spineport->node->guid);
+	}
+	return 0;
+}
+
+
+/*
+	This function called for every Mellanox node in fabric
+*/
+static int fill_mellanox_chassis_record(ibnd_node_t * node)
+{
+	int p = 0;
+	ibnd_port_t *port;
+
+	char node_desc[IB_SMP_DATA_SIZE];
+	char *system_name;
+	char *system_type;
+	char *system_slot_name;
+	char *node_index;
+	char *iter;
+	int dev_id;
+
+	/*
+	The node description has the following format:
+
+	'MF0;<system name>:<system type>/<system slot name>[:board type]/U<node index>'
+
+     - System slot name in our systems can be L[01-36] , S[01-18]
+     - Node index is always 1 (we don.t have boards with multiple IS4 chips).
+     - System name is taken from the currently configured host name.
+     -The board type is optional and we don.t set it currently  - A leaf or spine slot can currently hold a single type of board.
+	 */
+
+	memcpy(node_desc, node->nodedesc, IB_SMP_DATA_SIZE);
+
+	IBND_DEBUG("fill_mellanox_chassis_record: node_desc:%s \n",node_desc);
+
+	if (node->ch_found)	/* somehow this node has already been passed */
+		return 0;
+
+	/* All mellanox IS4 switches have the same vendor id*/
+	dev_id = mad_get_field(node->info, 0,IB_NODE_DEVID_F);
+	if (dev_id != MLX_DEVID_IS4)
+		return 0;
+
+	if((node_desc[0] != 'M') ||
+	   (node_desc[1] != 'F') ||
+	   (node_desc[2] != '0') ||
+	   (node_desc[3] != ';')) {
+		IBND_DEBUG("fill_mellanox_chassis_record: Unsupported node description format:%s \n",node_desc);
+		return 0;
+	}
+
+	/* parse system name*/
+	system_name = &node_desc[4];
+	for (iter = system_name ; (*iter != ':') && (*iter != '\0') ; iter++);
+	if(*iter == '\0'){
+		IBND_DEBUG("fill_mellanox_chassis_record: Unsupported node description format:%s - (get system_name failed) \n",node_desc);
+		return 0;
+	}
+	*iter = '\0';
+	iter++;
+	/* parse system type*/
+	system_type = iter;
+	for ( ; (*iter != '/') && (*iter != '\0') ; iter++);
+	if(*iter == '\0'){
+		IBND_DEBUG("fill_mellanox_chassis_record: Unsupported node description format:%s - (get system_type failed) \n",node_desc);
+		return 0;
+	}
+	*iter = '\0';
+	iter++;
+	/* parse system slot name*/
+	system_slot_name = iter;
+	for ( ; (*iter != '/') && (*iter != ':') && (*iter != '\0') ; iter++);
+	if(*iter == '\0'){
+		IBND_DEBUG("fill_mellanox_chassis_record: Unsupported node description format:%s - (get system_slot_name failed) \n",node_desc);
+		return 0;
+	}
+	if(*iter == ':'){
+		*iter = '\0';
+		iter++;
+		for ( ; (*iter != '/') && (*iter != '\0') ; iter++);
+		if(*iter == '\0'){
+			IBND_DEBUG("fill_mellanox_chassis_record: Unsupported node description format:%s - (get board type failed) \n",node_desc);
+			return 0;
+		}
+	}
+	*iter = '\0';
+	iter++;
+	node_index = iter;
+	if(node_index[0] != 'U'){
+		IBND_DEBUG("fill_mellanox_chassis_record: Unsupported node description format:%s - (get node index) \n",node_desc);
+		return 0;
+	}
+
+	/* set Chip number (node index) */
+	node->ch_anafanum = (unsigned char) atoi(&node_index[1]);
+	if(node->ch_anafanum != 1){
+		IBND_DEBUG("Unexpected Chip number:%d \n",node->ch_anafanum);
+	}
+
+
+	/* set Line Spine numbers */
+	if(system_slot_name[0] == 'L')
+		node->ch_slot = LINE_CS;
+	else if(system_slot_name[0] == 'S')
+		node->ch_slot = SPINE_CS;
+	else{
+		IBND_DEBUG("fill_mellanox_chassis_record: Unsupported system_slot_name:%s \n",system_slot_name);
+		return 0;
+	}
+
+	/* The switch will be displayed under Line or Spine and not under Chassis switches */
+	node->ch_found = 1;
+
+	node->ch_slotnum = (unsigned char) atoi(&system_slot_name[1]);
+	if((node->ch_slot == LINE_CS && (node->ch_slotnum >  (LINES_MAX_NUM + 1))) ||
+	   (node->ch_slot == SPINE_CS && (node->ch_slotnum > (SPINES_MAX_NUM + 1)))){
+		IBND_ERROR("fill_mellanox_chassis_record: invalid slot number:%d \n",node->ch_slotnum);
+		node->ch_slotnum = 0;
+		return 0;
+	}
+
+	/*set ch_type_str*/
+	strncpy(node->ch_type_str , system_type, sizeof(node->ch_type_str)-1);
+
+	/* Line ports 1-18 are mapped to external ports 1-18*/
+	if(node->ch_slot == LINE_CS)
+	{
+		for (p = 1; p <= node->numports && p <= 18 ; p++) {
+			port = node->ports[p];
+			if (!port)
+				continue;
+			port->ext_portnum = p;
+		}
+	}
+
+	return 0;
+}
+
+static int insert_mellanox_line_and_spine(ibnd_node_t * node, ibnd_chassis_t * chassis)
+{
+	if (node->ch_slot == LINE_CS){
+
+		if (chassis->linenode[node->ch_slotnum])
+			return 0;	/* already filled slot */
+
+		chassis->linenode[node->ch_slotnum] = node;
+	}
+	else if (node->ch_slot == SPINE_CS){
+
+		if (chassis->spinenode[node->ch_slotnum])
+			return 0;	/* already filled slot */
+
+		chassis->spinenode[node->ch_slotnum] = node;
+	}
+	else
+		return 0;
+
+	node->chassis = chassis;
+
+	return 0;
+}
+
+
+/* forward declare this */
+static void voltaire_portmap(ibnd_port_t * port);
+/*
+	This function called for every Voltaire node in fabric
+	It could be optimized so, but time overhead is very small
+	and its only diag.util
+*/
+static int fill_voltaire_chassis_record(ibnd_node_t * node)
+{
+	int p = 0;
+	ibnd_port_t *port;
+	ibnd_node_t *remnode = 0;
+
+	if (node->ch_found)	/* somehow this node has already been passed */
+		return 0;
+	node->ch_found = 1;
+
+	/* node is router only in case of using unique lid */
+	/* (which is lid of chassis router port) */
+	/* in such case node->ports is actually a requested port... */
+	if (is_router(node))
+		/* find the remote node */
+		for (p = 1; p <= node->numports; p++) {
+			port = node->ports[p];
+			if (port && is_spine(port->remoteport->node))
+				get_router_slot(node, port->remoteport);
+		}
+	else if (is_spine(node)) {
+		int is_4700x2 = is_spine_4700x2(node);
+
+		for (p = 1; p <= node->numports; p++) {
+			port = node->ports[p];
+			if (!port || !port->remoteport)
+				continue;
+
+			/*
+			 * Skip ISR4700 double density fabric boards ports 19-36
+			 * as they are chassis external ports
+			 */
+			if (is_4700x2 && (port->portnum > 18))
+				continue;
+
+			remnode = port->remoteport->node;
+			if (remnode->type != IB_NODE_SWITCH) {
+				if (!remnode->ch_found)
+					get_router_slot(remnode, port);
+				continue;
+			}
+			if (!node->ch_type)
+				/* we assume here that remoteport belongs to line */
+				get_sfb_slot(node, port->remoteport);
+
+			/* we could break here, but need to find if more routers connected */
+		}
+
+	} else if (is_line(node)) {
+		int is_4700_line = is_line_4700(node);
+
+		for (p = 1; p <= node->numports; p++) {
+			port = node->ports[p];
+			if (!port || !port->remoteport)
+				continue;
+
+			if ((is_4700_line && (port->portnum > 18)) ||
+			    (!is_4700_line && (port->portnum > 12)))
+				continue;
+
+			/* we assume here that remoteport belongs to spine */
+			get_slb_slot(node, port->remoteport);
+			break;
+		}
+	}
+
+	/* for each port of this node, map external ports */
+	for (p = 1; p <= node->numports; p++) {
+		port = node->ports[p];
+		if (!port)
+			continue;
+		voltaire_portmap(port);
+	}
+
+	return 0;
+}
+
+static int get_line_index(ibnd_node_t * node)
+{
+	int retval;
+
+	if (is_line_4700(node))
+		retval = node->ch_slotnum;
+	else
+		retval = 3 * (node->ch_slotnum - 1) + node->ch_anafanum;
+
+	if (retval > LINES_MAX_NUM || retval < 1) {
+		printf("%s: retval = %d\n", __FUNCTION__, retval);
+		IBND_ERROR("Internal error\n");
+		return -1;
+	}
+	return retval;
+}
+
+static int get_spine_index(ibnd_node_t * node)
+{
+	int retval;
+
+	if (is_spine_9288(node) || is_spine_2012(node))
+		retval = 3 * (node->ch_slotnum - 1) + node->ch_anafanum;
+	else if (is_spine_4700(node) || is_spine_4700x2(node))
+		retval = 2 * (node->ch_slotnum - 1) + node->ch_anafanum;
+	else
+		retval = node->ch_slotnum;
+
+	if (retval > SPINES_MAX_NUM || retval < 1) {
+		IBND_ERROR("Internal error\n");
+		return -1;
+	}
+	return retval;
+}
+
+static int insert_line_router(ibnd_node_t * node, ibnd_chassis_t * chassis)
+{
+	int i = get_line_index(node);
+
+	if (i < 0)
+		return i;
+
+	if (chassis->linenode[i])
+		return 0;	/* already filled slot */
+
+	chassis->linenode[i] = node;
+	node->chassis = chassis;
+	return 0;
+}
+
+static int insert_spine(ibnd_node_t * node, ibnd_chassis_t * chassis)
+{
+	int i = get_spine_index(node);
+
+	if (i < 0)
+		return i;
+
+	if (chassis->spinenode[i])
+		return 0;	/* already filled slot */
+
+	chassis->spinenode[i] = node;
+	node->chassis = chassis;
+	return 0;
+}
+
+static int pass_on_lines_catch_spines(ibnd_chassis_t * chassis)
+{
+	ibnd_node_t *node, *remnode;
+	ibnd_port_t *port;
+	int i, p;
+
+	for (i = 1; i <= LINES_MAX_NUM; i++) {
+		int is_4700_line;
+
+		node = chassis->linenode[i];
+
+		if (!(node && is_line(node)))
+			continue;	/* empty slot or router */
+
+		is_4700_line = is_line_4700(node);
+
+		for (p = 1; p <= node->numports; p++) {
+
+			port = node->ports[p];
+			if (!port || !port->remoteport)
+				continue;
+
+			if ((is_4700_line && (port->portnum > 18)) ||
+			    (!is_4700_line && (port->portnum > 12)))
+				continue;
+
+			remnode = port->remoteport->node;
+
+			if (!remnode->ch_found)
+				continue;	/* some error - spine not initialized ? FIXME */
+			if (insert_spine(remnode, chassis))
+				return -1;
+		}
+	}
+	return 0;
+}
+
+static int pass_on_spines_catch_lines(ibnd_chassis_t * chassis)
+{
+	ibnd_node_t *node, *remnode;
+	ibnd_port_t *port;
+	int i, p;
+
+	for (i = 1; i <= SPINES_MAX_NUM; i++) {
+		int is_4700x2;
+
+		node = chassis->spinenode[i];
+		if (!node)
+			continue;	/* empty slot */
+
+		is_4700x2 = is_spine_4700x2(node);
+
+		for (p = 1; p <= node->numports; p++) {
+			port = node->ports[p];
+			if (!port || !port->remoteport)
+				continue;
+
+			/*
+			 * ISR4700 double density fabric board ports 19-36 are
+			 * chassis external ports, so skip them
+			 */
+			if (is_4700x2 && (port->portnum > 18))
+				continue;
+
+			remnode = port->remoteport->node;
+
+			if (!remnode->ch_found)
+				continue;	/* some error - line/router not initialized ? FIXME */
+
+			if (insert_line_router(remnode, chassis))
+				return -1;
+		}
+	}
+	return 0;
+}
+
+/*
+	Stupid interpolation algorithm...
+	But nothing to do - have to be compliant with VoltaireSM/NMS
+*/
+static void pass_on_spines_interpolate_chguid(ibnd_chassis_t * chassis)
+{
+	ibnd_node_t *node;
+	int i;
+
+	for (i = 1; i <= SPINES_MAX_NUM; i++) {
+		node = chassis->spinenode[i];
+		if (!node)
+			continue;	/* skip the empty slots */
+
+		/* take first guid minus one to be consistent with SM */
+		chassis->chassisguid = node->guid - 1;
+		break;
+	}
+}
+
+/*
+	This function fills chassis structure with all nodes
+	in that chassis
+	chassis structure = structure of one standalone chassis
+*/
+static int build_chassis(ibnd_node_t * node, ibnd_chassis_t * chassis)
+{
+	int p = 0;
+	ibnd_node_t *remnode = 0;
+	ibnd_port_t *port = 0;
+
+	/* we get here with node = chassis_spine */
+	if (insert_spine(node, chassis))
+		return -1;
+
+	/* loop: pass on all ports of node */
+	for (p = 1; p <= node->numports; p++) {
+
+		port = node->ports[p];
+		if (!port || !port->remoteport)
+			continue;
+
+		/*
+		 * ISR4700 double density fabric board ports 19-36 are
+		 * chassis external ports, so skip them
+		 */
+		if (is_spine_4700x2(node) && (port->portnum > 18))
+			continue;
+
+		remnode = port->remoteport->node;
+
+		if (!remnode->ch_found)
+			continue;	/* some error - line or router not initialized ? FIXME */
+
+		insert_line_router(remnode, chassis);
+	}
+
+	if (pass_on_lines_catch_spines(chassis))
+		return -1;
+	/* this pass needed for to catch routers, since routers connected only */
+	/* to spines in slot 1 or 4 and we could miss them first time */
+	if (pass_on_spines_catch_lines(chassis))
+		return -1;
+
+	/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
+	/* connectivity - extra pass to ensure that all related chips/modules */
+	/* inserted into the chassis */
+	if (pass_on_lines_catch_spines(chassis))
+		return -1;
+	if (pass_on_spines_catch_lines(chassis))
+		return -1;
+	pass_on_spines_interpolate_chguid(chassis);
+
+	return 0;
+}
+
+/*========================================================*/
+/*                INTERNAL TO EXTERNAL PORT MAPPING       */
+/*========================================================*/
+
+/*
+Description : On ISR9288/9096 external ports indexing
+              is not matching the internal ( anafa ) port
+              indexes. Use this MAP to translate the data you get from
+              the OpenIB diagnostics (smpquery, ibroute, ibtracert, etc.)
+
+Module : sLB-24
+                anafa 1             anafa 2
+ext port | 13 14 15 16 17 18 | 19 20 21 22 23 24
+int port | 22 23 24 18 17 16 | 22 23 24 18 17 16
+ext port | 1  2  3  4  5  6  | 7  8  9  10 11 12
+int port | 19 20 21 15 14 13 | 19 20 21 15 14 13
+------------------------------------------------
+
+Module : sLB-8
+                anafa 1             anafa 2
+ext port | 13 14 15 16 17 18 | 19 20 21 22 23 24
+int port | 24 23 22 18 17 16 | 24 23 22 18 17 16
+ext port | 1  2  3  4  5  6  | 7  8  9  10 11 12
+int port | 21 20 19 15 14 13 | 21 20 19 15 14 13
+
+----------->
+                anafa 1             anafa 2
+ext port | -  -  5  -  -  6  | -  -  7  -  -  8
+int port | 24 23 22 18 17 16 | 24 23 22 18 17 16
+ext port | -  -  1  -  -  2  | -  -  3  -  -  4
+int port | 21 20 19 15 14 13 | 21 20 19 15 14 13
+------------------------------------------------
+
+Module : sLB-2024
+
+ext port | 13 14 15 16 17 18 19 20 21 22 23 24
+A1 int port| 13 14 15 16 17 18 19 20 21 22 23 24
+ext port | 1 2 3 4 5 6 7 8 9 10 11 12
+A2 int port| 13 14 15 16 17 18 19 20 21 22 23 24
+---------------------------------------------------
+
+Module : sLB-4018
+
+int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+ext port |  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18
+---------------------------------------------------
+
+Module : sFB-4700X2
+
+  12X port -> 3 x 4X ports:
+
+A1 int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+   ext port |  7  7  7  8  8  8  9  9  9 10 10 10 11 11 11 12 12 12
+A2 int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+   ext port |  1  1  1  2  2  2  3  3  3  4  4  4  5  5  5  6  6  6
+
+*/
+
+int int2ext_map_slb24[2][25] = {
+	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 4, 18, 17, 16, 1, 2, 3,
+	 13, 14, 15},
+	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, 10, 24, 23, 22, 7, 8, 9,
+	 19, 20, 21}
+};
+
+int int2ext_map_slb8[2][25] = {
+	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 6, 6, 6, 1, 1, 1, 5, 5,
+	 5},
+	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 8, 8, 8, 3, 3, 3, 7, 7,
+	 7}
+};
+
+int int2ext_map_slb2024[2][25] = {
+	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20,
+	 21, 22, 23, 24},
+	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+	 11, 12}
+};
+
+int int2ext_map_slb4018[37] = {
+	0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
+};
+
+int int2ext_map_sfb4700x2[2][37] = {
+	{0,
+	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12},
+	{0,
+	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6}
+};
+
+/*	reference			{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */
+
+/* map internal ports to external ports if appropriate */
+static void voltaire_portmap(ibnd_port_t * port)
+{
+	int portnum = port->portnum;
+	int chipnum = 0;
+	ibnd_node_t *node = port->node;
+	int is_4700_line = is_line_4700(node);
+	int is_4700x2_spine = is_spine_4700x2(node);
+
+	if (!node->ch_found || (!is_line(node) && !is_4700x2_spine)) {
+		port->ext_portnum = 0;
+		return;
+	}
+
+	if (((is_4700_line || is_4700x2_spine) &&
+	     (portnum < 19 || portnum > 36)) ||
+	    ((!is_4700_line && !is_4700x2_spine) &&
+	     (portnum < 13 || portnum > 24))) {
+			port->ext_portnum = 0;
+		return;
+	}
+
+	if (port->node->ch_anafanum < 1 || port->node->ch_anafanum > 2) {
+		port->ext_portnum = 0;
+		return;
+	}
+
+	chipnum = port->node->ch_anafanum - 1;
+
+	if (is_line_24(node))
+		port->ext_portnum = int2ext_map_slb24[chipnum][portnum];
+	else if (is_line_2024(node))
+		port->ext_portnum = int2ext_map_slb2024[chipnum][portnum];
+	/* sLB-4018: Only one asic per LB */
+	else if (is_4700_line)
+		port->ext_portnum = int2ext_map_slb4018[portnum];
+	/* sFB-4700X2 4X port */
+	else if (is_4700x2_spine)
+		port->ext_portnum = int2ext_map_sfb4700x2[chipnum][portnum];
+	else
+		port->ext_portnum = int2ext_map_slb8[chipnum][portnum];
+}
+
+static int add_chassis(chassis_scan_t * chassis_scan)
+{
+	if (!(chassis_scan->current_chassis =
+	      calloc(1, sizeof(ibnd_chassis_t)))) {
+		IBND_ERROR("OOM: failed to allocate chassis object\n");
+		return -1;
+	}
+
+	if (chassis_scan->first_chassis == NULL) {
+		chassis_scan->first_chassis = chassis_scan->current_chassis;
+		chassis_scan->last_chassis = chassis_scan->current_chassis;
+	} else {
+		chassis_scan->last_chassis->next =
+		    chassis_scan->current_chassis;
+		chassis_scan->last_chassis = chassis_scan->current_chassis;
+	}
+	return 0;
+}
+
+static void add_node_to_chassis(ibnd_chassis_t * chassis, ibnd_node_t * node)
+{
+	node->chassis = chassis;
+	node->next_chassis_node = chassis->nodes;
+	chassis->nodes = node;
+}
+
+/*
+	Main grouping function
+	Algorithm:
+	1. pass on every Voltaire node
+	2. catch spine chip for every Voltaire node
+		2.1 build/interpolate chassis around this chip
+		2.2 go to 1.
+	3. pass on non Voltaire nodes (SystemImageGUID based grouping)
+	4. now group non Voltaire nodes by SystemImageGUID
+	Returns:
+	0 on success, -1 on failure
+*/
+int group_nodes(ibnd_fabric_t * fabric)
+{
+	ibnd_node_t *node;
+	int chassisnum = 0;
+	ibnd_chassis_t *chassis;
+	ibnd_chassis_t *ch, *ch_next;
+	chassis_scan_t chassis_scan;
+	int vendor_id;
+
+	chassis_scan.first_chassis = NULL;
+	chassis_scan.current_chassis = NULL;
+	chassis_scan.last_chassis = NULL;
+
+	/* first pass on switches and build for every Voltaire node */
+	/* an appropriate chassis record (slotnum and position) */
+	/* according to internal connectivity */
+	/* not very efficient but clear code so... */
+	for (node = fabric->switches; node; node = node->type_next) {
+
+		vendor_id = mad_get_field(node->info, 0,IB_NODE_VENDORID_F);
+
+		if (vendor_id == VTR_VENDOR_ID
+		    && fill_voltaire_chassis_record(node))
+			goto cleanup;
+		else if (vendor_id == MLX_VENDOR_ID
+			&& fill_mellanox_chassis_record(node))
+			goto cleanup;
+
+	}
+
+	/* separate every Voltaire chassis from each other and build linked list of them */
+	/* algorithm: catch spine and find all surrounding nodes */
+	for (node = fabric->switches; node; node = node->type_next) {
+		if (mad_get_field(node->info, 0,
+				  IB_NODE_VENDORID_F) != VTR_VENDOR_ID)
+			continue;
+		if (!node->ch_found
+		    || (node->chassis && node->chassis->chassisnum)
+		    || !is_spine(node))
+			continue;
+		if (add_chassis(&chassis_scan))
+			goto cleanup;
+		chassis_scan.current_chassis->chassisnum = ++chassisnum;
+		if (build_chassis(node, chassis_scan.current_chassis))
+			goto cleanup;
+	}
+
+	/* now make pass on nodes for chassis which are not Voltaire */
+	/* grouped by common SystemImageGUID */
+	for (node = fabric->nodes; node; node = node->next) {
+		if (mad_get_field(node->info, 0,
+				  IB_NODE_VENDORID_F) == VTR_VENDOR_ID)
+			continue;
+		if (mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F)) {
+			chassis = find_chassisguid(fabric, node);
+			if (chassis)
+				chassis->nodecount++;
+			else {
+				/* Possible new chassis */
+				if (add_chassis(&chassis_scan))
+					goto cleanup;
+				chassis_scan.current_chassis->chassisguid =
+				    get_chassisguid(node);
+				chassis_scan.current_chassis->nodecount = 1;
+				if (!fabric->chassis)
+					fabric->chassis = chassis_scan.first_chassis;
+			}
+		}
+	}
+
+	/* now, make another pass to see which nodes are part of chassis */
+	/* (defined as chassis->nodecount > 1) */
+	for (node = fabric->nodes; node; node = node->next) {
+
+		vendor_id = mad_get_field(node->info, 0,IB_NODE_VENDORID_F);
+
+		if (vendor_id == VTR_VENDOR_ID)
+			continue;
+		if (mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F)) {
+			chassis = find_chassisguid(fabric, node);
+			if (chassis && chassis->nodecount > 1) {
+				if (!chassis->chassisnum)
+					chassis->chassisnum = ++chassisnum;
+				if (!node->ch_found) {
+					node->ch_found = 1;
+					add_node_to_chassis(chassis, node);
+				}
+				else if (vendor_id == MLX_VENDOR_ID){
+					insert_mellanox_line_and_spine(node, chassis);
+				}
+			}
+		}
+	}
+
+	fabric->chassis = chassis_scan.first_chassis;
+	return 0;
+
+cleanup:
+	ch = chassis_scan.first_chassis;
+	while (ch) {
+		ch_next = ch->next;
+		free(ch);
+		ch = ch_next;
+	}
+	fabric->chassis = NULL;
+	return -1;
+}
diff --git a/include/grouping.h b/libibnetdisc/src/chassis.h
similarity index 65%
rename from include/grouping.h
rename to libibnetdisc/src/chassis.h
index e54efef..7a91be3 100644
--- a/include/grouping.h
+++ b/libibnetdisc/src/chassis.h
@@ -32,34 +32,12 @@
  *
  */
 
-#ifndef _GROUPING_H_
-#define _GROUPING_H_
+#ifndef _CHASSIS_H_
+#define _CHASSIS_H_
 
-/*========================================================*/
-/*               FABRIC SCANNER SPECIFIC DATA             */
-/*========================================================*/
-
-#define SPINES_MAX_NUM 12
-#define LINES_MAX_NUM 36
-
-typedef struct ChassisList ChassisList;
-typedef struct AllChassisList AllChassisList;
-
-struct ChassisList {
-	ChassisList *next;
-	uint64_t chassisguid;
-	int chassisnum;
-	int chassistype;
-	int nodecount;		/* used for grouping by SystemImageGUID */
-	Node *spinenode[SPINES_MAX_NUM + 1];
-	Node *linenode[LINES_MAX_NUM + 1];
-};
+#include <infiniband/ibnetdisc.h>
 
-struct AllChassisList {
-	ChassisList *first;
-	ChassisList *current;
-	ChassisList *last;
-};
+#include "internal.h"
 
 /*========================================================*/
 /*                CHASSIS RECOGNITION SPECIFIC DATA       */
@@ -92,22 +70,26 @@ struct AllChassisList {
 #define VTR_DEVID_SFB2004		0x5a40
 #define VTR_DEVID_ISR2004		0x5a41
 #define VTR_DEVID_SRB2004		0x5a42
+#define VTR_DEVID_SLB4018		0x5a5b
+#define VTR_DEVID_SFB4700		0x5a5c
+#define VTR_DEVID_SFB4700X2		0x5a5d
+#define VTR_DEVID_SFB4200		0x5a60
 
-enum ChassisType { UNRESOLVED_CT, ISR9288_CT, ISR9096_CT, ISR2012_CT, ISR2004_CT };
-enum ChassisSlot { UNRESOLVED_CS, LINE_CS, SPINE_CS, SRBD_CS };
+#define MLX_DEVID_IS4			0xbd36
 
-/*========================================================*/
-/*                External interface                      */
-/*========================================================*/
+/* Vendor IDs (for chassis based systems) */
+#define VTR_VENDOR_ID			0x8f1	/* Voltaire */
+#define MLX_VENDOR_ID			0x2c9	/* Mellanox */
+#define TS_VENDOR_ID			0x5ad	/* Cisco */
+#define SS_VENDOR_ID			0x66a	/* InfiniCon */
+#define XS_VENDOR_ID			0x1397	/* Xsigo */
 
-ChassisList *group_nodes();
-char *portmapstring(Port *port);
-char *get_chassis_type(unsigned char chassistype);
-char *get_chassis_slot(unsigned char chassisslot);
-uint64_t get_chassis_guid(unsigned char chassisnum);
+enum ibnd_chassis_type {
+	UNRESOLVED_CT, ISR9288_CT, ISR9096_CT, ISR2012_CT, ISR2004_CT,
+	ISR4700_CT, ISR4200_CT
+};
+enum ibnd_chassis_slot_type { UNRESOLVED_CS, LINE_CS, SPINE_CS, SRBD_CS };
 
-int is_xsigo_guid(uint64_t guid);
-int is_xsigo_tca(uint64_t guid);
-int is_xsigo_hca(uint64_t guid);
+int group_nodes(struct ibnd_fabric *fabric);
 
-#endif	/* _GROUPING_H_ */
+#endif				/* _CHASSIS_H_ */
diff --git a/libibnetdisc/src/ibnetdisc.c b/libibnetdisc/src/ibnetdisc.c
new file mode 100644
index 0000000..3a7dd8f
--- /dev/null
+++ b/libibnetdisc/src/ibnetdisc.c
@@ -0,0 +1,904 @@
+/*
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Laboratory
+ * Copyright (c) 2010-2011 Mellanox Technologies LTD.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#include <infiniband/umad.h>
+#include <infiniband/mad.h>
+
+#include <infiniband/ibnetdisc.h>
+#include <complib/cl_nodenamemap.h>
+
+#include "internal.h"
+#include "chassis.h"
+
+/* forward declarations */
+struct ni_cbdata
+{
+	ibnd_node_t *node;
+	int port_num;
+};
+static int query_node_info(smp_engine_t * engine, ib_portid_t * portid,
+			   struct ni_cbdata * cbdata);
+static int query_port_info(smp_engine_t * engine, ib_portid_t * portid,
+			   ibnd_node_t * node, int portnum);
+ibnd_port_t *ibnd_find_port_dr(ibnd_fabric_t * fabric, char *dr_str);
+
+static int recv_switch_info(smp_engine_t * engine, ibnd_smp_t * smp,
+			    uint8_t * mad, void *cb_data)
+{
+	uint8_t *switch_info = mad + IB_SMP_DATA_OFFS;
+	ibnd_node_t *node = cb_data;
+	memcpy(node->switchinfo, switch_info, sizeof(node->switchinfo));
+	mad_decode_field(node->switchinfo, IB_SW_ENHANCED_PORT0_F,
+			 &node->smaenhsp0);
+	return 0;
+}
+
+static int query_switch_info(smp_engine_t * engine, ib_portid_t * portid,
+			     ibnd_node_t * node)
+{
+	node->smaenhsp0 = 0;	/* assume base SP0 */
+	return issue_smp(engine, portid, IB_ATTR_SWITCH_INFO, 0,
+			 recv_switch_info, node);
+}
+
+static int add_port_to_dpath(ib_dr_path_t * path, int nextport)
+{
+	if (path->cnt > sizeof(path->p) - 2)
+		return -1;
+	++path->cnt;
+	path->p[path->cnt] = (uint8_t) nextport;
+	return path->cnt;
+}
+
+static int retract_dpath(smp_engine_t * engine, ib_portid_t * portid)
+{
+	ibnd_scan_t *scan = engine->user_data;
+	ibnd_fabric_t *fabric = scan->fabric;
+
+	if (scan->cfg->max_hops &&
+	    fabric->maxhops_discovered > scan->cfg->max_hops)
+		return 0;
+
+	/* this may seem wrong but the only time we would retract the path is
+	 * if the user specified a CA for the DR path and we are retracting
+	 * from that to find the node it is connected to.  This counts as a
+	 * positive hop discovered
+	 */
+	fabric->maxhops_discovered++;
+	portid->drpath.p[portid->drpath.cnt] = 0;
+	portid->drpath.cnt--;
+	return 1;
+}
+
+static int extend_dpath(smp_engine_t * engine, ib_portid_t * portid,
+			int nextport)
+{
+	ibnd_scan_t *scan = engine->user_data;
+	ibnd_fabric_t *fabric = scan->fabric;
+
+	if (scan->cfg->max_hops &&
+	    fabric->maxhops_discovered > scan->cfg->max_hops)
+		return 0;
+
+	if (portid->lid) {
+		/* If we were LID routed we need to set up the drslid */
+		if (!scan->selfportid.lid)
+			if (ib_resolve_self_via(&scan->selfportid, NULL, NULL,
+						scan->ibmad_port) < 0) {
+				IBND_ERROR("Failed to resolve self\n");
+				return -1;
+			}
+		portid->drpath.drslid = (uint16_t) scan->selfportid.lid;
+		portid->drpath.drdlid = 0xFFFF;
+	}
+
+	if (add_port_to_dpath(&portid->drpath, nextport) < 0) {
+		IBND_ERROR("add port %d to DR path failed; %s\n", nextport,
+			   portid2str(portid));
+		return -1;
+	}
+
+	if (((unsigned) portid->drpath.cnt - scan->initial_hops) >
+	    fabric->maxhops_discovered)
+		fabric->maxhops_discovered++;
+
+	return 1;
+}
+
+static int recv_node_desc(smp_engine_t * engine, ibnd_smp_t * smp,
+			  uint8_t * mad, void *cb_data)
+{
+	uint8_t *node_desc = mad + IB_SMP_DATA_OFFS;
+	ibnd_node_t *node = cb_data;
+	memcpy(node->nodedesc, node_desc, sizeof(node->nodedesc));
+	return 0;
+}
+
+static int query_node_desc(smp_engine_t * engine, ib_portid_t * portid,
+			   ibnd_node_t * node)
+{
+	return issue_smp(engine, portid, IB_ATTR_NODE_DESC, 0,
+			 recv_node_desc, node);
+}
+
+static void debug_port(ib_portid_t * portid, ibnd_port_t * port)
+{
+	char width[64], speed[64];
+	int iwidth;
+	int ispeed, fdr10, espeed;
+	uint8_t *info;
+	uint32_t cap_mask;
+
+	iwidth = mad_get_field(port->info, 0, IB_PORT_LINK_WIDTH_ACTIVE_F);
+	ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
+	fdr10 = mad_get_field(port->ext_info, 0,
+			      IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F);
+
+	if (port->node->type == IB_NODE_SWITCH)
+		info = (uint8_t *)&port->node->ports[0]->info;
+	else
+		info = (uint8_t *)&port->info;
+	cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+	if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+		espeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+	else
+		espeed = 0;
+	IBND_DEBUG
+	    ("portid %s portnum %d: base lid %d state %d physstate %d %s %s %s %s\n",
+	     portid2str(portid), port->portnum, port->base_lid,
+	     mad_get_field(port->info, 0, IB_PORT_STATE_F),
+	     mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F),
+	     mad_dump_val(IB_PORT_LINK_WIDTH_ACTIVE_F, width, 64, &iwidth),
+	     mad_dump_val(IB_PORT_LINK_SPEED_ACTIVE_F, speed, 64, &ispeed),
+	     (fdr10 & FDR10) ? "FDR10"  : "",
+	     mad_dump_val(IB_PORT_LINK_SPEED_EXT_ACTIVE_F, speed, 64, &espeed));
+}
+
+static int is_mlnx_ext_port_info_supported(ibnd_port_t * port)
+{
+	uint16_t devid = (uint16_t) mad_get_field(port->node->info, 0, IB_NODE_DEVID_F);
+
+	if (devid == 0xc738)
+		return 1;
+	if (devid >= 0x1003 && devid <= 0x1011)
+		return 1;
+	return 0;
+}
+
+int mlnx_ext_port_info_err(smp_engine_t * engine, ibnd_smp_t * smp,
+			   uint8_t * mad, void *cb_data)
+{
+	ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric;
+	ibnd_node_t *node = cb_data;
+	ibnd_port_t *port;
+	uint8_t port_num, local_port;
+
+	port_num = (uint8_t) mad_get_field(mad, 0, IB_MAD_ATTRMOD_F);
+	port = node->ports[port_num];
+	if (!port) {
+		IBND_ERROR("Failed to find 0x%" PRIx64 " port %u\n",
+			   node->guid, port_num);
+		return -1;
+	}
+
+	local_port = (uint8_t) mad_get_field(port->info, 0, IB_PORT_LOCAL_PORT_F);
+	debug_port(&smp->path, port);
+
+	if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
+	    == IB_PORT_PHYS_STATE_LINKUP
+	    && ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
+		(node == fabric->from_node && port_num == fabric->from_portnum))) {
+		int rc = 0;
+		ib_portid_t path = smp->path;
+
+		if (node->type != IB_NODE_SWITCH &&
+		    node == fabric->from_node &&
+		    path.drpath.cnt > 1)
+			rc = retract_dpath(engine, &path);
+		else {
+			/* we can't proceed through an HCA with DR */
+			if (path.lid == 0 || node->type == IB_NODE_SWITCH)
+				rc = extend_dpath(engine, &path, port_num);
+		}
+
+		if (rc > 0) {
+			struct ni_cbdata * cbdata = malloc(sizeof(*cbdata));
+			cbdata->node = node;
+			cbdata->port_num = port_num;
+			query_node_info(engine, &path, cbdata);
+		}
+	}
+
+	return 0;
+}
+
+static int recv_mlnx_ext_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
+				   uint8_t * mad, void *cb_data)
+{
+	ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric;
+	ibnd_node_t *node = cb_data;
+	ibnd_port_t *port;
+	uint8_t *ext_port_info = mad + IB_SMP_DATA_OFFS;
+	uint8_t port_num, local_port;
+
+	port_num = (uint8_t) mad_get_field(mad, 0, IB_MAD_ATTRMOD_F);
+	port = node->ports[port_num];
+	if (!port) {
+		IBND_ERROR("Failed to find 0x%" PRIx64 " port %u\n",
+			   node->guid, port_num);
+		return -1;
+	}
+
+	memcpy(port->ext_info, ext_port_info, sizeof(port->ext_info));
+	local_port = (uint8_t) mad_get_field(port->info, 0, IB_PORT_LOCAL_PORT_F);
+	debug_port(&smp->path, port);
+
+	if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
+	    == IB_PORT_PHYS_STATE_LINKUP
+	    && ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
+		(node == fabric->from_node && port_num == fabric->from_portnum))) {
+		int rc = 0;
+		ib_portid_t path = smp->path;
+
+		if (node->type != IB_NODE_SWITCH &&
+		    node == fabric->from_node &&
+		    path.drpath.cnt > 1)
+			rc = retract_dpath(engine, &path);
+		else {
+			/* we can't proceed through an HCA with DR */
+			if (path.lid == 0 || node->type == IB_NODE_SWITCH)
+				rc = extend_dpath(engine, &path, port_num);
+		}
+
+		if (rc > 0) {
+			struct ni_cbdata * cbdata = malloc(sizeof(*cbdata));
+			cbdata->node = node;
+			cbdata->port_num = port_num;
+			query_node_info(engine, &path, cbdata);
+		}
+	}
+
+	return 0;
+}
+
+static int query_mlnx_ext_port_info(smp_engine_t * engine, ib_portid_t * portid,
+				    ibnd_node_t * node, int portnum)
+{
+	IBND_DEBUG("Query MLNX Extended Port Info; %s (0x%" PRIx64 "):%d\n",
+		   portid2str(portid), node->guid, portnum);
+	return issue_smp(engine, portid, IB_ATTR_MLNX_EXT_PORT_INFO, portnum,
+			 recv_mlnx_ext_port_info, node);
+}
+
+static int recv_port_info(smp_engine_t * engine, ibnd_smp_t * smp,
+			  uint8_t * mad, void *cb_data)
+{
+	ibnd_scan_t *scan = (ibnd_scan_t *)engine->user_data;
+	ibnd_fabric_t *fabric = scan->fabric;
+	ibnd_node_t *node = cb_data;
+	ibnd_port_t *port;
+	uint8_t *port_info = mad + IB_SMP_DATA_OFFS;
+	uint8_t port_num, local_port;
+	int phystate, ispeed, espeed;
+	uint8_t *info;
+	uint32_t cap_mask;
+
+	port_num = (uint8_t) mad_get_field(mad, 0, IB_MAD_ATTRMOD_F);
+	local_port = (uint8_t) mad_get_field(port_info, 0, IB_PORT_LOCAL_PORT_F);
+
+	/* this may have been created before */
+	port = node->ports[port_num];
+	if (!port) {
+		port = node->ports[port_num] = calloc(1, sizeof(*port));
+		if (!port) {
+			IBND_ERROR("Failed to allocate 0x%" PRIx64 " port %u\n",
+				    node->guid, port_num);
+			return -1;
+		}
+		port->guid =
+		    mad_get_field64(node->info, 0, IB_NODE_PORT_GUID_F);
+	}
+
+	memcpy(port->info, port_info, sizeof(port->info));
+	port->node = node;
+	port->portnum = port_num;
+	port->ext_portnum = 0;
+	port->base_lid = (uint16_t) mad_get_field(port->info, 0, IB_PORT_LID_F);
+	port->lmc = (uint8_t) mad_get_field(port->info, 0, IB_PORT_LMC_F);
+
+	if (port_num == 0) {
+		node->smalid = port->base_lid;
+		node->smalmc = port->lmc;
+	} else if (node->type == IB_NODE_SWITCH) {
+		port->base_lid = node->smalid;
+		port->lmc = node->smalmc;
+	}
+
+	add_to_portguid_hash(port, fabric->portstbl);
+
+	if ((scan->cfg->flags & IBND_CONFIG_MLX_EPI)
+	    && is_mlnx_ext_port_info_supported(port)) {
+		phystate = mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F);
+		ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
+		if (port->node->type == IB_NODE_SWITCH)
+			info = (uint8_t *)&port->node->ports[0]->info;
+		else
+			info = (uint8_t *)&port->info;
+		cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+		if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+			espeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+		else
+			espeed = 0;
+
+		if (phystate == IB_PORT_PHYS_STATE_LINKUP &&
+		    ispeed == IB_LINK_SPEED_ACTIVE_10 &&
+		    espeed == IB_LINK_SPEED_EXT_ACTIVE_NONE) {	/* LinkUp/QDR */
+			query_mlnx_ext_port_info(engine, &smp->path,
+						 node, port_num);
+			return 0;
+		}
+	}
+
+	debug_port(&smp->path, port);
+
+	if (port_num && mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F)
+	    == IB_PORT_PHYS_STATE_LINKUP
+	    && ((node->type == IB_NODE_SWITCH && port_num != local_port) ||
+		(node == fabric->from_node && port_num == fabric->from_portnum))) {
+
+		int rc = 0;
+		ib_portid_t path = smp->path;
+
+		if (node->type != IB_NODE_SWITCH &&
+		    node == fabric->from_node &&
+		    path.drpath.cnt > 1)
+			rc = retract_dpath(engine, &path);
+		else {
+			/* we can't proceed through an HCA with DR */
+			if (path.lid == 0 || node->type == IB_NODE_SWITCH)
+				rc = extend_dpath(engine, &path, port_num);
+		}
+
+		if (rc > 0) {
+			struct ni_cbdata * cbdata = malloc(sizeof(*cbdata));
+			cbdata->node = node;
+			cbdata->port_num = port_num;
+			query_node_info(engine, &path, cbdata);
+		}
+	}
+
+	return 0;
+}
+
+static int recv_port0_info(smp_engine_t * engine, ibnd_smp_t * smp,
+			   uint8_t * mad, void *cb_data)
+{
+	ibnd_node_t *node = cb_data;
+	int i, status;
+
+	status = recv_port_info(engine, smp, mad, cb_data);
+	/* Query PortInfo on switch external/physical ports */
+	for (i = 1; i <= node->numports; i++)
+		query_port_info(engine, &smp->path, node, i);
+
+	return status;
+}
+
+static int query_port_info(smp_engine_t * engine, ib_portid_t * portid,
+			   ibnd_node_t * node, int portnum)
+{
+	IBND_DEBUG("Query Port Info; %s (0x%" PRIx64 "):%d\n",
+		   portid2str(portid), node->guid, portnum);
+	return issue_smp(engine, portid, IB_ATTR_PORT_INFO, portnum,
+			 portnum ? recv_port_info : recv_port0_info, node);
+}
+
+static ibnd_node_t *create_node(smp_engine_t * engine, ib_portid_t * path,
+				uint8_t * node_info)
+{
+	ibnd_fabric_t *fabric = ((ibnd_scan_t *) engine->user_data)->fabric;
+	ibnd_node_t *rc = calloc(1, sizeof(*rc));
+	if (!rc) {
+		IBND_ERROR("OOM: node creation failed\n");
+		return NULL;
+	}
+
+	/* decode just a couple of fields for quicker reference. */
+	mad_decode_field(node_info, IB_NODE_GUID_F, &rc->guid);
+	mad_decode_field(node_info, IB_NODE_TYPE_F, &rc->type);
+	mad_decode_field(node_info, IB_NODE_NPORTS_F, &rc->numports);
+
+	rc->ports = calloc(rc->numports + 1, sizeof(*rc->ports));
+	if (!rc->ports) {
+		free(rc);
+		IBND_ERROR("OOM: Failed to allocate the ports array\n");
+		return NULL;
+	}
+
+	rc->path_portid = *path;
+	memcpy(rc->info, node_info, sizeof(rc->info));
+
+	add_to_nodeguid_hash(rc, fabric->nodestbl);
+
+	/* add this to the all nodes list */
+	rc->next = fabric->nodes;
+	fabric->nodes = rc;
+
+	add_to_type_list(rc, fabric);
+
+	return rc;
+}
+
+static void link_ports(ibnd_node_t * node, ibnd_port_t * port,
+		       ibnd_node_t * remotenode, ibnd_port_t * remoteport)
+{
+	IBND_DEBUG("linking: 0x%" PRIx64 " %p->%p:%u and 0x%" PRIx64
+		   " %p->%p:%u\n", node->guid, node, port, port->portnum,
+		   remotenode->guid, remotenode, remoteport,
+		   remoteport->portnum);
+	if (port->remoteport)
+		port->remoteport->remoteport = NULL;
+	if (remoteport->remoteport)
+		remoteport->remoteport->remoteport = NULL;
+	port->remoteport = remoteport;
+	remoteport->remoteport = port;
+}
+
+static void dump_endnode(ib_portid_t * path, char *prompt,
+			 ibnd_node_t * node, ibnd_port_t * port)
+{
+	char type[64];
+	mad_dump_node_type(type, sizeof(type), &node->type, sizeof(int));
+	printf("%s -> %s %s {%016" PRIx64 "} portnum %d lid %d-%d \"%s\"\n",
+	       portid2str(path), prompt, type, node->guid,
+	       node->type == IB_NODE_SWITCH ? 0 : port->portnum,
+	       port->base_lid, port->base_lid + (1 << port->lmc) - 1,
+	       node->nodedesc);
+}
+
+static int recv_node_info(smp_engine_t * engine, ibnd_smp_t * smp,
+			  uint8_t * mad, void *cb_data)
+{
+	ibnd_scan_t *scan = engine->user_data;
+	ibnd_fabric_t *fabric = scan->fabric;
+	uint8_t *node_info = mad + IB_SMP_DATA_OFFS;
+	struct ni_cbdata *ni_cbdata = (struct ni_cbdata *)cb_data;
+	ibnd_node_t *rem_node = NULL;
+	int rem_port_num = 0;
+	ibnd_node_t *node;
+	int node_is_new = 0;
+	uint64_t node_guid = mad_get_field64(node_info, 0, IB_NODE_GUID_F);
+	uint64_t port_guid = mad_get_field64(node_info, 0, IB_NODE_PORT_GUID_F);
+	int port_num = mad_get_field(node_info, 0, IB_NODE_LOCAL_PORT_F);
+	ibnd_port_t *port = NULL;
+
+	if (ni_cbdata) {
+		rem_node = ni_cbdata->node;
+		rem_port_num = ni_cbdata->port_num;
+		free(ni_cbdata);
+	}
+
+	node = ibnd_find_node_guid(fabric, node_guid);
+	if (!node) {
+		node = create_node(engine, &smp->path, node_info);
+		if (!node)
+			return -1;
+		node_is_new = 1;
+	}
+	IBND_DEBUG("Found %s node GUID 0x%" PRIx64 " (%s)\n",
+		   node_is_new ? "new" : "old", node->guid,
+		   portid2str(&smp->path));
+
+	port = node->ports[port_num];
+	if (!port) {
+		/* If we have not see this port before create a shell for it */
+		port = node->ports[port_num] = calloc(1, sizeof(*port));
+		if (!port)
+			return -1;
+		port->node = node;
+		port->portnum = port_num;
+	}
+	port->guid = port_guid;
+
+	if (scan->cfg->show_progress)
+		dump_endnode(&smp->path, node_is_new ? "new" : "known",
+			     node, port);
+
+	if (rem_node == NULL) {	/* this is the start node */
+		fabric->from_node = node;
+		fabric->from_portnum = port_num;
+	} else {
+		/* link ports... */
+		if (!rem_node->ports[rem_port_num]) {
+			IBND_ERROR("Internal Error; "
+				   "Node(%p) 0x%" PRIx64
+				   " Port %d no port created!?!?!?\n\n",
+				   rem_node, rem_node->guid, rem_port_num);
+			return -1;
+		}
+
+		link_ports(node, port, rem_node, rem_node->ports[rem_port_num]);
+	}
+
+	if (node_is_new) {
+		query_node_desc(engine, &smp->path, node);
+
+		if (node->type == IB_NODE_SWITCH) {
+			query_switch_info(engine, &smp->path, node);
+			/* Query PortInfo on Switch Port 0 first */
+			query_port_info(engine, &smp->path, node, 0);
+		}
+	}
+
+	if (node->type != IB_NODE_SWITCH)
+		query_port_info(engine, &smp->path, node, port_num);
+
+	return 0;
+}
+
+static int query_node_info(smp_engine_t * engine, ib_portid_t * portid,
+			   struct ni_cbdata * cbdata)
+{
+	IBND_DEBUG("Query Node Info; %s\n", portid2str(portid));
+	return issue_smp(engine, portid, IB_ATTR_NODE_INFO, 0,
+			 recv_node_info, (void *)cbdata);
+}
+
+ibnd_node_t *ibnd_find_node_guid(ibnd_fabric_t * fabric, uint64_t guid)
+{
+	int hash = HASHGUID(guid) % HTSZ;
+	ibnd_node_t *node;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return NULL;
+	}
+
+	for (node = fabric->nodestbl[hash]; node; node = node->htnext)
+		if (node->guid == guid)
+			return node;
+
+	return NULL;
+}
+
+ibnd_node_t *ibnd_find_node_dr(ibnd_fabric_t * fabric, char *dr_str)
+{
+	ibnd_port_t *rc = ibnd_find_port_dr(fabric, dr_str);
+	return rc->node;
+}
+
+void add_to_nodeguid_hash(ibnd_node_t * node, ibnd_node_t * hash[])
+{
+	int hash_idx = HASHGUID(node->guid) % HTSZ;
+
+	node->htnext = hash[hash_idx];
+	hash[hash_idx] = node;
+}
+
+void add_to_portguid_hash(ibnd_port_t * port, ibnd_port_t * hash[])
+{
+	int hash_idx = HASHGUID(port->guid) % HTSZ;
+
+	port->htnext = hash[hash_idx];
+	hash[hash_idx] = port;
+}
+
+void add_to_type_list(ibnd_node_t * node, ibnd_fabric_t * fabric)
+{
+	switch (node->type) {
+	case IB_NODE_CA:
+		node->type_next = fabric->ch_adapters;
+		fabric->ch_adapters = node;
+		break;
+	case IB_NODE_SWITCH:
+		node->type_next = fabric->switches;
+		fabric->switches = node;
+		break;
+	case IB_NODE_ROUTER:
+		node->type_next = fabric->routers;
+		fabric->routers = node;
+		break;
+	}
+}
+
+static int set_config(struct ibnd_config *config, struct ibnd_config *cfg)
+{
+	if (!config)
+		return (-EINVAL);
+
+	if (cfg)
+		memcpy(config, cfg, sizeof(*config));
+
+	if (!config->max_smps)
+		config->max_smps = DEFAULT_MAX_SMP_ON_WIRE;
+	if (!config->timeout_ms)
+		config->timeout_ms = DEFAULT_TIMEOUT;
+	if (!config->retries)
+		config->retries = DEFAULT_RETRIES;
+
+	return (0);
+}
+
+ibnd_fabric_t *ibnd_discover_fabric(char * ca_name, int ca_port,
+				    ib_portid_t * from,
+				    struct ibnd_config *cfg)
+{
+	struct ibnd_config config = { 0 };
+	ibnd_fabric_t *fabric = NULL;
+	ib_portid_t my_portid = { 0 };
+	smp_engine_t engine;
+	ibnd_scan_t scan;
+	int nc = 2;
+	int mc[2] = { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS };
+
+	/* If not specified start from "my" port */
+	if (!from)
+		from = &my_portid;
+
+	if (set_config(&config, cfg)) {
+		IBND_ERROR("Invalid ibnd_config\n");
+		return NULL;
+	}
+
+	fabric = calloc(1, sizeof(*fabric));
+	if (!fabric) {
+		IBND_ERROR("OOM: failed to calloc ibnd_fabric_t\n");
+		return NULL;
+	}
+
+	memset(fabric, 0, sizeof(*fabric));
+
+	memset(&scan.selfportid, 0, sizeof(scan.selfportid));
+	scan.fabric = fabric;
+	scan.cfg = &config;
+	scan.initial_hops = from->drpath.cnt;
+
+	if (smp_engine_init(&engine, ca_name, ca_port, &scan, &config)) {
+		free(fabric);
+		return (NULL);
+	}
+
+	scan.ibmad_port = mad_rpc_open_port(ca_name, ca_port, mc, nc);
+	if (!scan.ibmad_port) {
+		IBND_ERROR("can't open MAD port (%s:%d)\n", ca_name, ca_port);
+		smp_engine_destroy(&engine);
+		return (NULL);
+	}
+	mad_rpc_set_timeout(scan.ibmad_port, cfg->timeout_ms);
+	mad_rpc_set_retries(scan.ibmad_port, cfg->retries);
+	smp_mkey_set(scan.ibmad_port, cfg->mkey);
+
+	IBND_DEBUG("from %s\n", portid2str(from));
+
+	if (!query_node_info(&engine, from, NULL))
+		if (process_mads(&engine) != 0)
+			goto error;
+
+	fabric->total_mads_used = engine.total_smps;
+	fabric->maxhops_discovered += scan.initial_hops;
+
+	if (group_nodes(fabric))
+		goto error;
+
+	smp_engine_destroy(&engine);
+	mad_rpc_close_port(scan.ibmad_port);
+	return fabric;
+error:
+	smp_engine_destroy(&engine);
+	mad_rpc_close_port(scan.ibmad_port);
+	ibnd_destroy_fabric(fabric);
+	return NULL;
+}
+
+void destroy_node(ibnd_node_t * node)
+{
+	int p = 0;
+
+	if (node->ports) {
+		for (p = 0; p <= node->numports; p++)
+			free(node->ports[p]);
+		free(node->ports);
+	}
+	free(node);
+}
+
+void ibnd_destroy_fabric(ibnd_fabric_t * fabric)
+{
+	ibnd_node_t *node = NULL;
+	ibnd_node_t *next = NULL;
+	ibnd_chassis_t *ch, *ch_next;
+
+	if (!fabric)
+		return;
+
+	ch = fabric->chassis;
+	while (ch) {
+		ch_next = ch->next;
+		free(ch);
+		ch = ch_next;
+	}
+	node = fabric->nodes;
+	while (node) {
+		next = node->next;
+		destroy_node(node);
+		node = next;
+	}
+	free(fabric);
+}
+
+void ibnd_iter_nodes(ibnd_fabric_t * fabric, ibnd_iter_node_func_t func,
+		     void *user_data)
+{
+	ibnd_node_t *cur = NULL;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return;
+	}
+
+	if (!func) {
+		IBND_DEBUG("func parameter NULL\n");
+		return;
+	}
+
+	for (cur = fabric->nodes; cur; cur = cur->next)
+		func(cur, user_data);
+}
+
+void ibnd_iter_nodes_type(ibnd_fabric_t * fabric, ibnd_iter_node_func_t func,
+			  int node_type, void *user_data)
+{
+	ibnd_node_t *list = NULL;
+	ibnd_node_t *cur = NULL;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return;
+	}
+
+	if (!func) {
+		IBND_DEBUG("func parameter NULL\n");
+		return;
+	}
+
+	switch (node_type) {
+	case IB_NODE_SWITCH:
+		list = fabric->switches;
+		break;
+	case IB_NODE_CA:
+		list = fabric->ch_adapters;
+		break;
+	case IB_NODE_ROUTER:
+		list = fabric->routers;
+		break;
+	default:
+		IBND_DEBUG("Invalid node_type specified %d\n", node_type);
+		break;
+	}
+
+	for (cur = list; cur; cur = cur->type_next)
+		func(cur, user_data);
+}
+
+ibnd_port_t *ibnd_find_port_guid(ibnd_fabric_t * fabric, uint64_t guid)
+{
+	int hash = HASHGUID(guid) % HTSZ;
+	ibnd_port_t *port;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return NULL;
+	}
+
+	for (port = fabric->portstbl[hash]; port; port = port->htnext)
+		if (port->guid == guid)
+			return port;
+
+	return NULL;
+}
+
+ibnd_port_t *ibnd_find_port_dr(ibnd_fabric_t * fabric, char *dr_str)
+{
+	int i = 0;
+	ibnd_node_t *cur_node;
+	ibnd_port_t *rc = NULL;
+	ib_dr_path_t path;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return NULL;
+	}
+
+	if (!dr_str) {
+		IBND_DEBUG("dr_str parameter NULL\n");
+		return NULL;
+	}
+
+	cur_node = fabric->from_node;
+
+	if (str2drpath(&path, dr_str, 0, 0) == -1)
+		return NULL;
+
+	for (i = 0; i <= path.cnt; i++) {
+		ibnd_port_t *remote_port = NULL;
+		if (path.p[i] == 0)
+			continue;
+		if (!cur_node->ports)
+			return NULL;
+
+		remote_port = cur_node->ports[path.p[i]]->remoteport;
+		if (!remote_port)
+			return NULL;
+
+		rc = remote_port;
+		cur_node = remote_port->node;
+	}
+
+	return rc;
+}
+
+void ibnd_iter_ports(ibnd_fabric_t * fabric, ibnd_iter_port_func_t func,
+			void *user_data)
+{
+	int i = 0;
+	ibnd_port_t *cur = NULL;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return;
+	}
+
+	if (!func) {
+		IBND_DEBUG("func parameter NULL\n");
+		return;
+	}
+
+	for (i = 0; i<HTSZ; i++)
+		for (cur = fabric->portstbl[i]; cur; cur = cur->htnext)
+			func(cur, user_data);
+}
diff --git a/libibnetdisc/src/ibnetdisc_cache.c b/libibnetdisc/src/ibnetdisc_cache.c
new file mode 100644
index 0000000..2690373
--- /dev/null
+++ b/libibnetdisc/src/ibnetdisc_cache.c
@@ -0,0 +1,954 @@
+/*
+ * Copyright (c) 2004-2007 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Laboratory
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#include <infiniband/ibnetdisc.h>
+
+#include "internal.h"
+#include "chassis.h"
+
+/* For this caching lib, we always cache little endian */
+
+/* Cache format
+ *
+ * Bytes 1-4 - magic number
+ * Bytes 5-8 - version number
+ * Bytes 9-12 - node count
+ * Bytes 13-16 - port count
+ * Bytes 17-24 - "from node" guid
+ * Bytes 25-28 - maxhops discovered
+ * Bytes X-Y - nodes (variable length)
+ * Bytes X-Y - ports (variable length)
+ *
+ * Nodes are cached as
+ *
+ * 2 bytes - smalid
+ * 1 byte - smalmc
+ * 1 byte - smaenhsp0 flag
+ * IB_SMP_DATA_SIZE bytes - switchinfo
+ * 8 bytes - guid
+ * 1 byte - type
+ * 1 byte - numports
+ * IB_SMP_DATA_SIZE bytes - info
+ * IB_SMP_DATA_SIZE bytes - nodedesc
+ * 1 byte - number of ports stored
+ * 8 bytes - portguid A
+ * 1 byte - port num A
+ * 8 bytes - portguid B
+ * 1 byte - port num B
+ * ... etc., depending on number of ports stored
+ *
+ * Ports are cached as
+ *
+ * 8 bytes - guid
+ * 1 byte - portnum
+ * 1 byte - external portnum
+ * 2 bytes - base lid
+ * 1 byte - lmc
+ * IB_SMP_DATA_SIZE bytes - info
+ * 8 bytes - node guid port "owned" by
+ * 1 byte - flag indicating if remote port exists
+ * 8 bytes - port guid remotely connected to
+ * 1 byte - port num remotely connected to
+ */
+
+/* Structs that hold cache info temporarily before
+ * the real structs can be reconstructed.
+ */
+
+typedef struct ibnd_port_cache_key {
+	uint64_t guid;
+	uint8_t portnum;
+} ibnd_port_cache_key_t;
+
+typedef struct ibnd_node_cache {
+	ibnd_node_t *node;
+	uint8_t ports_stored_count;
+	ibnd_port_cache_key_t *port_cache_keys;
+	struct ibnd_node_cache *next;
+	struct ibnd_node_cache *htnext;
+	int node_stored_to_fabric;
+} ibnd_node_cache_t;
+
+typedef struct ibnd_port_cache {
+	ibnd_port_t *port;
+	uint64_t node_guid;
+	uint8_t remoteport_flag;
+	ibnd_port_cache_key_t remoteport_cache_key;
+	struct ibnd_port_cache *next;
+	struct ibnd_port_cache *htnext;
+	int port_stored_to_fabric;
+} ibnd_port_cache_t;
+
+typedef struct ibnd_fabric_cache {
+	ibnd_fabric_t *fabric;
+	uint64_t from_node_guid;
+	ibnd_node_cache_t *nodes_cache;
+	ibnd_port_cache_t *ports_cache;
+	ibnd_node_cache_t *nodescachetbl[HTSZ];
+	ibnd_port_cache_t *portscachetbl[HTSZ];
+} ibnd_fabric_cache_t;
+
+#define IBND_FABRIC_CACHE_BUFLEN  4096
+#define IBND_FABRIC_CACHE_MAGIC   0x8FE7832B
+#define IBND_FABRIC_CACHE_VERSION 0x00000001
+
+#define IBND_FABRIC_CACHE_COUNT_OFFSET 8
+
+#define IBND_FABRIC_CACHE_HEADER_LEN   (28)
+#define IBND_NODE_CACHE_HEADER_LEN     (15 + IB_SMP_DATA_SIZE*3)
+#define IBND_PORT_CACHE_KEY_LEN        (8 + 1)
+#define IBND_PORT_CACHE_LEN            (31 + IB_SMP_DATA_SIZE)
+
+static ssize_t ibnd_read(int fd, void *buf, size_t count)
+{
+	size_t count_done = 0;
+	ssize_t ret;
+
+	while ((count - count_done) > 0) {
+		ret = read(fd, ((char *) buf) + count_done, count - count_done);
+		if (ret < 0) {
+			if (errno == EINTR)
+				continue;
+			else {
+				IBND_DEBUG("read: %s\n", strerror(errno));
+				return -1;
+			}
+		}
+		if (!ret)
+			break;
+		count_done += ret;
+	}
+
+	if (count_done != count) {
+		IBND_DEBUG("read: read short\n");
+		return -1;
+	}
+
+	return count_done;
+}
+
+static size_t _unmarshall8(uint8_t * inbuf, uint8_t * num)
+{
+	(*num) = inbuf[0];
+
+	return (sizeof(*num));
+}
+
+static size_t _unmarshall16(uint8_t * inbuf, uint16_t * num)
+{
+	(*num) = ((uint16_t) inbuf[1] << 8) | inbuf[0];
+
+	return (sizeof(*num));
+}
+
+static size_t _unmarshall32(uint8_t * inbuf, uint32_t * num)
+{
+	(*num) = (uint32_t) inbuf[0];
+	(*num) |= ((uint32_t) inbuf[1] << 8);
+	(*num) |= ((uint32_t) inbuf[2] << 16);
+	(*num) |= ((uint32_t) inbuf[3] << 24);
+
+	return (sizeof(*num));
+}
+
+static size_t _unmarshall64(uint8_t * inbuf, uint64_t * num)
+{
+	(*num) = (uint64_t) inbuf[0];
+	(*num) |= ((uint64_t) inbuf[1] << 8);
+	(*num) |= ((uint64_t) inbuf[2] << 16);
+	(*num) |= ((uint64_t) inbuf[3] << 24);
+	(*num) |= ((uint64_t) inbuf[4] << 32);
+	(*num) |= ((uint64_t) inbuf[5] << 40);
+	(*num) |= ((uint64_t) inbuf[6] << 48);
+	(*num) |= ((uint64_t) inbuf[7] << 56);
+
+	return (sizeof(*num));
+}
+
+static size_t _unmarshall_buf(const void *inbuf, void *outbuf, unsigned int len)
+{
+	memcpy(outbuf, inbuf, len);
+
+	return len;
+}
+
+static int _load_header_info(int fd, ibnd_fabric_cache_t * fabric_cache,
+			     unsigned int *node_count, unsigned int *port_count)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	uint32_t magic = 0;
+	uint32_t version = 0;
+	size_t offset = 0;
+	uint32_t tmp32;
+
+	if (ibnd_read(fd, buf, IBND_FABRIC_CACHE_HEADER_LEN) < 0)
+		return -1;
+
+	offset += _unmarshall32(buf + offset, &magic);
+
+	if (magic != IBND_FABRIC_CACHE_MAGIC) {
+		IBND_DEBUG("invalid fabric cache file\n");
+		return -1;
+	}
+
+	offset += _unmarshall32(buf + offset, &version);
+
+	if (version != IBND_FABRIC_CACHE_VERSION) {
+		IBND_DEBUG("invalid fabric cache version\n");
+		return -1;
+	}
+
+	offset += _unmarshall32(buf + offset, node_count);
+	offset += _unmarshall32(buf + offset, port_count);
+
+	offset += _unmarshall64(buf + offset, &fabric_cache->from_node_guid);
+	offset += _unmarshall32(buf + offset, &tmp32);
+	fabric_cache->fabric->maxhops_discovered = tmp32;
+
+	return 0;
+}
+
+static void _destroy_ibnd_node_cache(ibnd_node_cache_t * node_cache)
+{
+	free(node_cache->port_cache_keys);
+	if (!node_cache->node_stored_to_fabric && node_cache->node)
+		destroy_node(node_cache->node);
+	free(node_cache);
+}
+
+static void _destroy_ibnd_fabric_cache(ibnd_fabric_cache_t * fabric_cache)
+{
+	ibnd_node_cache_t *node_cache;
+	ibnd_node_cache_t *node_cache_next;
+	ibnd_port_cache_t *port_cache;
+	ibnd_port_cache_t *port_cache_next;
+
+	if (!fabric_cache)
+		return;
+
+	node_cache = fabric_cache->nodes_cache;
+	while (node_cache) {
+		node_cache_next = node_cache->next;
+
+		_destroy_ibnd_node_cache(node_cache);
+
+		node_cache = node_cache_next;
+	}
+
+	port_cache = fabric_cache->ports_cache;
+	while (port_cache) {
+		port_cache_next = port_cache->next;
+
+		if (!port_cache->port_stored_to_fabric && port_cache->port)
+			free(port_cache->port);
+		free(port_cache);
+
+		port_cache = port_cache_next;
+	}
+
+	free(fabric_cache);
+}
+
+static void store_node_cache(ibnd_node_cache_t * node_cache,
+			     ibnd_fabric_cache_t * fabric_cache)
+{
+	int hash_indx = HASHGUID(node_cache->node->guid) % HTSZ;
+
+	node_cache->next = fabric_cache->nodes_cache;
+	fabric_cache->nodes_cache = node_cache;
+
+	node_cache->htnext = fabric_cache->nodescachetbl[hash_indx];
+	fabric_cache->nodescachetbl[hash_indx] = node_cache;
+}
+
+static int _load_node(int fd, ibnd_fabric_cache_t * fabric_cache)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	ibnd_node_cache_t *node_cache = NULL;
+	ibnd_node_t *node = NULL;
+	size_t offset = 0;
+	uint8_t tmp8;
+
+	node_cache = (ibnd_node_cache_t *) malloc(sizeof(ibnd_node_cache_t));
+	if (!node_cache) {
+		IBND_DEBUG("OOM: node_cache\n");
+		return -1;
+	}
+	memset(node_cache, '\0', sizeof(ibnd_node_cache_t));
+
+	node = (ibnd_node_t *) malloc(sizeof(ibnd_node_t));
+	if (!node) {
+		IBND_DEBUG("OOM: node\n");
+		free(node_cache);
+		return -1;
+	}
+	memset(node, '\0', sizeof(ibnd_node_t));
+
+	node_cache->node = node;
+
+	if (ibnd_read(fd, buf, IBND_NODE_CACHE_HEADER_LEN) < 0)
+		goto cleanup;
+
+	offset += _unmarshall16(buf + offset, &node->smalid);
+	offset += _unmarshall8(buf + offset, &node->smalmc);
+	offset += _unmarshall8(buf + offset, &tmp8);
+	node->smaenhsp0 = tmp8;
+	offset += _unmarshall_buf(buf + offset, node->switchinfo,
+				  IB_SMP_DATA_SIZE);
+	offset += _unmarshall64(buf + offset, &node->guid);
+	offset += _unmarshall8(buf + offset, &tmp8);
+	node->type = tmp8;
+	offset += _unmarshall8(buf + offset, &tmp8);
+	node->numports = tmp8;
+	offset += _unmarshall_buf(buf + offset, node->info, IB_SMP_DATA_SIZE);
+	offset += _unmarshall_buf(buf + offset, node->nodedesc,
+				  IB_SMP_DATA_SIZE);
+
+	offset += _unmarshall8(buf + offset, &node_cache->ports_stored_count);
+
+	if (node_cache->ports_stored_count) {
+		unsigned int tomalloc = 0;
+		unsigned int toread = 0;
+		unsigned int i;
+
+		tomalloc =
+		    sizeof(ibnd_port_cache_key_t) *
+		    node_cache->ports_stored_count;
+
+		toread =
+		    IBND_PORT_CACHE_KEY_LEN * node_cache->ports_stored_count;
+
+		node_cache->port_cache_keys =
+		    (ibnd_port_cache_key_t *) malloc(tomalloc);
+		if (!node_cache->port_cache_keys) {
+			IBND_DEBUG("OOM: node_cache port_cache_keys\n");
+			goto cleanup;
+		}
+
+		if (ibnd_read(fd, buf, toread) < 0)
+			goto cleanup;
+
+		offset = 0;
+
+		for (i = 0; i < node_cache->ports_stored_count; i++) {
+			offset +=
+			    _unmarshall64(buf + offset,
+					  &node_cache->port_cache_keys[i].guid);
+			offset +=
+			    _unmarshall8(buf + offset,
+					 &node_cache->
+					 port_cache_keys[i].portnum);
+		}
+	}
+
+	store_node_cache(node_cache, fabric_cache);
+
+	return 0;
+
+cleanup:
+	_destroy_ibnd_node_cache(node_cache);
+	return -1;
+}
+
+static void store_port_cache(ibnd_port_cache_t * port_cache,
+			     ibnd_fabric_cache_t * fabric_cache)
+{
+	int hash_indx = HASHGUID(port_cache->port->guid) % HTSZ;
+
+	port_cache->next = fabric_cache->ports_cache;
+	fabric_cache->ports_cache = port_cache;
+
+	port_cache->htnext = fabric_cache->portscachetbl[hash_indx];
+	fabric_cache->portscachetbl[hash_indx] = port_cache;
+}
+
+static int _load_port(int fd, ibnd_fabric_cache_t * fabric_cache)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	ibnd_port_cache_t *port_cache = NULL;
+	ibnd_port_t *port = NULL;
+	size_t offset = 0;
+	uint8_t tmp8;
+
+	port_cache = (ibnd_port_cache_t *) malloc(sizeof(ibnd_port_cache_t));
+	if (!port_cache) {
+		IBND_DEBUG("OOM: port_cache\n");
+		return -1;
+	}
+	memset(port_cache, '\0', sizeof(ibnd_port_cache_t));
+
+	port = (ibnd_port_t *) malloc(sizeof(ibnd_port_t));
+	if (!port) {
+		IBND_DEBUG("OOM: port\n");
+		free(port_cache);
+		return -1;
+	}
+	memset(port, '\0', sizeof(ibnd_port_t));
+
+	port_cache->port = port;
+
+	if (ibnd_read(fd, buf, IBND_PORT_CACHE_LEN) < 0)
+		goto cleanup;
+
+	offset += _unmarshall64(buf + offset, &port->guid);
+	offset += _unmarshall8(buf + offset, &tmp8);
+	port->portnum = tmp8;
+	offset += _unmarshall8(buf + offset, &tmp8);
+	port->ext_portnum = tmp8;
+	offset += _unmarshall16(buf + offset, &port->base_lid);
+	offset += _unmarshall8(buf + offset, &port->lmc);
+	offset += _unmarshall_buf(buf + offset, port->info, IB_SMP_DATA_SIZE);
+	offset += _unmarshall64(buf + offset, &port_cache->node_guid);
+	offset += _unmarshall8(buf + offset, &port_cache->remoteport_flag);
+	offset +=
+	    _unmarshall64(buf + offset, &port_cache->remoteport_cache_key.guid);
+	offset +=
+	    _unmarshall8(buf + offset,
+			 &port_cache->remoteport_cache_key.portnum);
+
+	store_port_cache(port_cache, fabric_cache);
+
+	return 0;
+
+cleanup:
+	free(port);
+	free(port_cache);
+	return -1;
+}
+
+static ibnd_port_cache_t *_find_port(ibnd_fabric_cache_t * fabric_cache,
+				     ibnd_port_cache_key_t * port_cache_key)
+{
+	int hash_indx = HASHGUID(port_cache_key->guid) % HTSZ;
+	ibnd_port_cache_t *port_cache;
+
+	for (port_cache = fabric_cache->portscachetbl[hash_indx];
+	     port_cache; port_cache = port_cache->htnext) {
+		if (port_cache->port->guid == port_cache_key->guid
+		    && port_cache->port->portnum == port_cache_key->portnum)
+			return port_cache;
+	}
+
+	return NULL;
+}
+
+static ibnd_node_cache_t *_find_node(ibnd_fabric_cache_t * fabric_cache,
+				     uint64_t guid)
+{
+	int hash_indx = HASHGUID(guid) % HTSZ;
+	ibnd_node_cache_t *node_cache;
+
+	for (node_cache = fabric_cache->nodescachetbl[hash_indx];
+	     node_cache; node_cache = node_cache->htnext) {
+		if (node_cache->node->guid == guid)
+			return node_cache;
+	}
+
+	return NULL;
+}
+
+static int _fill_port(ibnd_fabric_cache_t * fabric_cache, ibnd_node_t * node,
+		      ibnd_port_cache_key_t * port_cache_key)
+{
+	ibnd_port_cache_t *port_cache;
+
+	if (!(port_cache = _find_port(fabric_cache, port_cache_key))) {
+		IBND_DEBUG("Cache invalid: cannot find port\n");
+		return -1;
+	}
+
+	if (port_cache->port_stored_to_fabric) {
+		IBND_DEBUG("Cache invalid: duplicate port discovered\n");
+		return -1;
+	}
+
+	node->ports[port_cache->port->portnum] = port_cache->port;
+	port_cache->port_stored_to_fabric++;
+
+	/* achu: needed if user wishes to re-cache a loaded fabric.
+	 * Otherwise, mostly unnecessary to do this.
+	 */
+	add_to_portguid_hash(port_cache->port, fabric_cache->fabric->portstbl);
+	return 0;
+}
+
+static int _rebuild_nodes(ibnd_fabric_cache_t * fabric_cache)
+{
+	ibnd_node_cache_t *node_cache;
+	ibnd_node_cache_t *node_cache_next;
+
+	node_cache = fabric_cache->nodes_cache;
+	while (node_cache) {
+		ibnd_node_t *node;
+		int i;
+
+		node_cache_next = node_cache->next;
+
+		node = node_cache->node;
+
+		/* Insert node into appropriate data structures */
+
+		node->next = fabric_cache->fabric->nodes;
+		fabric_cache->fabric->nodes = node;
+
+		add_to_nodeguid_hash(node_cache->node,
+				     fabric_cache->fabric->nodestbl);
+
+		add_to_type_list(node_cache->node, fabric_cache->fabric);
+
+		node_cache->node_stored_to_fabric++;
+
+		/* Rebuild node ports array */
+
+		if (!(node->ports =
+		      calloc(sizeof(*node->ports), node->numports + 1))) {
+			IBND_DEBUG("OOM: node->ports\n");
+			return -1;
+		}
+
+		for (i = 0; i < node_cache->ports_stored_count; i++) {
+			if (_fill_port(fabric_cache, node,
+				       &node_cache->port_cache_keys[i]) < 0)
+				return -1;
+		}
+
+		node_cache = node_cache_next;
+	}
+
+	return 0;
+}
+
+static int _rebuild_ports(ibnd_fabric_cache_t * fabric_cache)
+{
+	ibnd_port_cache_t *port_cache;
+	ibnd_port_cache_t *port_cache_next;
+
+	port_cache = fabric_cache->ports_cache;
+	while (port_cache) {
+		ibnd_node_cache_t *node_cache;
+		ibnd_port_cache_t *remoteport_cache;
+		ibnd_port_t *port;
+
+		port_cache_next = port_cache->next;
+
+		port = port_cache->port;
+
+		if (!(node_cache =
+		      _find_node(fabric_cache, port_cache->node_guid))) {
+			IBND_DEBUG("Cache invalid: cannot find node\n");
+			return -1;
+		}
+
+		port->node = node_cache->node;
+
+		if (port_cache->remoteport_flag) {
+			if (!(remoteport_cache = _find_port(fabric_cache,
+							    &port_cache->remoteport_cache_key)))
+			{
+				IBND_DEBUG
+				    ("Cache invalid: cannot find remote port\n");
+				return -1;
+			}
+
+			port->remoteport = remoteport_cache->port;
+		} else
+			port->remoteport = NULL;
+
+		port_cache = port_cache_next;
+	}
+
+	return 0;
+}
+
+ibnd_fabric_t *ibnd_load_fabric(const char *file, unsigned int flags)
+{
+	unsigned int node_count = 0;
+	unsigned int port_count = 0;
+	ibnd_fabric_cache_t *fabric_cache = NULL;
+	ibnd_fabric_t *fabric = NULL;
+	ibnd_node_cache_t *node_cache = NULL;
+	int fd = -1;
+	unsigned int i;
+
+	if (!file) {
+		IBND_DEBUG("file parameter NULL\n");
+		return NULL;
+	}
+
+	if ((fd = open(file, O_RDONLY)) < 0) {
+		IBND_DEBUG("open: %s\n", strerror(errno));
+		return NULL;
+	}
+
+	fabric_cache =
+	    (ibnd_fabric_cache_t *) malloc(sizeof(ibnd_fabric_cache_t));
+	if (!fabric_cache) {
+		IBND_DEBUG("OOM: fabric_cache\n");
+		goto cleanup;
+	}
+	memset(fabric_cache, '\0', sizeof(ibnd_fabric_cache_t));
+
+	fabric = (ibnd_fabric_t *) malloc(sizeof(ibnd_fabric_t));
+	if (!fabric) {
+		IBND_DEBUG("OOM: fabric\n");
+		goto cleanup;
+	}
+	memset(fabric, '\0', sizeof(ibnd_fabric_t));
+
+	fabric_cache->fabric = fabric;
+
+	if (_load_header_info(fd, fabric_cache, &node_count, &port_count) < 0)
+		goto cleanup;
+
+	for (i = 0; i < node_count; i++) {
+		if (_load_node(fd, fabric_cache) < 0)
+			goto cleanup;
+	}
+
+	for (i = 0; i < port_count; i++) {
+		if (_load_port(fd, fabric_cache) < 0)
+			goto cleanup;
+	}
+
+	/* Special case - find from node */
+	if (!(node_cache =
+	      _find_node(fabric_cache, fabric_cache->from_node_guid))) {
+		IBND_DEBUG("Cache invalid: cannot find from node\n");
+		goto cleanup;
+	}
+	fabric->from_node = node_cache->node;
+
+	if (_rebuild_nodes(fabric_cache) < 0)
+		goto cleanup;
+
+	if (_rebuild_ports(fabric_cache) < 0)
+		goto cleanup;
+
+	if (group_nodes(fabric))
+		goto cleanup;
+
+	_destroy_ibnd_fabric_cache(fabric_cache);
+	close(fd);
+	return fabric;
+
+cleanup:
+	ibnd_destroy_fabric(fabric);
+	_destroy_ibnd_fabric_cache(fabric_cache);
+	close(fd);
+	return NULL;
+}
+
+static ssize_t ibnd_write(int fd, const void *buf, size_t count)
+{
+	size_t count_done = 0;
+	ssize_t ret;
+
+	while ((count - count_done) > 0) {
+		ret = write(fd, ((char *) buf) + count_done, count - count_done);
+		if (ret < 0) {
+			if (errno == EINTR)
+				continue;
+			else {
+				IBND_DEBUG("write: %s\n", strerror(errno));
+				return -1;
+			}
+		}
+		count_done += ret;
+	}
+	return count_done;
+}
+
+static size_t _marshall8(uint8_t * outbuf, uint8_t num)
+{
+	outbuf[0] = num;
+
+	return (sizeof(num));
+}
+
+static size_t _marshall16(uint8_t * outbuf, uint16_t num)
+{
+	outbuf[0] = num & 0x00FF;
+	outbuf[1] = (num & 0xFF00) >> 8;
+
+	return (sizeof(num));
+}
+
+static size_t _marshall32(uint8_t * outbuf, uint32_t num)
+{
+	outbuf[0] = num & 0x000000FF;
+	outbuf[1] = (num & 0x0000FF00) >> 8;
+	outbuf[2] = (num & 0x00FF0000) >> 16;
+	outbuf[3] = (num & 0xFF000000) >> 24;
+
+	return (sizeof(num));
+}
+
+static size_t _marshall64(uint8_t * outbuf, uint64_t num)
+{
+	outbuf[0] = (uint8_t) num;
+	outbuf[1] = (uint8_t) (num >> 8);
+	outbuf[2] = (uint8_t) (num >> 16);
+	outbuf[3] = (uint8_t) (num >> 24);
+	outbuf[4] = (uint8_t) (num >> 32);
+	outbuf[5] = (uint8_t) (num >> 40);
+	outbuf[6] = (uint8_t) (num >> 48);
+	outbuf[7] = (uint8_t) (num >> 56);
+
+	return (sizeof(num));
+}
+
+static size_t _marshall_buf(void *outbuf, const void *inbuf, unsigned int len)
+{
+	memcpy(outbuf, inbuf, len);
+
+	return len;
+}
+
+static int _cache_header_info(int fd, ibnd_fabric_t * fabric)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	size_t offset = 0;
+
+	/* Store magic number, version, and other important info */
+	/* For this caching lib, we always assume cached as little endian */
+
+	offset += _marshall32(buf + offset, IBND_FABRIC_CACHE_MAGIC);
+	offset += _marshall32(buf + offset, IBND_FABRIC_CACHE_VERSION);
+	/* save space for node count */
+	offset += _marshall32(buf + offset, 0);
+	/* save space for port count */
+	offset += _marshall32(buf + offset, 0);
+	offset += _marshall64(buf + offset, fabric->from_node->guid);
+	offset += _marshall32(buf + offset, fabric->maxhops_discovered);
+
+	if (ibnd_write(fd, buf, offset) < 0)
+		return -1;
+
+	return 0;
+}
+
+static int _cache_header_counts(int fd, unsigned int node_count,
+				unsigned int port_count)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	size_t offset = 0;
+
+	offset += _marshall32(buf + offset, node_count);
+	offset += _marshall32(buf + offset, port_count);
+
+	if (lseek(fd, IBND_FABRIC_CACHE_COUNT_OFFSET, SEEK_SET) < 0) {
+		IBND_DEBUG("lseek: %s\n", strerror(errno));
+		return -1;
+	}
+
+	if (ibnd_write(fd, buf, offset) < 0)
+		return -1;
+
+	return 0;
+}
+
+static int _cache_node(int fd, ibnd_node_t * node)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	size_t offset = 0;
+	size_t ports_stored_offset = 0;
+	uint8_t ports_stored_count = 0;
+	int i;
+
+	offset += _marshall16(buf + offset, node->smalid);
+	offset += _marshall8(buf + offset, node->smalmc);
+	offset += _marshall8(buf + offset, (uint8_t) node->smaenhsp0);
+	offset += _marshall_buf(buf + offset, node->switchinfo,
+				IB_SMP_DATA_SIZE);
+	offset += _marshall64(buf + offset, node->guid);
+	offset += _marshall8(buf + offset, (uint8_t) node->type);
+	offset += _marshall8(buf + offset, (uint8_t) node->numports);
+	offset += _marshall_buf(buf + offset, node->info, IB_SMP_DATA_SIZE);
+	offset += _marshall_buf(buf + offset, node->nodedesc, IB_SMP_DATA_SIZE);
+	/* need to come back later and store number of stored ports
+	 * because port entries can be NULL or (in the case of switches)
+	 * there is an additional port 0 not accounted for in numports.
+	 */
+	ports_stored_offset = offset;
+	offset += sizeof(uint8_t);
+
+	for (i = 0; i <= node->numports; i++) {
+		if (node->ports[i]) {
+			offset += _marshall64(buf + offset,
+					      node->ports[i]->guid);
+			offset += _marshall8(buf + offset,
+					     (uint8_t) node->ports[i]->portnum);
+			ports_stored_count++;
+		}
+	}
+
+	/* go back and store number of port keys stored */
+	_marshall8(buf + ports_stored_offset, ports_stored_count);
+
+	if (ibnd_write(fd, buf, offset) < 0)
+		return -1;
+
+	return 0;
+}
+
+static int _cache_port(int fd, ibnd_port_t * port)
+{
+	uint8_t buf[IBND_FABRIC_CACHE_BUFLEN];
+	size_t offset = 0;
+
+	offset += _marshall64(buf + offset, port->guid);
+	offset += _marshall8(buf + offset, (uint8_t) port->portnum);
+	offset += _marshall8(buf + offset, (uint8_t) port->ext_portnum);
+	offset += _marshall16(buf + offset, port->base_lid);
+	offset += _marshall8(buf + offset, port->lmc);
+	offset += _marshall_buf(buf + offset, port->info, IB_SMP_DATA_SIZE);
+	offset += _marshall64(buf + offset, port->node->guid);
+	if (port->remoteport) {
+		offset += _marshall8(buf + offset, 1);
+		offset += _marshall64(buf + offset, port->remoteport->guid);
+		offset += _marshall8(buf + offset, (uint8_t) port->remoteport->portnum);
+	} else {
+		offset += _marshall8(buf + offset, 0);
+		offset += _marshall64(buf + offset, 0);
+		offset += _marshall8(buf + offset, 0);
+	}
+
+	if (ibnd_write(fd, buf, offset) < 0)
+		return -1;
+
+	return 0;
+}
+
+int ibnd_cache_fabric(ibnd_fabric_t * fabric, const char *file,
+		      unsigned int flags)
+{
+	struct stat statbuf;
+	ibnd_node_t *node = NULL;
+	ibnd_node_t *node_next = NULL;
+	unsigned int node_count = 0;
+	ibnd_port_t *port = NULL;
+	ibnd_port_t *port_next = NULL;
+	unsigned int port_count = 0;
+	int fd;
+	int i;
+
+	if (!fabric) {
+		IBND_DEBUG("fabric parameter NULL\n");
+		return -1;
+	}
+
+	if (!file) {
+		IBND_DEBUG("file parameter NULL\n");
+		return -1;
+	}
+
+	if (!(flags & IBND_CACHE_FABRIC_FLAG_NO_OVERWRITE)) {
+		if (!stat(file, &statbuf)) {
+			if (unlink(file) < 0) {
+				IBND_DEBUG("error removing '%s': %s\n",
+					   file, strerror(errno));
+				return -1;
+			}
+		}
+	}
+	else {
+		if (!stat(file, &statbuf)) {
+			IBND_DEBUG("file '%s' already exists\n", file);
+			return -1;
+		}
+	}
+
+	if ((fd = open(file, O_CREAT | O_EXCL | O_WRONLY, 0644)) < 0) {
+		IBND_DEBUG("open: %s\n", strerror(errno));
+		return -1;
+	}
+
+	if (_cache_header_info(fd, fabric) < 0)
+		goto cleanup;
+
+	node = fabric->nodes;
+	while (node) {
+		node_next = node->next;
+
+		if (_cache_node(fd, node) < 0)
+			goto cleanup;
+
+		node_count++;
+		node = node_next;
+	}
+
+	for (i = 0; i < HTSZ; i++) {
+		port = fabric->portstbl[i];
+		while (port) {
+			port_next = port->htnext;
+
+			if (_cache_port(fd, port) < 0)
+				goto cleanup;
+
+			port_count++;
+			port = port_next;
+		}
+	}
+
+	if (_cache_header_counts(fd, node_count, port_count) < 0)
+		goto cleanup;
+
+	if (close(fd) < 0) {
+		IBND_DEBUG("close: %s\n", strerror(errno));
+		goto cleanup;
+	}
+
+	return 0;
+
+cleanup:
+	unlink(file);
+	close(fd);
+	return -1;
+}
diff --git a/libibnetdisc/src/internal.h b/libibnetdisc/src/internal.h
new file mode 100644
index 0000000..80918c4
--- /dev/null
+++ b/libibnetdisc/src/internal.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2008 Lawrence Livermore National Laboratory
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+/** =========================================================================
+ * Define the internal data structures.
+ */
+
+#ifndef _INTERNAL_H_
+#define _INTERNAL_H_
+
+#include <infiniband/ibnetdisc.h>
+#include <complib/cl_qmap.h>
+
+#define	IBND_DEBUG(fmt, ...) \
+	if (ibdebug) { \
+		printf("%s:%u; " fmt, __FILE__, __LINE__, ## __VA_ARGS__); \
+	}
+#define	IBND_ERROR(fmt, ...) \
+		fprintf(stderr, "%s:%u; " fmt, __FILE__, __LINE__, ## __VA_ARGS__)
+
+/* HASH table defines */
+#define HASHGUID(guid) ((uint32_t)(((uint32_t)(guid) * 101) ^ ((uint32_t)((guid) >> 32) * 103)))
+
+#define MAXHOPS         63
+
+#define DEFAULT_MAX_SMP_ON_WIRE 2
+#define DEFAULT_TIMEOUT 1000
+#define DEFAULT_RETRIES 3
+
+typedef struct ibnd_scan {
+	ib_portid_t selfportid;
+	ibnd_fabric_t *fabric;
+	struct ibnd_config *cfg;
+	struct ibmad_port *ibmad_port;
+	unsigned initial_hops;
+} ibnd_scan_t;
+
+typedef struct ibnd_smp ibnd_smp_t;
+typedef struct smp_engine smp_engine_t;
+typedef int (*smp_comp_cb_t) (smp_engine_t * engine, ibnd_smp_t * smp,
+			      uint8_t * mad_resp, void *cb_data);
+struct ibnd_smp {
+	cl_map_item_t on_wire;
+	struct ibnd_smp *qnext;
+	smp_comp_cb_t cb;
+	void *cb_data;
+	ib_portid_t path;
+	ib_rpc_t rpc;
+};
+
+struct smp_engine {
+	int umad_fd;
+	int smi_agent;
+	int smi_dir_agent;
+	ibnd_smp_t *smp_queue_head;
+	ibnd_smp_t *smp_queue_tail;
+	void *user_data;
+	cl_qmap_t smps_on_wire;
+	struct ibnd_config *cfg;
+	unsigned total_smps;
+};
+
+int smp_engine_init(smp_engine_t * engine, char * ca_name, int ca_port,
+		    void *user_data, ibnd_config_t *cfg);
+int issue_smp(smp_engine_t * engine, ib_portid_t * portid,
+	      unsigned attrid, unsigned mod, smp_comp_cb_t cb, void *cb_data);
+int process_mads(smp_engine_t * engine);
+void smp_engine_destroy(smp_engine_t * engine);
+
+void add_to_nodeguid_hash(ibnd_node_t * node, ibnd_node_t * hash[]);
+
+void add_to_portguid_hash(ibnd_port_t * port, ibnd_port_t * hash[]);
+
+void add_to_type_list(ibnd_node_t * node, ibnd_fabric_t * fabric);
+
+void destroy_node(ibnd_node_t * node);
+
+#endif				/* _INTERNAL_H_ */
diff --git a/libibnetdisc/src/libibnetdisc.map b/libibnetdisc/src/libibnetdisc.map
new file mode 100644
index 0000000..1c42e7b
--- /dev/null
+++ b/libibnetdisc/src/libibnetdisc.map
@@ -0,0 +1,21 @@
+IBNETDISC_1.0 {
+	global:
+		ibnd_discover_fabric;
+		ibnd_destroy_fabric;
+		ibnd_load_fabric;
+		ibnd_cache_fabric;
+		ibnd_find_node_guid;
+		ibnd_find_node_dr;
+		ibnd_is_xsigo_guid;
+		ibnd_is_xsigo_tca;
+		ibnd_is_xsigo_hca;
+		ibnd_get_chassis_guid;
+		ibnd_get_chassis_type;
+		ibnd_get_chassis_slot_str;
+		ibnd_iter_nodes;
+		ibnd_iter_nodes_type;
+		ibnd_find_port_guid;
+		ibnd_find_port_dr;
+		ibnd_iter_ports;
+	local: *;
+};
diff --git a/libibnetdisc/src/query_smp.c b/libibnetdisc/src/query_smp.c
new file mode 100644
index 0000000..28620b4
--- /dev/null
+++ b/libibnetdisc/src/query_smp.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2010 Lawrence Livermore National Laboratory
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#include <errno.h>
+#include <infiniband/ibnetdisc.h>
+#include <infiniband/umad.h>
+#include "internal.h"
+
+extern int mlnx_ext_port_info_err(smp_engine_t * engine, ibnd_smp_t * smp,
+				  uint8_t * mad, void *cb_data);
+
+static void queue_smp(smp_engine_t * engine, ibnd_smp_t * smp)
+{
+	smp->qnext = NULL;
+	if (!engine->smp_queue_head) {
+		engine->smp_queue_head = smp;
+		engine->smp_queue_tail = smp;
+	} else {
+		engine->smp_queue_tail->qnext = smp;
+		engine->smp_queue_tail = smp;
+	}
+}
+
+static ibnd_smp_t *get_smp(smp_engine_t * engine)
+{
+	ibnd_smp_t *head = engine->smp_queue_head;
+	ibnd_smp_t *tail = engine->smp_queue_tail;
+	ibnd_smp_t *rc = head;
+	if (head) {
+		if (tail == head)
+			engine->smp_queue_tail = NULL;
+		engine->smp_queue_head = head->qnext;
+	}
+	return rc;
+}
+
+static int send_smp(ibnd_smp_t * smp, smp_engine_t * engine)
+{
+	int rc = 0;
+	uint8_t umad[1024];
+	ib_rpc_t *rpc = &smp->rpc;
+	int agent = 0;
+
+	memset(umad, 0, umad_size() + IB_MAD_SIZE);
+
+	if (rpc->mgtclass == IB_SMI_CLASS) {
+		agent = engine->smi_agent;
+	} else if (rpc->mgtclass == IB_SMI_DIRECT_CLASS) {
+		agent = engine->smi_dir_agent;
+	} else {
+		IBND_ERROR("Invalid class for RPC\n");
+		return (-EIO);
+	}
+
+	if ((rc = mad_build_pkt(umad, &smp->rpc, &smp->path, NULL, NULL))
+	    < 0) {
+		IBND_ERROR("mad_build_pkt failed; %d\n", rc);
+		return rc;
+	}
+
+	if ((rc = umad_send(engine->umad_fd, agent, umad, IB_MAD_SIZE,
+			    engine->cfg->timeout_ms, engine->cfg->retries)) < 0) {
+		IBND_ERROR("send failed; %d\n", rc);
+		return rc;
+	}
+
+	return 0;
+}
+
+static int process_smp_queue(smp_engine_t * engine)
+{
+	int rc = 0;
+	ibnd_smp_t *smp;
+	while (cl_qmap_count(&engine->smps_on_wire)
+	       < engine->cfg->max_smps) {
+		smp = get_smp(engine);
+		if (!smp)
+			return 0;
+
+		if ((rc = send_smp(smp, engine)) != 0) {
+			free(smp);
+			return rc;
+		}
+		cl_qmap_insert(&engine->smps_on_wire, (uint32_t) smp->rpc.trid,
+			       (cl_map_item_t *) smp);
+		engine->total_smps++;
+	}
+	return 0;
+}
+
+int issue_smp(smp_engine_t * engine, ib_portid_t * portid,
+	      unsigned attrid, unsigned mod, smp_comp_cb_t cb, void *cb_data)
+{
+	ibnd_smp_t *smp = calloc(1, sizeof *smp);
+	if (!smp) {
+		IBND_ERROR("OOM\n");
+		return -ENOMEM;
+	}
+
+	smp->cb = cb;
+	smp->cb_data = cb_data;
+	smp->path = *portid;
+	smp->rpc.method = IB_MAD_METHOD_GET;
+	smp->rpc.attr.id = attrid;
+	smp->rpc.attr.mod = mod;
+	smp->rpc.timeout = engine->cfg->timeout_ms;
+	smp->rpc.datasz = IB_SMP_DATA_SIZE;
+	smp->rpc.dataoffs = IB_SMP_DATA_OFFS;
+	smp->rpc.trid = mad_trid();
+	smp->rpc.mkey = engine->cfg->mkey;
+
+	if (portid->lid <= 0 || portid->drpath.drslid == 0xffff ||
+	    portid->drpath.drdlid == 0xffff)
+		smp->rpc.mgtclass = IB_SMI_DIRECT_CLASS;	/* direct SMI */
+	else
+		smp->rpc.mgtclass = IB_SMI_CLASS;	/* Lid routed SMI */
+
+	portid->sl = 0;
+	portid->qp = 0;
+
+	queue_smp(engine, smp);
+	return process_smp_queue(engine);
+}
+
+static int process_one_recv(smp_engine_t * engine)
+{
+	int rc = 0;
+	int status = 0;
+	ibnd_smp_t *smp;
+	uint8_t *mad;
+	uint32_t trid;
+	uint8_t umad[sizeof(struct ib_user_mad) + IB_MAD_SIZE];
+	int length = umad_size() + IB_MAD_SIZE;
+
+	memset(umad, 0, sizeof(umad));
+
+	/* wait for the next message */
+	if ((rc = umad_recv(engine->umad_fd, umad, &length,
+			    0)) < 0) {
+		if (rc == -EWOULDBLOCK)
+			return 0;
+		IBND_ERROR("umad_recv failed: %d\n", rc);
+		return -1;
+	}
+
+	mad = umad_get_mad(umad);
+	trid = (uint32_t) mad_get_field64(mad, 0, IB_MAD_TRID_F);
+
+	smp = (ibnd_smp_t *) cl_qmap_remove(&engine->smps_on_wire, trid);
+	if ((cl_map_item_t *) smp == cl_qmap_end(&engine->smps_on_wire)) {
+		IBND_ERROR("Failed to find matching smp for trid (%x)\n", trid);
+		return -1;
+	}
+
+	rc = process_smp_queue(engine);
+	if (rc)
+		goto error;
+
+	if ((status = umad_status(umad))) {
+		IBND_ERROR("umad (%s Attr 0x%x:%u) bad status %d; %s\n",
+			   portid2str(&smp->path), smp->rpc.attr.id,
+			   smp->rpc.attr.mod, status, strerror(status));
+		if (smp->rpc.attr.id == IB_ATTR_MLNX_EXT_PORT_INFO)
+			rc = mlnx_ext_port_info_err(engine, smp, mad,
+						    smp->cb_data);
+	} else if ((status = mad_get_field(mad, 0, IB_DRSMP_STATUS_F))) {
+		IBND_ERROR("mad (%s Attr 0x%x:%u) bad status 0x%x\n",
+			   portid2str(&smp->path), smp->rpc.attr.id,
+			   smp->rpc.attr.mod, status);
+		if (smp->rpc.attr.id == IB_ATTR_MLNX_EXT_PORT_INFO)
+			rc = mlnx_ext_port_info_err(engine, smp, mad,
+						    smp->cb_data);
+	} else
+		rc = smp->cb(engine, smp, mad, smp->cb_data);
+
+error:
+	free(smp);
+	return rc;
+}
+
+int smp_engine_init(smp_engine_t * engine, char * ca_name, int ca_port,
+		    void *user_data, ibnd_config_t *cfg)
+{
+	memset(engine, 0, sizeof(*engine));
+
+	if (umad_init() < 0) {
+		IBND_ERROR("umad_init failed\n");
+		return -EIO;
+	}
+
+	engine->umad_fd = umad_open_port(ca_name, ca_port);
+	if (engine->umad_fd < 0) {
+		IBND_ERROR("can't open UMAD port (%s:%d)\n", ca_name, ca_port);
+		return -EIO;
+	}
+
+	if ((engine->smi_agent = umad_register(engine->umad_fd,
+	     IB_SMI_CLASS, 1, 0, 0)) < 0) {
+		IBND_ERROR("Failed to register SMI agent on (%s:%d)\n",
+			   ca_name, ca_port);
+		goto eio_close;
+	}
+
+	if ((engine->smi_dir_agent = umad_register(engine->umad_fd,
+	     IB_SMI_DIRECT_CLASS, 1, 0, 0)) < 0) {
+		IBND_ERROR("Failed to register SMI_DIRECT agent on (%s:%d)\n",
+			   ca_name, ca_port);
+		goto eio_close;
+	}
+
+	engine->user_data = user_data;
+	cl_qmap_init(&engine->smps_on_wire);
+	engine->cfg = cfg;
+	return (0);
+
+eio_close:
+	umad_close_port(engine->umad_fd);
+	return (-EIO);
+}
+
+void smp_engine_destroy(smp_engine_t * engine)
+{
+	cl_map_item_t *item;
+	ibnd_smp_t *smp;
+
+	/* remove queued smps */
+	smp = get_smp(engine);
+	if (smp)
+		IBND_ERROR("outstanding SMP's\n");
+	for ( /* */ ; smp; smp = get_smp(engine))
+		free(smp);
+
+	/* remove smps from the wire queue */
+	item = cl_qmap_head(&engine->smps_on_wire);
+	if (item != cl_qmap_end(&engine->smps_on_wire))
+		IBND_ERROR("outstanding SMP's on wire\n");
+	for ( /* */ ; item != cl_qmap_end(&engine->smps_on_wire);
+	     item = cl_qmap_head(&engine->smps_on_wire)) {
+		cl_qmap_remove_item(&engine->smps_on_wire, item);
+		free(item);
+	}
+
+	umad_close_port(engine->umad_fd);
+}
+
+int process_mads(smp_engine_t * engine)
+{
+	int rc;
+	while (!cl_is_qmap_empty(&engine->smps_on_wire))
+		if ((rc = process_one_recv(engine)) != 0)
+			return rc;
+	return 0;
+}
diff --git a/libibnetdisc/test/testleaks.c b/libibnetdisc/test/testleaks.c
new file mode 100644
index 0000000..9a91f50
--- /dev/null
+++ b/libibnetdisc/test/testleaks.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2004-2007 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <time.h>
+#include <string.h>
+#include <getopt.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#include <infiniband/complib/cl_nodenamemap.h>
+#include <infiniband/ibnetdisc.h>
+
+char *argv0 = "iblinkinfotest";
+static FILE *f;
+
+void usage(void)
+{
+	fprintf(stderr,
+		"Usage: %s [-hclp -S <guid> -D <direct route> -C <ca_name> -P <ca_port>]\n"
+		"   Report link speed and connection for each port of each switch which is active\n"
+		"   -h This help message\n"
+		"   -i <iters> Number of iterations to run (default -1 == infinate)\n"
+		"   -S <guid> output only the node specified by guid\n"
+		"   -D <direct route> print only node specified by <direct route>\n"
+		"   -f <dr_path> specify node to start \"from\"\n"
+		"   -n <hops> Number of hops to include away from specified node\n"
+		"   -t <timeout_ms> timeout for any single fabric query\n"
+		"   -s show errors\n"
+		"   -C <ca_name> use selected Channel Adaptor name for queries\n"
+		"   -P <ca_port> use selected channel adaptor port for queries\n"
+		"   --debug print debug messages\n", argv0);
+	exit(-1);
+}
+
+int main(int argc, char **argv)
+{
+	struct ibnd_config config = { 0 };
+	int rc = 0;
+	char *ca = 0;
+	int ca_port = 0;
+	ibnd_fabric_t *fabric = NULL;
+	uint64_t guid = 0;
+	char *dr_path = NULL;
+	char *from = NULL;
+	ib_portid_t port_id;
+	int iters = -1;
+
+	static char const str_opts[] = "S:D:n:C:P:t:shuf:i:";
+	static const struct option long_opts[] = {
+		{"S", 1, 0, 'S'},
+		{"D", 1, 0, 'D'},
+		{"num-hops", 1, 0, 'n'},
+		{"ca-name", 1, 0, 'C'},
+		{"ca-port", 1, 0, 'P'},
+		{"timeout", 1, 0, 't'},
+		{"show", 0, 0, 's'},
+		{"help", 0, 0, 'h'},
+		{"usage", 0, 0, 'u'},
+		{"debug", 0, 0, 2},
+		{"from", 1, 0, 'f'},
+		{"iters", 1, 0, 'i'},
+		{}
+	};
+
+	f = stdout;
+
+	argv0 = argv[0];
+
+	while (1) {
+		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
+		if (ch == -1)
+			break;
+		switch (ch) {
+		case 2:
+			config.debug++;
+			break;
+		case 'f':
+			from = strdup(optarg);
+			break;
+		case 'C':
+			ca = strdup(optarg);
+			break;
+		case 'P':
+			ca_port = strtoul(optarg, 0, 0);
+			break;
+		case 'D':
+			dr_path = strdup(optarg);
+			break;
+		case 'n':
+			config.max_hops = strtoul(optarg, NULL, 0);
+			break;
+		case 'i':
+			iters = (int)strtol(optarg, NULL, 0);
+			break;
+		case 't':
+			config.timeout_ms = strtoul(optarg, 0, 0);
+			break;
+		case 'S':
+			guid = (uint64_t) strtoull(optarg, 0, 0);
+			break;
+		default:
+			usage();
+			break;
+		}
+	}
+	argc -= optind;
+	argv += optind;
+
+	while (iters == -1 || iters-- > 0) {
+		if (from) {
+			/* only scan part of the fabric */
+			str2drpath(&(port_id.drpath), from, 0, 0);
+			if ((fabric = ibnd_discover_fabric(ca, ca_port,
+							   &port_id, &config))
+			    == NULL) {
+				fprintf(stderr, "discover failed\n");
+				rc = 1;
+				goto close_port;
+			}
+			guid = 0;
+		} else if ((fabric = ibnd_discover_fabric(ca, ca_port, NULL,
+							  &config)) == NULL) {
+			fprintf(stderr, "discover failed\n");
+			rc = 1;
+			goto close_port;
+		}
+
+		ibnd_destroy_fabric(fabric);
+	}
+
+close_port:
+	exit(rc);
+}
diff --git a/man/check_lft_balance.8 b/man/check_lft_balance.8
deleted file mode 100644
index 3eeca0d..0000000
--- a/man/check_lft_balance.8
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH CHECK_LFT_BALANCE.SH 8 "March 1, 2008" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-check_lft_balance.sh \- check InfiniBand unicast forwarding tables balance
-
-.SH SYNOPSIS
-.B check_lft_balance.sh
-[-hRv]
-
-
-.SH DESCRIPTION
-.PP
-check_lft_balance.sh is a script which checks for balancing in Infiniband
-unicast forwarding tables.  It analyzes the output of
-.BR dump_lfts(8)
-and
-.BR iblinkinfo(8).
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-h\fR
-show help
-.TP
-\fB\-R\fR
-Recalculate dump_lfts information, ie do not use the cached
-information.  This option is slower but should be used if the diag tools have
-not been used for some time or if there are other reasons to believe that
-the fabric has changed.
-.TP
-\fB\-v\fR
-verbose output
-
-.SH SEE ALSO
-.BR dump_lfts(8),
-.BR iblinkinfo(8)
-
-.SH AUTHORS
-.TP
-Albert Chu
-.RI < chu11 at llnl.gov >
diff --git a/man/dump_lfts.8 b/man/dump_lfts.8
deleted file mode 100644
index 4498260..0000000
--- a/man/dump_lfts.8
+++ /dev/null
@@ -1,50 +0,0 @@
-.TH DUMP_LFTS.SH 8 "May 21, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-dump_lfts.sh \- dump InfiniBand unicast forwarding tables
-
-.SH SYNOPSIS
-.B dump_lfts.sh
-[\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [>/path/to/dump-file]
-
-
-.SH DESCRIPTION
-.PP
-dump_lfts.sh is a script which dumps the InfiniBand unciast forwarding
-tables (MFTs) in the switch nodes in the subnet.
-
-The dump file format is compatible with loading into OpenSM using
-the -R file -U /path/to/dump-file syntax.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-D\fR
-dump forwarding tables using direct routed rather than LID routed SMPs
-.TP
-\fB\-h\fR
-show help
-.TP
-\fB\-C\fR <ca_name>
-use the specified ca_name.
-.TP
-\fB\-P\fR <ca_port>
-use the specified ca_port.
-.TP
-\fB\-t\fR <timeout_ms>
-override the default timeout for the solicited mads.
-
-.SH SEE ALSO
-.BR dump_mfts(8),
-.BR ibroute(8),
-.BR ibswitches(8),
-.BR opensm(8)
-
-.SH AUTHORS
-.TP
-Sasha Khapyorsky
-.RI < sashak at voltaire.com >
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/dump_mfts.8 b/man/dump_mfts.8
deleted file mode 100644
index 885301e..0000000
--- a/man/dump_mfts.8
+++ /dev/null
@@ -1,45 +0,0 @@
-.TH DUMP_MFTS.SH 8 "May 21, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-dump_lfts.sh \- dump InfiniBand multicast forwarding tables
-
-.SH SYNOPSIS
-.B dump_mfts.sh
-[\-h] [\-D] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms]
-[>/path/to/file]
-
-.SH DESCRIPTION
-.PP
-dump_mfts.sh is a script which dumps the InfiniBand multicast
-forwarding tables (MFTs) in the switch nodes in the subnet.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-D\fR
-dump forwarding tables using direct routed rather than LID routed SMPs
-.TP
-\fB\-h\fR
-show help
-.TP
-\fB\-C\fR <ca_name>
-use the specified ca_name.
-.TP
-\fB\-P\fR <ca_port>
-use the specified ca_port.
-.TP
-\fB\-t\fR <timeout_ms>
-override the default timeout for the solicited mads.
-
-
-.SH SEE ALSO
-.BR dump_lfts(8),
-.BR ibroute(8),
-.BR ibswitches(8),
-.BR opensm(8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibaddr.8 b/man/ibaddr.8
deleted file mode 100644
index 622c6f9..0000000
--- a/man/ibaddr.8
+++ /dev/null
@@ -1,109 +0,0 @@
-.TH IBADDR 8 "June 18, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibaddr \- query InfiniBand address(es)
-
-.SH SYNOPSIS
-.B ibaddr
-[\-d(ebug)] [\-D(irect)] [\-G(uid)] [\-l(id_show)] [\-g(id_show)] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-h(elp)] [<lid | dr_path | guid>]
-
-.SH DESCRIPTION
-.PP
-Display the lid (and range) as well as the GID address of the
-port specified (by DR path, lid, or GUID) or the local port by default.
-.PP
-Note: this utility can be used as simple address resolver.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-G\fR, \fB\-\-Guid\fR
-show lid range and gid for GUID address
-.TP
-\fB\-l\fR, \fB\-\-lid_show\fR
-show lid range only
-.TP
-\fB\-L\fR, \fB\-\-Lid_show\fR
-show lid range (in decimal) only
-.TP
-\fB\-g\fR, \fB\-\-gid_show\fR
-show gid address only
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-ibaddr                  # local port\'s address
-.PP
-ibaddr 32               # show lid range and gid of lid 32
-.PP
-ibaddr -G 0x8f1040023   # same but using guid address
-.PP
-ibaddr -l 32            # show lid range only
-.PP
-ibaddr -L 32            # show decimal lid range only
-.PP
-ibaddr -g 32            # show gid address only
-
-.SH SEE ALSO
-.BR ibroute (8),
-.BR ibtracert (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibcheckportwidth.8 b/man/ibcheckportwidth.8
index 85c06fc..c368467 100644
--- a/man/ibcheckportwidth.8
+++ b/man/ibcheckportwidth.8
@@ -4,7 +4,7 @@
 ibcheckportwidth \- validate IB port for 1x link width
 
 .SH SYNOPSIS
-.B ibcheckport
+.B ibcheckportwidth
 [\-h] [\-v] [\-N | \-nocolor] [\-G] [\-C ca_name] [\-P ca_port]
 [\-t(imeout) timeout_ms]  <lid|guid> <port>
 
diff --git a/man/ibdatacounters.8 b/man/ibdatacounters.8
index 60fec8f..cc1a622 100644
--- a/man/ibdatacounters.8
+++ b/man/ibdatacounters.8
@@ -5,7 +5,8 @@ ibdatacounters \- query IB subnet for data counters
 
 .SH SYNOPSIS
 .B ibdatacounters
-[\-h] [\-b] [\-v] [\-N | \-nocolor] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
+[\-h] [\-b] [\-v] [\-N | \-nocolor] [<topology-file> | \-C ca_name \-P ca_port
+\-t(imeout) timeout_ms]
 
 .SH DESCRIPTION
 .PP
diff --git a/man/ibfindnodesusing.8 b/man/ibfindnodesusing.8
deleted file mode 100644
index d5e3e68..0000000
--- a/man/ibfindnodesusing.8
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH IBFINDNODESUSING 8 "May 22, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibfindnodesusing.pl \- find a list of end nodes which are routed through the specified switch and port
-
-.SH SYNOPSIS
-.B ibfindnodesusing.pl
-[-R] <switch_guid|switch_name> <port>
-
-.SH DESCRIPTION
-.PP
-ibfindnodesusing.pl uses ibroute and detects the current nodes which are routed
-through both directions of the link specified.  The link is specified by one
-switch port end; the script finds the remote end automatically.
-
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-R\fR
-Recalculate the ibnetdiscover information, ie do not use the cached
-information.  This option is slower but should be used if the diag tools have
-not been used for some time or if there are other reasons to believe that
-the fabric has changed.
-
-.SH AUTHOR
-.TP
-Ira Weiny
-.RI < weiny2 at llnl.gov >
diff --git a/man/ibhosts.8 b/man/ibhosts.8
deleted file mode 100644
index db3c8ce..0000000
--- a/man/ibhosts.8
+++ /dev/null
@@ -1,31 +0,0 @@
-.TH IBHOSTS 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibhosts \- show InfiniBand host nodes in topology
-
-.SH SYNOPSIS
-.B ibhosts
-[\-h] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
-
-.SH DESCRIPTION
-.PP
-ibhosts is a script which either walks the IB subnet topology or uses an
-already saved topology file and extracts the CA nodes.
-
-.SH OPTIONS
-.PP
-\-h      show the usage message
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-.SH SEE ALSO
-.BR ibnetdiscover(8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibidsverify.8 b/man/ibidsverify.8
deleted file mode 100644
index f42fd44..0000000
--- a/man/ibidsverify.8
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH IBIDSVERIFY 8 "June 1, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibidsverify.pl \- validate IB identifiers in subnet and report errors
-
-.SH SYNOPSIS
-.B ibidsverify.pl
-[\-h] [\-R]
-
-.SH DESCRIPTION
-.PP
-ibidsverify.pl is a perl script which uses a full topology file that was created
-by ibnetdiscover, scans the network to validate the LIDs and GUIDs in the
-subnet. The validation consists of checking that there are no zero or duplicate
-identifiers.
-
-Finally, ibidsverify.pl will also reuse the cached ibnetdiscover output from
-some of the other diag tools which makes it a bit faster than running
-ibnetdiscover from scratch.
-
-.SH OPTIONS
-.PP
-.TP
-\fB\-R\fR
-Recalculate the ibnetdiscover information, ie do not use the cached
-information.  This option is slower but should be used if the diag tools have
-not been used for some time or if there are other reasons to believe the
-fabric has changed.
-
-.SH SEE ALSO
-.BR ibnetdiscover(8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/iblinkinfo.8 b/man/iblinkinfo.8
deleted file mode 100644
index ebb0394..0000000
--- a/man/iblinkinfo.8
+++ /dev/null
@@ -1,52 +0,0 @@
-.TH IBLINKINFO 8 "Jan 24, 2008" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-iblinkinfo.pl \- report link info for all links in the fabric
-
-.SH SYNOPSIS
-.B iblinkinfo.pl
-   [-Rhcdl -C <ca_name> -P <ca_port> -v <lt,hoq,vlstall> -S <guid> -D <direct_route>]
-
-.SH DESCRIPTION
-.PP
-iblinkinfo.pl reports the link info for each port of each switch active in the
-IB fabric.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-R\fR
-Recalculate the ibnetdiscover information, ie do not use the cached
-information.  This option is slower but should be used if the diag tools have
-not been used for some time or if there are other reasons to believe the
-fabric has changed.
-.TP
-\fB\-S <guid>\fR
-Output only the switch specified by <guid> (hex format)
-.TP
-\fB\-D <direct_route>\fR
-Output only the switch specified by the direct route path.
-.TP
-\fB\-l\fR
-Print all information for each link on one line. Default is to print a header
-with the switch information and then a list for each port (useful for grep\'ing output).
-.TP
-\fB\-d\fR
-Print only switches which have a port in the "Down" state.
-.TP
-\fB\-v <lt,hoq,vlstall>\fR
-Verify additional switch settings (<LifeTime>,<HoqLife>,<VLStallCount>)
-.TP
-\fB\-c\fR
-Print port capabilities (enabled and supported values)
-.TP
-\fB\-C <ca_name>\fR    use the specified ca_name for the search.
-.TP
-\fB\-P <ca_port>\fR    use the specified ca_port for the search.
-
-
-.SH AUTHOR
-.TP
-Ira Weiny
-.RI < weiny2 at llnl.gov >
diff --git a/man/ibnetdiscover.8 b/man/ibnetdiscover.8
deleted file mode 100644
index 958efa9..0000000
--- a/man/ibnetdiscover.8
+++ /dev/null
@@ -1,233 +0,0 @@
-.TH IBNETDISCOVER 8 "January 3, 2008" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibnetdiscover \- discover InfiniBand topology
-
-.SH SYNOPSIS
-.B ibnetdiscover
-[\-d(ebug)] [\-e(rr_show)] [\-v(erbose)] [\-s(how)] [\-l(ist)] [\-g(rouping)] [\-H(ca_list)] [\-S(witch_list)] [\-R(outer_list)] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\--node-name-map <node-name-map>] [\-p(orts)] [\-h(elp)] [<topology-file>]
-
-.SH DESCRIPTION
-.PP
-ibnetdiscover performs IB subnet discovery and outputs a human readable
-topology file. GUIDs, node types, and port numbers are displayed
-as well as port LIDs and NodeDescriptions.  All nodes (and links) are displayed
-(full topology).  Optionally, this utility can be used to list the current
-connected nodes by nodetype.  The output is printed to standard output
-unless a topology file is specified.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-l\fR, \fB\-\-list\fR
-List of connected nodes
-.TP
-\fB\-g\fR, \fB\-\-grouping\fR
-Show grouping.  Grouping correlates IB nodes by different vendor specific
-schemes.  It may also show the switch external ports correspondence.
-.TP
-\fB\-H\fR, \fB\-\-Hca_list\fR
-List of connected CAs
-.TP
-\fB\-S\fR, \fB\-\-Switch_list\fR
-List of connected switches
-.TP
-\fB\-R\fR, \fB\-\-Router_list\fR
-List of connected routers
-.TP
-\fB\-s\fR, \fB\-\-show\fR
-Show more information
-.TP
-\fB\-\-node\-name\-map\fR <node-name-map>
-Specify a node name map.  The node name map file maps GUIDs to more user friendly
-names.  See file format below.
-.TP
-\fB\-p\fR, \fB\-\-ports\fR
-Obtain a ports report which is a
-list of connected ports with relevant information (like LID, portnum,
-GUID, width, speed, and NodeDescription).
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH TOPOLOGY FILE FORMAT
-The topology file format is human readable and largely intuitive.
-Most identifiers are given textual names like vendor ID (vendid), device ID
-(device ID), GUIDs of various types (sysimgguid, caguid, switchguid, etc.).
-PortGUIDs are shown in parentheses ().  For switches, this is shown on the
-switchguid line.  For CA and router ports, it is shown on the connectivity lines.  The IB node is identified followed by the number of ports and a quoted
-the node GUID.  On the right of this line is a comment (#) followed by the
-NodeDescription in quotes.  If the node is a switch, this line also contains
-whether switch port 0 is base or enhanced, and the LID and LMC of port 0.
-Subsequent lines pertaining to this node show the connectivity.   On the
-left is the port number of the current node.  On the right is the peer node
-(node at other end of link). It is identified in quotes with nodetype
-followed by - followed by NodeGUID with the port number in square brackets.
-Further on the right is a comment (#).  What follows the comment is
-dependent on the node type.  If it it a switch node, it is followed by
-the NodeDescription in quotes and the LID of the peer node.  If it is a
-CA or router node, it is followed by the local LID and LMC and then
-followed by the NodeDescription in quotes and the LID of the peer node.
-The active link width and speed are then appended to the end of this
-output line.
-
-An example of this is:
-.nf
-#
-# Topology file: generated on Tue Jun  5 14:15:10 2007
-#
-# Max of 3 hops discovered
-# Initiated from node 0008f10403960558 port 0008f10403960559
-
-Non-Chassis Nodes
-
-vendid=0x8f1
-devid=0x5a06
-sysimgguid=0x5442ba00003000
-switchguid=0x5442ba00003080(5442ba00003080)
-Switch  24 "S-005442ba00003080"         # "ISR9024 Voltaire" base port 0 lid 6 lmc 0
-[22]    "H-0008f10403961354"[1](8f10403961355)         # "MT23108 InfiniHost Mellanox Technologies" lid 4 4xSDR
-[10]    "S-0008f10400410015"[1]         # "SW-6IB4 Voltaire" lid 3 4xSDR
-[8]     "H-0008f10403960558"[2](8f1040396055a)         # "MT23108 InfiniHost Mellanox Technologies" lid 14 4xSDR
-[6]     "S-0008f10400410015"[3]         # "SW-6IB4 Voltaire" lid 3 4xSDR
-[12]    "H-0008f10403960558"[1](8f10403960559)         # "MT23108 InfiniHost Mellanox Technologies" lid 10 4xSDR
-
-vendid=0x8f1
-devid=0x5a05
-switchguid=0x8f10400410015(8f10400410015)
-Switch  8 "S-0008f10400410015"          # "SW-6IB4 Voltaire" base port 0 lid 3 lmc 0
-[6]     "H-0008f10403960984"[1](8f10403960985)         # "MT23108 InfiniHost Mellanox Technologies" lid 16 4xSDR
-[4]     "H-005442b100004900"[1](5442b100004901)        # "MT23108 InfiniHost Mellanox Technologies" lid 12 4xSDR
-[1]     "S-005442ba00003080"[10]                # "ISR9024 Voltaire" lid 6 1xSDR
-[3]     "S-005442ba00003080"[6]         # "ISR9024 Voltaire" lid 6 4xSDR
-
-vendid=0x2c9
-devid=0x5a44
-caguid=0x8f10403960984
-Ca      2 "H-0008f10403960984"          # "MT23108 InfiniHost Mellanox Technologies"
-[1](8f10403960985)     "S-0008f10400410015"[6]         # lid 16 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
-
-vendid=0x2c9
-devid=0x5a44
-caguid=0x5442b100004900
-Ca      2 "H-005442b100004900"          # "MT23108 InfiniHost Mellanox Technologies"
-[1](5442b100004901)     "S-0008f10400410015"[4]         # lid 12 lmc 1 "SW-6IB4 Voltaire" lid 3 4xSDR
-
-vendid=0x2c9
-devid=0x5a44
-caguid=0x8f10403961354
-Ca      2 "H-0008f10403961354"          # "MT23108 InfiniHost Mellanox Technologies"
-[1](8f10403961355)     "S-005442ba00003080"[22]                # lid 4 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
-
-vendid=0x2c9
-devid=0x5a44
-caguid=0x8f10403960558
-Ca      2 "H-0008f10403960558"          # "MT23108 InfiniHost Mellanox Technologies"
-[2](8f1040396055a)     "S-005442ba00003080"[8]         # lid 14 lmc 1 "ISR9024 Voltaire" lid 6 4xSDR
-[1](8f10403960559)     "S-005442ba00003080"[12]                # lid 10 lmc 1 "ISR9024 Voltaire" lid 6 1xSDR
-.fi
-
-When grouping is used, IB nodes are organized into chasses which are
-numbered. Nodes which cannot be determined to be in a chassis are
-displayed as "Non-Chassis Nodes".  External ports are also shown on the
-connectivity lines.
-
-
-.SH NODE NAME MAP FILE FORMAT
-The node name map is used to specify user friendly names for nodes in the
-output.  GUIDs are used to perform the lookup.
-
-.TP
-\fBGenerically:\fR
-
-# comment
-.br
-<guid> "<name>"
-
-.TP
-\fBExample:\fR
-
-# IB1
-.br
-# Line cards
-.br
-0x0008f104003f125c "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB-24D"
-.br
-0x0008f104003f125d "IB1 (Rack 11 slot 1   ) ISR9288/ISR9096 Voltaire sLB-24D"
-.br
-0x0008f104003f10d2 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB-24D"
-.br
-0x0008f104003f10d3 "IB1 (Rack 11 slot 2   ) ISR9288/ISR9096 Voltaire sLB-24D"
-.br
-0x0008f104003f10bf "IB1 (Rack 11 slot 12  ) ISR9288/ISR9096 Voltaire sLB-24D"
-.br
-.br
-# Spines
-.br
-0x0008f10400400e2d "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB-12D"
-.br
-0x0008f10400400e2e "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB-12D"
-.br
-0x0008f10400400e2f "IB1 (Rack 11 spine 1   ) ISR9288 Voltaire sFB-12D"
-.br
-0x0008f10400400e31 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB-12D"
-.br
-0x0008f10400400e32 "IB1 (Rack 11 spine 2   ) ISR9288 Voltaire sFB-12D"
-.br
-.br
-# GUID   Node Name
-.br
-0x0008f10400411a08 "SW1  (Rack  3) ISR9024 Voltaire 9024D"
-.br
-0x0008f10400411a28 "SW2  (Rack  3) ISR9024 Voltaire 9024D"
-.br
-0x0008f10400411a34 "SW3  (Rack  3) ISR9024 Voltaire 9024D"
-.br
-0x0008f104004119d0 "SW4  (Rack  3) ISR9024 Voltaire 9024D"
-.br
-
-.SH AUTHORS
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
-.TP
-Ira Weiny
-.RI < weiny2 at llnl.gov >
diff --git a/man/ibnodes.8 b/man/ibnodes.8
deleted file mode 100644
index 901665d..0000000
--- a/man/ibnodes.8
+++ /dev/null
@@ -1,31 +0,0 @@
-.TH IBNODES 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibnodes \- show InfiniBand nodes in topology
-
-.SH SYNOPSIS
-.B ibnodes
-[\-h] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
-
-.SH DESCRIPTION
-.PP
-ibnodes is a script which either walks the IB subnet topology or uses an
-already saved topology file and extracts the IB nodes (CAs and switches).
-
-.SH OPTIONS
-.PP
-\-h      show the usage message
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-.SH SEE ALSO
-
-.BR ibnetdiscover(8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibping.8 b/man/ibping.8
deleted file mode 100644
index c25fc8d..0000000
--- a/man/ibping.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH IBPING 8 "August 11, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibping \- ping an InfiniBand address
-
-.SH SYNOPSIS
-.B ibping
-[\-d(ebug)] [\-e(rr_show)] [\-v(erbose)] [\-G(uid)] [\-C ca_name] [\-P ca_port] [\-s smlid] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-c ping_count] [\-f(lood)] [\-o oui] [\-S(erver)] [\-h(elp)] <dest lid | guid>
-
-.SH DESCRIPTION
-.PP
-ibping uses vendor mads to validate connectivity between IB nodes.
-On exit, (IP) ping like output is show. ibping is run as client/server.
-Default is to run as client. Note also that a default ping server is
-implemented within the kernel.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-c\fR
-stop after count packets
-.TP
-\fB\-f\fR, \fB\-\-flood\fR
-flood destination: send packets back to back without delay
-.TP
-\fB\-o\fR, \fB\-\-oui\fR
-use specified OUI number to multiplex vendor mads
-.TP
-\fB\-S\fR, \fB\-\-Server\fR
-start in server mode (do not return)
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibportstate.8 b/man/ibportstate.8
deleted file mode 100644
index 0306f29..0000000
--- a/man/ibportstate.8
+++ /dev/null
@@ -1,113 +0,0 @@
-.TH IBPORTSTATE 8 "October 19, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibportstate \- handle port (physical) state and link speed of an InfiniBand port
-
-.SH SYNOPSIS
-.B ibportstate
-[\-d(ebug)] [\-e(rr_show)] [\-v(erbose)] [\-D(irect)] [\-G(uid)] [\-s smlid] [\-V(ersion)] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-h(elp)] <dest dr_path|lid|guid> <portnum> [<op>]
-
-.SH DESCRIPTION
-.PP
-ibportstate allows the port state and port physical state of an IB port
-to be queried (in addition to link width and speed being validated
-relative to the peer port when the port queried is a switch port),
-or a switch port to be disabled, enabled, or reset. It
-also allows the link speed enabled on any IB port to be adjusted.
-
-.SH OPTIONS
-
-.PP
-.TP
-op
-Port operations allowed
- supported ops: enable, disable, reset, speed, query
- Default is query
-.PP
- ops enable, disable, and reset are only allowed on switch ports
- (An error is indicated if attempted on CA or router ports)
- speed op is allowed on any port
- speed values are legal values for PortInfo:LinkSpeedEnabled
- (An error is indicated if PortInfo:LinkSpeedSupported does not support
-  this setting)
- (NOTE: Speed changes are not effected until the port goes through
-  link renegotiation)
- query also validates port characteristics (link width and speed)
-  based on the peer port. This checking is done when the port
-  queried is a switch port as it relies on combined routing
-  (an initial LID route with directed routing to the peer) which
-  can only be done on a switch. This peer port validation feature
-  of query op requires LID routing to be functioning in the subnet.
-
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-ibportstate 3 1 disable                 # by lid
-.PP
-ibportstate -G 0x2C9000100D051 1 enable # by guid
-.PP
-ibportstate -D 0 1                      # (query) by direct route
-.PP
-ibportstate 3 1 reset				# by lid
-.PP
-ibportstate 3 1 speed 1				# by lid
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibprintrt.8 b/man/ibprintrt.8
index 4929586..1151c70 100644
--- a/man/ibprintrt.8
+++ b/man/ibprintrt.8
@@ -1,7 +1,8 @@
 .TH IBPRINTRT 8 "May 31, 2007" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
-ibprintrt.pl \- print either only the router specified or a list of routers from the ibnetdiscover output
+ibprintrt.pl \- print either only the router specified or a list of routers
+from the ibnetdiscover output
 
 .SH SYNOPSIS
 .B ibprintrt.pl
diff --git a/man/ibprintswitch.8 b/man/ibprintswitch.8
index 11e0a87..9538e7f 100644
--- a/man/ibprintswitch.8
+++ b/man/ibprintswitch.8
@@ -1,7 +1,8 @@
 .TH IBPRINTSWITCH 8 "May 31, 2007" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
-ibprintswitch.pl \- print either the switch specified or a list of switches from the ibnetdiscover output
+ibprintswitch.pl \- print either the switch specified or a list of switches
+from the ibnetdiscover output
 
 .SH SYNOPSIS
 .B ibprintswitch.pl
@@ -10,14 +11,14 @@ ibprintswitch.pl \- print either the switch specified or a list of switches from
 .SH DESCRIPTION
 .PP
 Faster than greping/viewing with an editor the output of ibnetdiscover,
-ibprintswitch.pl will parse out and print either the switch information for the
-switch specified or a list of all the switches found in the subnet.
+ibprintswitch.pl will parse out and print either the switch information
+for the switch specified or a list of all the switches found in the subnet.
 In addition, it will crudely parse on the node description
-information and if found report all the information for an entire chasis if the
-description information is consistent.
+information and if found report all the information for an entire chasis
+if the description information is consistent.
 
-Finally, ibprintswitch.pl will also reuse the cached ibnetdiscover output from
-some of the other diag tools which makes it a bit faster than running
+Finally, ibprintswitch.pl will also reuse the cached ibnetdiscover output
+from some of the other diag tools which makes it a bit faster than running
 ibnetdiscover from scratch.
 
 .SH OPTIONS
diff --git a/man/ibqueryerrors.8 b/man/ibqueryerrors.8
deleted file mode 100644
index 5c7eb17..0000000
--- a/man/ibqueryerrors.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH IBQUERYERRORS 8 "Jan 24, 2008" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibqueryerrors.pl \- query and report non-zero IB port counters
-
-.SH SYNOPSIS
-.B ibqueryerrors.pl
-[-a -c -r -R -C <ca_name> -P <ca_port> -s <err1,err2,...> -S <switch_guid> -D <direct_route> -d]
-
-.SH DESCRIPTION
-.PP
-ibqueryerrors.pl reports the port counters of switches.  This is similar to
-ibcheckerrors with the additional ability to filter out selected errors,
-include the optional transmit and receive data counters, report actions to
-remedy a non-zero count, and report full link information for the link
-reported.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-a\fR
-Report an action to take.  Some of the counters are not errors in and of
-themselves.  This reports some more information on what the counters mean and
-what actions can/should be taken if they are non-zero.
-.TP
-\fB\-c\fR
-Suppress some of the common "side effect" counters.  These counters usually do
-not indicate an error condition and can be usually be safely ignored.
-.TP
-\fB\-r\fR
-Report the port information.  This includes LID, port, external port (if
-applicable), link speed setting, remote GUID, remote port, remote external port
-(if applicable), and remote node description information.
-.TP
-\fB\-R\fR
-Recalculate the ibnetdiscover information, ie do not use the cached
-information.  This option is slower but should be used if the diag tools have
-not been used for some time or if there are other reasons to believe that
-the fabric has changed.
-.TP
-\fB\-s <err1,err2,...>\fR
-Suppress the errors listed in the comma separated list provided.
-.TP
-\fB\-S <switch_guid>\fR
-Report results only for the switch specified. (hex format)
-.TP
-\fB\-D <direct_route>\fR
-Report results only for the switch specified by the direct route path.
-.TP
-\fB\-d\fR
-Include the optional transmit and receive data counters.
-.TP
-\fB\-C <ca_name>\fR    use the specified ca_name for the search.
-.TP
-\fB\-P <ca_port>\fR    use the specified ca_port for the search.
-
-
-.SH AUTHOR
-.TP
-Ira Weiny
-.RI < weiny2 at llnl.gov >
-
diff --git a/man/ibroute.8 b/man/ibroute.8
deleted file mode 100644
index 9f28477..0000000
--- a/man/ibroute.8
+++ /dev/null
@@ -1,119 +0,0 @@
-.TH IBROUTE 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibroute \- query InfiniBand switch forwarding tables
-
-.SH SYNOPSIS
-.B ibroute
-[\-d(ebug)] [-a(ll)] [-n(o_dests)] [-v(erbose)] [\-D(irect)] [\-G(uid)] [-M(ulticast)] [-s smlid] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-h(elp)] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
-
-.SH DESCRIPTION
-.PP
-ibroute uses SMPs to display the forwarding tables (unicast
-(LinearForwardingTable or LFT) or multicast (MulticastForwardingTable or MFT))
-for the specified switch LID and the optional lid (mlid) range.
-The default range is all valid entries in the range 1...FDBTop.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-a\fR, \fB\-\-all\fR
-show all lids in range, even invalid entries
-.TP
-\fB\-n\fR, \fB\-\-no_dests\fR
-do not try to resolve destinations
-.TP
-\fB\-M\fR, \fB\-\-Multicast\fR
-show multicast forwarding tables
-In this case, the range parameters are specifying the mlid range.
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-Unicast examples
-.PP
-ibroute 4       # dump all lids with valid out ports of switch with lid 4
-.PP
-ibroute -a 4    # same, but dump all lids, even with invalid out ports
-.PP
-ibroute -n 4    # simple dump format - no destination resolution
-.PP
-ibroute 4 10    # dump lids starting from 10 (up to FDBTop)
-.PP
-ibroute 4 0x10 0x20     # dump lid range
-.PP
-ibroute -G 0x08f1040023 # resolve switch by GUID
-.PP
-ibroute -D 0,1  # resolve switch by direct path
-
-.PP
-Multicast examples
-.PP
-ibroute -M 4    # dump all non empty mlids of switch with lid 4
-.PP
-ibroute -M 4 0xc010 0xc020      # same, but with range
-.PP
-ibroute -M -n 4 # simple dump format
-
-.SH SEE ALSO
-.BR ibtracert (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibrouters.8 b/man/ibrouters.8
deleted file mode 100644
index 9c3ef68..0000000
--- a/man/ibrouters.8
+++ /dev/null
@@ -1,31 +0,0 @@
-.TH IBROUTERS 8 "May 30, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibrouters \- show InfiniBand router nodes in topology
-
-.SH SYNOPSIS
-.B ibrouters
-[\-h] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
-
-.SH DESCRIPTION
-.PP
-ibrouters is a script which either walks the IB subnet topology or uses an
-already saved topology file and extracts the Rt nodes.
-
-.SH OPTIONS
-.PP
-\-h      show the usage message
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-.SH SEE ALSO
-.BR ibnetdiscover(8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibstat.8 b/man/ibstat.8
deleted file mode 100644
index b607d83..0000000
--- a/man/ibstat.8
+++ /dev/null
@@ -1,110 +0,0 @@
-.TH IBSTAT 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibstat \- query basic status of InfiniBand device(s)
-
-.SH SYNOPSIS
-.B ibstat
-[\-d(ebug)] [\-l(ist_of_cas)] [\-s(hort)] [\-p(ort_list)] [\-V(ersion)] [\-h] <ca_name> [portnum]
-
-.SH DESCRIPTION
-.PP
-ibstat is a binary which displays basic information obtained from the local
-IB driver. Output includes LID, SMLID, port state, link width active, and port
-physical state.
-
-It is similar to the ibstatus utility but implemented as a binary rather
-than a script. It has options to list CAs and/or ports and displays more
-information than ibstatus.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-l\fR, \fB\-\-list_of_cas\fR
-list all IB devices
-.TP
-\fB\-s\fR, \fB\-\-short\fR
-short output
-.TP
-\fB\-p\fR, \fB\-\-port_list\fR
-show port list
-.TP
-ca_name
-InfiniBand device name
-.TP
-portnum
-port number of InfiniBand device
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-ibstat            # display status of all ports on all IB devices
-.PP
-ibstat -l         # list all IB devices
-.PP
-ibstat -p         # show port guids
-.PP
-ibstat mthca0 2   # show status of port 2 of 'mthca0'
-
-.SH SEE ALSO
-.BR ibstatus (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibstatus.8 b/man/ibstatus.8
deleted file mode 100644
index c4b3831..0000000
--- a/man/ibstatus.8
+++ /dev/null
@@ -1,41 +0,0 @@
-.TH IBSTATUS 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibstatus \- query basic status of InfiniBand device(s)
-
-.SH SYNOPSIS
-.B ibstatus
-[\-h] [devname[:port]]...
-
-.SH DESCRIPTION
-.PP
-ibstatus is a script which displays basic information obtained from the local
-IB driver. Output includes LID, SMLID, port state, link width active, and port
-physical state.
-
-.SH OPTIONS
-
-.PP
-.TP
-devname
-InfiniBand device name
-.TP
-portnum
-port number of InfiniBand device
-
-.SH EXAMPLES
-
-.PP
-ibstatus                # display status of all IB ports
-.PP
-ibstatus mthca1         # status of mthca1 ports
-.PP
-ibstatus mthca1:1 mthca0:2      # show status of specified ports
-
-.SH SEE ALSO
-.BR ibstat (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibswitches.8 b/man/ibswitches.8
deleted file mode 100644
index 3bd9904..0000000
--- a/man/ibswitches.8
+++ /dev/null
@@ -1,31 +0,0 @@
-.TH IBSWITCHES 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibswitches\- show InfiniBand switch nodes in topology
-
-.SH SYNOPSIS
-.B ibswitches
-[\-h] [<topology-file> | \-C ca_name \-P ca_port \-t(imeout) timeout_ms]
-
-.SH DESCRIPTION
-.PP
-ibswitches is a script which either walks the IB subnet topology or uses an
-already saved topology file and extracts the switch nodes.
-
-.SH OPTIONS
-.PP
-\-h      show the usage message
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-.SH SEE ALSO
-.BR ibnetdiscover(8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibswportwatch.8 b/man/ibswportwatch.8
index 72501ab..7191d37 100644
--- a/man/ibswportwatch.8
+++ b/man/ibswportwatch.8
@@ -1,8 +1,8 @@
 .TH IBSWPORTWATCH 8 "September 27, 2006" "OpenIB" "OpenIB Diagnostics"
 
 .SH NAME
-ibswportwatch.pl \- poll the counters on the specified switch/port and report rate
-of change information.
+ibswportwatch.pl \- poll the counters on the specified switch/port and
+report rate of change information.
 
 .SH SYNOPSIS
 .B ibswportwatch.pl
@@ -10,8 +10,8 @@ of change information.
 
 .SH DESCRIPTION
 .PP
-ibswportwatch.pl polls the port counters of the specified port and calculates rate
-of change information.
+ibswportwatch.pl polls the port counters of the specified port and
+calculates rate of change information.
 
 .SH OPTIONS
 
diff --git a/man/ibsysstat.8 b/man/ibsysstat.8
deleted file mode 100644
index 2f2c69f..0000000
--- a/man/ibsysstat.8
+++ /dev/null
@@ -1,83 +0,0 @@
-.TH IBSYSSTAT 8 "August 11, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibsysstat \- system status on an InfiniBand address
-
-.SH SYNOPSIS
-.B ibsysstat
-[\-d(ebug)] [\-e(rr_show)] [\-v(erbose)] [\-G(uid)] [\-C ca_name] [\-P ca_port] [\-s smlid] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-o oui] [\-S(erver)] [\-h(elp)] <dest lid | guid> [<op>]
-
-.SH DESCRIPTION
-.PP
-ibsysstat uses vendor mads to validate connectivity between IB nodes
-and obtain other information about the IB node. ibsysstat is run as
-client/server. Default is to run as client.
-
-.SH OPTIONS
-
-.PP
-.TP
-Current supported operations:
- ping \- verify connectivity to server (default)
- host \- obtain host information from server
- cpu  \- obtain cpu information from server
-.TP
-\fB\-o\fR, \fB\-\-oui\fR
-use specified OUI number to multiplex vendor mads
-.TP
-\fB\-S\fR, \fB\-\-Server\fR
-start in server mode (do not return)
-
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/ibtracert.8 b/man/ibtracert.8
deleted file mode 100644
index 1b48572..0000000
--- a/man/ibtracert.8
+++ /dev/null
@@ -1,112 +0,0 @@
-.TH IBTRACERT 8 "April 14, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-ibtracert\- trace InfiniBand path
-
-.SH SYNOPSIS
-.B ibtracert
-[\-d(ebug)] [-v(erbose)] [\-D(irect)] [\-G(uids)] [-n(o_info)] [-m mlid] [-s
-smlid] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)]
-[\-\-node\-name\-\-map <node-name-map>] [\-h(elp)] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]
-
-.SH DESCRIPTION
-.PP
-ibtracert uses SMPs to trace the path from a source GID/LID to a
-destination GID/LID. Each hop along the path is displayed until the destination
-is reached or a hop does not respond. By using the -m option, multicast path
-tracing can be performed between source and destination nodes.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-n\fR, \fB\-\-no_info\fR
-simple format; don't show additional information
-.TP
-\fB\-m\fR
-show the multicast trace of the specified mlid
-.TP
-\fB\-\-node\-name\-map\fR <node-name-map>
-Specify a node name map.  The node name map file maps GUIDs to more user friendly
-names.  See
-.B ibnetdiscover(8)
-for node name map file format.
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-Unicast examples
-.PP
-ibtracert 4 16              # show path between lids 4 and 16
-.PP
-ibtracert -n 4 16           # same, but using simple output format
-.PP
-ibtracert -G 0x8f1040396522d 0x002c9000100d051  # use guid addresses
-
-.PP
-Multicast example
-.PP
-ibtracert -m 0xc000 4 16    # show multicast path of mlid 0xc000 between lids 4 and 16
-
-.SH SEE ALSO
-.BR ibroute (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
-.TP
-Ira Weiny
-.RI < weiny2 at llnl.gov >
diff --git a/man/perfquery.8 b/man/perfquery.8
deleted file mode 100644
index 716d6ff..0000000
--- a/man/perfquery.8
+++ /dev/null
@@ -1,124 +0,0 @@
-.TH PERFQUERY 8 "March 29, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-perfquery \- query InfiniBand port counters
-
-.SH SYNOPSIS
-.B perfquery
-[\-d(ebug)] [\-G(uid)] [-e(xtended)] [-a(ll_ports)] [-l(oop_ports)] [-r(eset_after_read)] [-R(eset_only)] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-h(elp)] [<lid|guid> [[port] [reset_mask]]]
-
-.SH DESCRIPTION
-.PP
-perfquery uses PerfMgt GMPs to obtain the PortCounters (basic performance
-and error counters) or PortExtendedCounters from the PMA at the node/port
-specified. Optionally shows aggregated counters for all ports of node.
-Also, optionally, reset after read, or only reset counters.
-
-Note: In both PortCounters and PortCountersExtended, components
-that represent Data (e.g. PortXmitData and PortRcvData) indicate octets
-divided by 4 rather than just octets.
-
-Note: Inputting a port of 255 indicates an operation be performed on all ports.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-e\fR, \fB\-\-extended\fR
-show extended port counters rather than (basic) port counters.
-Note that extended port counters attribute is optional.
-.TP
-\fB\-a\fR, \fB\-\-all_ports\fR
-show aggregated counters for all ports of the destination lid
-or reset all counters for all ports.  If the destination lid
-does not support the AllPortSelect flag, all ports will be
-iterated through to emulate AllPortSelect behavior.
-.TP
-\fB\-l\fR, \fB\-\-loop_ports\fR
-If all ports are selected by the user (either through the
-\fB\-a\fR option or port 255) iterate through each port
-rather than doing than aggregate operation.
-.TP
-\fB\-r\fR, \fB\-\-reset_after_read\fR
-reset counters after read
-.TP
-\fB\-R\fR, \fB\-\-Reset_only\fR
-only reset counters
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-perfquery               # read local port performance counters
-.PP
-perfquery 32 1          # read performance counters from lid 32, port 1
-.PP
-perfquery -e 32 1       # read extended performance counters from lid 32, port 1
-.PP
-perfquery -a 32         # read perf counters from lid 32, all ports
-.PP
-perfquery -r 32 1       # read performance counters and reset
-.PP
-perfquery -e -r 32 1    # read extended performance counters and reset
-.PP
-perfquery -R 0x20 1     # reset performance counters of port 1 only
-.PP
-perfquery -e -R 0x20 1  # reset extended performance counters of port 1 only
-.PP
-perfquery -R -a 32      # reset performance counters of all ports
-.PP
-perfquery -R 32 2 0x0fff # reset only error counters of port 2
-.PP
-perfquery -R 32 2 0xf000 # reset only non-error counters of port 2
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/saquery.8 b/man/saquery.8
deleted file mode 100644
index 5c75c21..0000000
--- a/man/saquery.8
+++ /dev/null
@@ -1,132 +0,0 @@
-.TH SAQUERY 8 "October 19, 2008" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-saquery \- query InfiniBand subnet administration attributes
-
-.SH SYNOPSIS
-.B saquery
-[\-h] [\-d] [\-p] [\-N] [\-\-list | \-D] [\-S] [\-I] [\-L] [\-l] [\-G] [\-O]
-[\-U] [\-c] [\-s] [\-g] [\-m] [\-x]
-[\-C ca_name] [\-P ca_port] [\-\-smkey val] [\-t(imeout) <msec>]
-[\-\-src\-to\-dst <src:dst>]
-[\-\-sgid\-to\-dgid <sgid\-dgid>]
-[\-\-node\-name\-map <node\-name\-map>]
-[<name> | <lid> | <guid>]
-
-.SH DESCRIPTION
-.PP
-saquery issues the selected SA query. Node records are queried by default.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-p\fR
-get PathRecord info
-.TP
-\fB\-N\fR
-get NodeRecord info
-.TP
-\fB\-\-list | \-D\fR
-get NodeDescriptions of CAs only
-.TP
-\fB\-S\fR
-get ServiceRecord info
-.TP
-\fB\-I\fR
-get InformInfoRecord (subscription) info
-.TP
-\fB\-L\fR
-return the Lids of the name specified
-.TP
-\fB\-l\fR
-return the unique Lid of the name specified
-.TP
-\fB\-G\fR
-return the Guids of the name specified
-.TP
-\fB\-O\fR
-return the name for the Lid specified
-.TP
-\fB\-U\fR
-return the name for the Guid specified
-.TP
-\fB\-c\fR
-get the SA's class port info
-.TP
-\fB\-s\fR
-return the PortInfoRecords with isSM or isSMdisabled capability mask bit on
-.TP
-\fB\-g\fR
-get multicast group info
-.TP
-\fB\-m\fR
-get multicast member info.  If a group is specified, limit the output to the
-group specified and print one line containing only the GUID and node
-description for each entry. Example: saquery -m 0xc000
-.TP
-\fB\-x\fR
-get LinkRecord info
-.TP
-\fB\-\-src-to-dst\fR
-get a PathRecord for <src:dst>
-where src and dst are either node names or LIDs
-.TP
-.B \-\-sgid\-to\-dgid
-get a PathRecord for
-.I sgid
-to
-.I dgid
-where both GIDs are in an IPv6 format acceptable to
-.BR inet_pton (3).
-.TP
-\fB\-C\fR <ca_name>
-use the specified ca_name.
-.TP
-\fB\-P\fR <ca_port>
-use the specified ca_port.
-.TP
-\fB\-\-smkey\fR <val>
-use SM_Key value for the query. Will be used only with "trusted" queries.
-If non-numeric value (like 'x') is specified then saquery will prompt for
-a value.
-.TP
-\fB\-t\fR, \fB\-timeout\fR <msec>
-Specify SA query response timeout in milliseconds.
-Default is 100 milliseconds. You may want to use
-this option if IB_TIMEOUT is indicated.
-.TP
-\fB\-\-node\-name\-map\fR <node-name-map>
-Specify a node name map.  The node name map file maps GUIDs to more user friendly
-names.  See
-.B ibnetdiscover(8)
-for node name map file format.  Only used with the \fB\-O\fR and \fB\-U\fR options.
-.TP
-Supported query names (and aliases):
- ClassPortInfo (CPI)
- NodeRecord (NR)
- PortInfoRecord (PIR)
- SL2VLTableRecord (SL2VL) [[lid]/[in_port]/[out_port]]
- PKeyTableRecord (PKTR) [[lid]/[port]/[block]]
- VLArbitrationTableRecord (VLAR) [[lid]/[port]/[block]]
- InformInfoRecord (IIR)
- LinkRecord (LR) [[from_lid]/[from_port]] [[to_lid]/[to_port]]
- ServiceRecord (SR)
- PathRecord (PR)
- MCMemberRecord (MCMR)
- LFTRecord (LFTR) [[lid]/[block]]
- MFTRecord (MFTR) [[mlid]/[position]/[block]]
-.TP
-\fB\-d\fR
-enable debugging
-.TP
-\fB\-h\fR
-show help
-
-.SH AUTHORS
-.TP
-Ira Weiny
-.RI < weiny2 at llnl.gov >
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/sminfo.8 b/man/sminfo.8
deleted file mode 100644
index 6c57362..0000000
--- a/man/sminfo.8
+++ /dev/null
@@ -1,105 +0,0 @@
-.TH SMINFO 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-sminfo \- query InfiniBand SMInfo attribute
-
-.SH SYNOPSIS
-.B sminfo
-[\-d(ebug)] [\-e(rr_show)] -s state -p prio -a activity [\-D(irect)] [\-G(uid)]  [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-h(elp)] sm_lid | sm_dr_path [modifier]
-
-.SH DESCRIPTION
-.PP
-Optionally set and display the output of a sminfo query in human readable
-format. The target SM is the one listed in the local port info, or the SM
-specified by the optional SM lid or by the SM direct routed path.
-.PP
-Note: using sminfo for any purposes other then simple query may be very
-dangerous, and may result in a malfunction of the target SM.
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-s\fR
-set SM state
- 0 - not active
- 1 - discovering
- 2 - standby
- 3 - master
-.TP
-\fB\-p\fR
-set priority (0-15)
-.TP
-\fB\-a\fR
-set activity count
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-sminfo                  # local port\'s sminfo
-.PP
-sminfo 32               # show sminfo of lid 32
-.PP
-sminfo  -G 0x8f1040023  # same but using guid address
-
-.SH SEE ALSO
-.BR smpdump (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/smpdump.8 b/man/smpdump.8
deleted file mode 100644
index 2a08753..0000000
--- a/man/smpdump.8
+++ /dev/null
@@ -1,98 +0,0 @@
-.TH SMPDUMP 8 "July 25, 2006" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-smpdump \- dump InfiniBand subnet management attributes
-
-.SH SYNOPSIS
-.B smpdump
-[\-s(ring)] [\-D(irect)] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-h(elp)] <dlid|dr_path> <attr> [mod]
-
-.SH DESCRIPTION
-.PP
-smpdump is a general purpose SMP utility which gets SM attributes from a
-specified SMA. The result is dumped in hex by default.
-
-.SH OPTIONS
-
-.TP
-attr
-IBA attribute ID for SM attribute
-.TP
-mod
-IBA modifier for SM attribute
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-Direct Routed Examples
-.PP
-smpdump -D 0,1,2,3,5 16 # NODE DESC
-.PP
-smpdump -D 0,1,2 0x15 2 # PORT INFO, port 2
-
-LID Routed Examples
-.PP
-smpdump 3 0x15 2        # PORT INFO, lid 3 port 2
-.PP
-smpdump 0xa0 0x11       # NODE INFO, lid 0xa0
-
-.SH SEE ALSO
-.BR smpquery (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/smpquery.8 b/man/smpquery.8
deleted file mode 100644
index 5b719c4..0000000
--- a/man/smpquery.8
+++ /dev/null
@@ -1,113 +0,0 @@
-.TH SMPQUERY 8 "March 14, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-smpquery \- query InfiniBand subnet management attributes
-
-.SH SYNOPSIS
-.B smpquery
-[\-d(ebug)] [\-e(rr_show)] [\-v(erbose)] [\-D(irect)] [\-G(uid)] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [--node-name-map node-name-map] [\-V(ersion)] [\-h(elp)] <op> <dest dr_path|lid|guid> [op params]
-
-.SH DESCRIPTION
-.PP
-smpquery allows a basic subset of standard SMP queries including the following:
-node info, node description, switch info, port info. Fields are displayed in
-human readable format.
-
-.SH OPTIONS
-
-.PP
-.TP
-Current supported operations and their parameters:
-        nodeinfo <addr>
-        nodedesc <addr>
-        portinfo <addr> [<portnum>]     # default port is zero
-        switchinfo <addr>
-        pkeys <addr> [<portnum>]
-        sl2vl <addr> [<portnum>]
-        vlarb <addr> [<portnum>]
-        guids <addr>
-
-.TP
-\fB\-\-node\-name\-map\fR <node-name-map>
-Specify a node name map.  The node name map file maps GUIDs to more user friendly
-names.  See
-.B ibnetdiscover(8)
-for node name map file format.
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-D      use directed path address arguments. The path
-        is a comma separated list of out ports.
-        Examples:
-        "0"             # self port
-        "0,1,2,1,4"     # out via port 1, then 2, ...
-.PP
-\-c      use combined route address arguments. The
-        address is a combination of a LID and a direct route path.
-        The LID specified is the DLID and the local LID is used
-        as the DrSLID.
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-smpquery portinfo 3 1        # portinfo by lid, with port modifier
-.PP
-smpquery -G switchinfo 0x2C9000100D051 1        # switchinfo by guid
-.PP
-smpquery -D nodeinfo 0       # nodeinfo by direct route
-.PP
-smpquery -c nodeinfo 6 0,12  # nodeinfo by combined route
-
-.SH SEE ALSO
-.BR smpdump (8)
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/man/vendstat.8 b/man/vendstat.8
deleted file mode 100644
index e32650a..0000000
--- a/man/vendstat.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH VENDSTAT 8 "February 15, 2007" "OpenIB" "OpenIB Diagnostics"
-
-.SH NAME
-vendstat \- query InfiniBand vendor specific functions
-
-.SH SYNOPSIS
-.B vendstat
-[\-d(ebug)] [\-G(uid)] [\-N] [\-w] [\-C ca_name] [\-P ca_port] [\-t(imeout) timeout_ms] [\-V(ersion)] [\-h(elp)] <lid|guid>
-
-.SH DESCRIPTION
-.PP
-vendstat uses vendor specific MADs to access beyond the IB spec
-vendor specific functionality. Currently, there is support only for
-Mellanox InfiniSwitch-III (IS3).
-
-.SH OPTIONS
-
-.PP
-.TP
-\fB\-N\fR
-show IS3 general information.
-.TP
-\fB\-w\fR
-show IS3 port xmit wait counters.
-
-.SH COMMON OPTIONS
-
-Most OpenIB diagnostics take the following common flags. The exact list of
-supported flags per utility can be found in the usage message and can be shown
-using the util_name -h syntax.
-
-# Debugging flags
-.PP
-\-d      raise the IB debugging level.
-        May be used several times (-ddd or -d -d -d).
-.PP
-\-e      show send and receive errors (timeouts and others)
-.PP
-\-h      show the usage message
-.PP
-\-v      increase the application verbosity level.
-        May be used several times (-vv or -v -v -v)
-.PP
-\-V      show the version info.
-
-# Addressing flags
-.PP
-\-G      use GUID address argument. In most cases, it is the Port GUID.
-        Example:
-        "0x08f1040023"
-.PP
-\-s <smlid>      use 'smlid' as the target lid for SM/SA queries.
-
-# Other common flags:
-.PP
-\-C <ca_name>    use the specified ca_name.
-.PP
-\-P <ca_port>    use the specified ca_port.
-.PP
-\-t <timeout_ms> override the default timeout for the solicited mads.
-
-Multiple CA/Multiple Port Support
-
-When no IB device or port is specified, the port to use is selected
-by the following criteria:
-.PP
-1. the first port that is ACTIVE.
-.PP
-2. if not found, the first port that is UP (physical link up).
-
-If a port and/or CA name is specified, the user request is
-attempted to be fulfilled, and will fail if it is not possible.
-
-.SH EXAMPLES
-
-.PP
-vendstat -N 6		# read IS3 general information
-.PP
-vendstat -w 6		# read IS3 port xmit wait counters
-
-.SH AUTHOR
-.TP
-Hal Rosenstock
-.RI < halr at voltaire.com >
diff --git a/scripts/IBswcountlimits.pm b/scripts/IBswcountlimits.pm
index 6623b8b..7531aef 100755
--- a/scripts/IBswcountlimits.pm
+++ b/scripts/IBswcountlimits.pm
@@ -47,41 +47,41 @@ $IBswcountlimits::cache_dir       = "/var/cache/infiniband-diags";
 
 # all the PerfMgt counters
 @IBswcountlimits::counters = (
-	"SymbolErrors",        "LinkRecovers",
-	"LinkDowned",          "RcvErrors",
-	"RcvRemotePhysErrors", "RcvSwRelayErrors",
-	"XmtDiscards",         "XmtConstraintErrors",
-	"RcvConstraintErrors", "LinkIntegrityErrors",
-	"ExcBufOverrunErrors", "VL15Dropped",
-	"XmtData",             "RcvData",
-	"XmtPkts",             "RcvPkts"
+	"SymbolErrorCounter",        "LinkErrorRecoveryCounter",
+	"LinkDownedCounter",          "PortRcvErrors",
+	"PortRcvRemotePhysicalErrors", "PortRcvSwitchRelayErrors",
+	"PortXmitDiscards",         "PortXmitConstraintErrors",
+	"PortRcvConstraintErrors", "LocalLinkIntegrityErrors",
+	"ExcessiveBufferOverrunErrors", "VL15Dropped",
+	"PortXmitData",             "PortRcvData",
+	"PortXmitPkts",             "PortRcvPkts"
 );
 
 # non-critical counters
 %IBswcountlimits::error_counters = (
-	"SymbolErrors",
-"No action is required except if counter is increasing along with LinkRecovers",
-	"LinkRecovers",
-"If this is increasing along with SymbolErrors this may indicate a bad link, run ibswportwatch.pl on this port",
-	"LinkDowned",
+	"SymbolErrorCounter",
+"No action is required except if counter is increasing along with LinkErrorRecoveryCounter",
+	"LinkErrorRecoveryCounter",
+"If this is increasing along with SymbolErrorCounter this may indicate a bad link, run ibswportwatch.pl on this port",
+	"LinkDownedCounter",
 	"Number of times the port has gone down (Usually for valid reasons)",
-	"RcvErrors",
+	"PortRcvErrors",
 "This is a bad link, if the link is internal to a 288 try setting SDR, otherwise check the cable",
-	"RcvRemotePhysErrors",
+	"PortRcvRemotePhysicalErrors",
 	"This indicates a problem ELSEWHERE in the fabric.",
-	"XmtDiscards",
+	"PortXmitDiscards",
 "This is a symptom of congestion and may require tweaking either HOQ or switch lifetime values",
-	"XmtConstraintErrors",
+	"PortXmitConstraintErrors",
 	"This is a result of bad partitioning, check partition configuration.",
-	"RcvConstraintErrors",
+	"PortRcvConstraintErrors",
 	"This is a result of bad partitioning, check partition configuration.",
-	"LinkIntegrityErrors",
+	"LocalLinkIntegrityErrors",
 	"May indicate a bad link, run ibswportwatch.pl on this port",
-	"ExcBufOverrunErrors",
+	"ExcessiveBufferOverrunErrors",
 "This is a flow control state machine error and can be caused by packets with physical errors",
 	"VL15Dropped",
 	"check with ibswportwatch.pl, if increasing in SMALL increments, OK",
-	"RcvSwRelayErrors",
+	"PortRcvSwitchRelayErrors",
 	"This counter can increase due to a valid network event"
 );
 
@@ -113,13 +113,13 @@ sub check_counters
 
 # Data counters
 %IBswcountlimits::data_counters = (
-	"XmtData",
+	"PortXmitData",
 "Total number of data octets, divided by 4, transmitted on all VLs from the port",
-	"RcvData",
+	"PortRcvData",
 "Total number of data octets, divided by 4, received on all VLs to the port",
-	"XmtPkts",
+	"PortXmitPkts",
 "Total number of packets, excluding link packets, transmitted on all VLs from the port",
-	"RcvPkts",
+	"PortRcvPkts",
 "Total number of packets, excluding link packets, received on all VLs to the port"
 );
 
@@ -167,9 +167,9 @@ sub calculate_rate
 	return ($rate);
 }
 %IBswcountlimits::rate_dep_thresholds = (
-	"SymbolErrors", 10, "LinkRecovers",        10,
-	"RcvErrors",    10, "LinkIntegrityErrors", 10,
-	"XmtDiscards",  10
+	"SymbolErrorCounter", 10, "LinkErrorRecoveryCounter",        10,
+	"PortRcvErrors",    10, "LocalLinkIntegrityErrors", 10,
+	"PortXmitDiscards",  10
 );
 
 sub check_counter_rates
diff --git a/scripts/check_lft_balance.pl b/scripts/check_lft_balance.pl
index cd4950f..d848cb5 100755
--- a/scripts/check_lft_balance.pl
+++ b/scripts/check_lft_balance.pl
@@ -41,10 +41,10 @@
 use strict;
 
 use Getopt::Std;
-use IBswcountlimits;
 
-my $regenerate_cache = 0;
-my $verbose          = 0;
+my $ibnetdiscover_cache = "";
+my $dump_lft_file       = "";
+my $verbose             = 0;
 
 my $switch_lid                            = undef;
 my $switch_guid                           = undef;
@@ -60,18 +60,18 @@ my $lft_line;
 my $lids_per_port;
 my $lids_per_port_calculated;
 
-my $iblinkinfo_regenerate = 0;
-
-my $cache_file;
+my $heuristic_flag = 0;
 
 sub usage
 {
 	my $prog = `basename $0`;
 
 	chomp($prog);
-	print "Usage: $prog [-R -v]\n";
-	print "  -R recalculate all cached information\n";
-	print "  -v verbose output\n";
+	print "Usage: $prog -l lft-output -i ibnetdiscover-cache [-e] [-v]\n";
+	print "  Generate lft-output via \"dump_lfts.sh > lft-output\"\n";
+	print "  Generate ibnetdiscover-cache via \"ibnetdiscover --cache ibnetdiscover-cache\"\n";
+	print "  -e turn on heuristic(s) to look at switch balances deeper\n";
+	print "  -v verbose output, output all switches\n";
 	exit 2;
 }
 
@@ -93,13 +93,18 @@ sub is_port_up
 
 	@lines = split("\n", $iblinkinfo_output);
 	foreach $line (@lines) {
-		if ($line =~ /$decport\[..\]  ==/) {
+		if ($line =~ /$decport\[..\] ==/) {
 			if ($line =~ /Down/) {
 				return 0;
 			}
+			else {
+				return 1;
+			}
 		}
 	}
-	return 1;
+
+	# return 0 if not found
+	return 0;
 }
 
 sub is_directly_connected
@@ -129,7 +134,7 @@ sub is_directly_connected
 
 	@lines = split("\n", $iblinkinfo_output);
 	foreach $line (@lines) {
-		if ($line =~ /$decport\[..\]  ==/) {
+		if ($line =~ /$decport\[..\] ==/) {
 			$str = $line;
 		}
 	}
@@ -152,24 +157,25 @@ sub output_switch_port_usage
 {
 	my $min_usage = 999999;
 	my $max_usage = 0;
+	my $min_usage2 = 999999;
+	my $max_usage2 = 0;
 	my @ports     = (
 		"001", "002", "003", "004", "005", "006", "007", "008",
 		"009", "010", "011", "012", "013", "014", "015", "016",
-		"017", "018", "019", "020", "021", "022", "023", "024"
+		"017", "018", "019", "020", "021", "022", "023", "024",
+		"025", "026", "027", "028", "029", "030", "031", "032",
+		"033", "034", "035", "036"
 	);
 	my @output_ports = ();
+	my @double_check_ports = ();
 	my $port;
 	my $iblinkinfo_output;
+	my $is_unbalanced = 0;
+	my $ports_on_switch = 0;
+	my $all_zero_flag = 1;
 	my $ret;
 
-	# Run command once to reduce number of calls to iblinkinfo.pl
-        if ($regenerate_cache && !$iblinkinfo_regenerate) {
-            $iblinkinfo_output = `iblinkinfo.pl -R -S $switch_guid`;
-            $iblinkinfo_regenerate++;
-        }
-        else {
-            $iblinkinfo_output = `iblinkinfo.pl -S $switch_guid`;
-        }
+        $iblinkinfo_output = `iblinkinfo --load-cache $ibnetdiscover_cache -S $switch_guid`;
 
 	for $port (@ports) {
 		if (!defined($switch_port_count{$port})) {
@@ -184,6 +190,8 @@ sub output_switch_port_usage
 			}
 		}
 
+		$ports_on_switch++;
+
 		# If port is directly connected to a node, don't use
 		# it in this calculation.
 		if (is_directly_connected($iblinkinfo_output, $port) == 1) {
@@ -201,8 +209,86 @@ sub output_switch_port_usage
 		}
 	}
 
-	if ($verbose || ($max_usage > ($min_usage + 1))) {
-		if ($max_usage > ($min_usage + 1)) {
+	if ($max_usage > ($min_usage + 1)) {
+		$is_unbalanced = 1;
+	}
+
+	# In the event this is a switch lineboard, it will almost always never
+	# balanced.  Half the ports go up to the spine, and the rest of the ports
+	# go down to HCAs.  So we will do a special heuristic:
+	#
+	# If about 1/2 of the remaining ports are balanced, then we will consider the
+	# entire switch balanced.
+	#
+	# Also, we do this only if there are enough alive ports on the switch to care.
+	# I picked 12 somewhat randomly
+	if ($heuristic_flag == 1
+	    && $is_unbalanced == 1
+	    && $ports_on_switch > 12) {
+
+		@double_check_ports = ();
+
+		for $port (@output_ports) {
+			if ($switch_port_count{$port} == $max_usage
+			    || $switch_port_count{$port} == ($max_usage - 1)
+			    || $switch_port_count{$port} == 0) {
+				next;
+			}
+
+			push(@double_check_ports, $port);
+		}
+
+		# we'll call half +/- 1 "about half"
+		if (@double_check_ports == int($ports_on_switch / 2)
+		    || @double_check_ports == int($ports_on_switch / 2) + 1
+		    || @double_check_ports == int($ports_on_switch / 2) - 1) {
+			for $port (@double_check_ports) {
+				if ($switch_port_count{$port} < $min_usage2) {
+					$min_usage2 = $switch_port_count{$port};
+				}
+				if ($switch_port_count{$port} > $max_usage2) {
+					$max_usage2 = $switch_port_count{$port};
+				}
+			}
+
+			if (!($max_usage2 > ($min_usage2 + 1))) {
+				$is_unbalanced = 0;
+			}
+		}
+	}
+
+	# Another special case is when you have a non-fully-populated switch
+	# Many ports will be zero.  So if all active ports != max or max-1 are = 0
+	# we will also consider this balanced.
+	if ($heuristic_flag == 1
+	    && $is_unbalanced == 1
+	    && $ports_on_switch > 12) {
+
+		@double_check_ports = ();
+
+		for $port (@output_ports) {
+			if ($switch_port_count{$port} == $max_usage
+			    || $switch_port_count{$port} == ($max_usage - 1)) {
+				next;
+			}
+
+			push(@double_check_ports, $port);
+		}
+
+		for $port (@double_check_ports) {
+			if ($switch_port_count{$port} != 0) {
+				$all_zero_flag = 0;
+				last;
+			}
+		}
+
+		if ($all_zero_flag == 1) {
+			$is_unbalanced = 0;
+		}
+	}
+
+	if ($verbose || $is_unbalanced == 1) {
+		if ($is_unbalanced == 1) {
 			print "Unbalanced Switch Port Usage: ";
 			print "$switch_name, $switch_guid, $switch_lid\n";
 		} else {
@@ -238,7 +324,7 @@ sub process_host_ports
 	}
 }
 
-if (!getopts("hRv")) {
+if (!getopts("hl:i:ve")) {
 	usage();
 }
 
@@ -246,24 +332,32 @@ if (defined($main::opt_h)) {
 	usage();
 }
 
-if (defined($main::opt_R)) {
-	$regenerate_cache = 1;
+if (defined($main::opt_l)) {
+	$dump_lft_file = $main::opt_l;
+} else {
+	print STDERR ("Must specify dump lfts file\n");
+	usage();
+	exit 1;
+}
+
+if (defined($main::opt_i)) {
+	$ibnetdiscover_cache = $main::opt_i;
+} else {
+	print STDERR ("Must specify ibnetdiscover cache\n");
+	usage();
+	exit 1;
 }
 
 if (defined($main::opt_v)) {
 	$verbose = 1;
 }
 
-$cache_file = "$IBswcountlimits::cache_dir/dump_lfts.out";
-if ($regenerate_cache || !(-f $cache_file)) {
-	`dump_lfts.sh > $cache_file`;
-	if ($? != 0) {
-		die "Execution of dump_lfts.sh failed with errors\n";
-	}
+if (defined($main::opt_e)) {
+	$heuristic_flag = 1;
 }
 
-if (!open(FH, "< $cache_file")) {
-	print STDERR ("Couldn't open cache file: $cache_file: $!\n");
+if (!open(FH, "< $dump_lft_file")) {
+	print STDERR ("Couldn't open dump lfts file: $dump_lft_file: $!\n");
 }
 
 @lft_lines = <FH>;
diff --git a/scripts/dump_lfts.sh b/scripts/dump_lfts.sh
index ebca705..0bf334d 100755
--- a/scripts/dump_lfts.sh
+++ b/scripts/dump_lfts.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # This simple script will collect outputs of ibroute for all switches
 # on the subnet and drop it on stdout. It can be used for LFTs dump
@@ -22,8 +22,8 @@ done
 
 dump_by_dr_path ()
 {
-for sw_dr in `ibnetdiscover $ca_info -v \
-	| sed -ne '/^DR path .* switch /s/^DR path \([,|0-9]\+\) ->.*{\([0-9|a-f]\+\)}.*$/\2 \1/p' \
+for sw_dr in `ibnetdiscover $ca_info -s \
+	| sed -ne '/^DR path .* switch /s/^DR path .*; \([,|0-9]\+\) ->.*{\([0-9|a-f]\+\)}.*$/\2 \1/p' \
 	| sort -u \
 	| awk 'BEGIN {guid=0;} {if ($1 != guid) { guid=$1; print $2; }}'` ; do
 	ibroute $ca_info -D ${sw_dr}
diff --git a/scripts/dump_mfts.sh b/scripts/dump_mfts.sh
index 39fc5fb..d6c2359 100755
--- a/scripts/dump_mfts.sh
+++ b/scripts/dump_mfts.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # This simple script will collect outputs of ibroute for all switches
 # on the subnet and drop it on stdout. It can be used for MFTs dump
@@ -22,10 +22,10 @@ done
 
 dump_by_dr_path ()
 {
-for sw_dr in `ibnetdiscover $ca_info -v \
-		| sed -ne '/^DR path .* switch /s/^DR path \[\(.*\)\].*$/\1/p' \
-		| sed -e 's/\]\[/,/g' \
-		| sort -u` ; do
+for sw_dr in `ibnetdiscover $ca_info -s \
+	| sed -ne '/^DR path .* switch /s/^DR path .*; \([,|0-9]\+\) ->.*{\([0-9|a-f]\+\)}.*$/\2 \1/p' \
+	| sort -u \
+	| awk 'BEGIN {guid=0;} {if ($1 != guid) { guid=$1; print $2; }}'` ; do
 	ibroute $ca_info -M -D ${sw_dr}
 done
 }
diff --git a/scripts/ibcheckerrors b/scripts/ibcheckerrors
index 435dc84..942b8dd 100644
--- a/scripts/ibcheckerrors
+++ b/scripts/ibcheckerrors
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -80,12 +80,12 @@ BEGIN {
 }
 function check_node(lid, port)
 {
-	if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
 		return 1;
 	}
-	if (system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+	if (system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 		return 2;
 	return 0;
 }
@@ -115,7 +115,7 @@ function check_node(lid, port)
 			if (check_node(lid, port) == 2)
 				pcnterr++;
 		} else if (err &&
-			   system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+			   system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 			pcnterr++;
 }
 
@@ -125,6 +125,7 @@ function check_node(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors\""
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d ports have errors beyond threshold\n", nports, pcnterr
 	exit (ne + pcnterr)
diff --git a/scripts/ibcheckerrors.in b/scripts/ibcheckerrors.in
index a45bd63..ca40a68 100644
--- a/scripts/ibcheckerrors.in
+++ b/scripts/ibcheckerrors.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -80,12 +80,12 @@ BEGIN {
 }
 function check_node(lid, port)
 {
-	if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
 		return 1;
 	}
-	if (system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+	if (system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 		return 2;
 	return 0;
 }
@@ -115,7 +115,7 @@ function check_node(lid, port)
 			if (check_node(lid, port) == 2)
 				pcnterr++;
 		} else if (err &&
-			   system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+			   system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 			pcnterr++;
 }
 
@@ -125,6 +125,7 @@ function check_node(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors\""
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d ports have errors beyond threshold\n", nports, pcnterr
 	exit (ne + pcnterr)
diff --git a/scripts/ibcheckerrs b/scripts/ibcheckerrs
index e284562..2a2d911 100644
--- a/scripts/ibcheckerrs
+++ b/scripts/ibcheckerrs
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -30,17 +30,17 @@ function red() {
 }
 
 function show_thresholds() {
-	echo "SymbolErrors=$SymbolErrors"
-	echo "LinkRecovers=$LinkRecovers"
-	echo "LinkDowned=$LinkDowned"
-	echo "RcvErrors=$RcvErrors"
-	echo "RcvRemotePhysErrors=$RcvRemotePhysErrors"
-	echo "RcvSwRelayErrors=$RcvSwRelayErrors"
-	echo "XmtDiscards=$XmtDiscards"
-	echo "XmtConstraintErrors=$XmtConstraintErrors"
-	echo "RcvConstraintErrors=$RcvConstraintErrors"
-	echo "LinkIntegrityErrors=$LinkIntegrityErrors"
-	echo "ExcBufOverrunErrors=$ExcBufOverrunErrors"
+	echo "SymbolErrorCounter=$SymbolErrorCounter"
+	echo "LinkErrorRecoveryCounter=$LinkErrorRecoveryCounter"
+	echo "LinkDownedCounter=$LinkDownedCounter"
+	echo "PortRcvErrors=$PortRcvErrors"
+	echo "PortRcvRemotePhysicalErrors=$PortRcvRemotePhysicalErrors"
+	echo "PortRcvSwitchRelayErrors=$PortRcvSwitchRelayErrors"
+	echo "PortXmitDiscards=$PortXmitDiscards"
+	echo "PortXmitConstraintErrors=$PortXmitConstraintErrors"
+	echo "PortRcvConstraintErrors=$PortRcvConstraintErrors"
+	echo "LocalLinkIntegrityErrors=$LocalLinkIntegrityErrors"
+	echo "ExcessiveBufferOverrunErrors=$ExcessiveBufferOverrunErrors"
 	echo "VL15Dropped=$VL15Dropped"
 }
 
@@ -49,17 +49,17 @@ function get_thresholds() {
 }
 
 # Default thresholds
-SymbolErrors=10
-LinkRecovers=10
-LinkDowned=10
-RcvErrors=10
-RcvRemotePhysErrors=100
-RcvSwRelayErrors=100
-XmtDiscards=100
-XmtConstraintErrors=100
-RcvConstraintErrors=100
-LinkIntegrityErrors=10
-ExcBufOverrunErrors=10
+SymbolErrorCounter=10
+LinkErrorRecoveryCounter=10
+LinkDownedCounter=10
+PortRcvErrors=10
+PortRcvRemotePhysicalErrors=100
+PortRcvSwitchRelayErrors=100
+PortXmitDiscards=100
+PortXmitConstraintErrors=100
+PortRcvConstraintErrors=100
+LocalLinkIntegrityErrors=10
+ExcessiveBufferOverrunErrors=10
 VL15Dropped=100
 
 guid_addr=""
@@ -67,6 +67,7 @@ bw=""
 verbose=""
 brief=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -96,6 +97,9 @@ while [ "$1" ]; do
 		show_thresholds
 		exit 0
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-P | -C | -t | -timeout)
 		case $2 in
 		-*)
@@ -135,6 +139,10 @@ else
 	portname=$2
 fi
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors\"\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
@@ -155,6 +163,14 @@ nodename=`$IBPATH/smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:
 
 text="`eval $IBPATH/perfquery $ca_info $lid $portnum`"
 rv=$?
+if echo $text | grep -q 'AllPortSelect not supported'; then
+	if [ "$verbose" = "yes" ]; then
+		echo -n "Error check on lid $lid ($nodename) port $portname: "
+		green "AllPortSelect not supported"
+	fi
+	exit 0
+fi
+
 if echo "$text" | awk -v mono=$bw -v brief=$brief -F '[.:]*' '
 function blue(s)
 {
@@ -170,17 +186,17 @@ function blue(s)
 }
 
 BEGIN {
-	th["SymbolErrors"] = '$SymbolErrors'
-	th["LinkRecovers"] = '$LinkRecovers'
-	th["LinkDowned"] = '$LinkDowned'
-	th["RcvErrors"] = '$RcvErrors'
-	th["RcvRemotePhysErrors"] = '$RcvRemotePhysErrors'
-	th["RcvSwRelayErrors"] = '$RcvSwRelayErrors'
-	th["XmtDiscards"] = '$XmtDiscards'
-	th["XmtConstraintErrors"] = '$XmtConstraintErrors'
-	th["RcvConstraintErrors"] = '$RcvConstraintErrors'
-	th["LinkIntegrityErrors"] = '$LinkIntegrityErrors'
-	th["ExcBufOverrunErrors"] = '$ExcBufOverrunErrors'
+	th["SymbolErrorCounter"] = '$SymbolErrorCounter'
+	th["LinkErrorRecoveryCounter"] = '$LinkErrorRecoveryCounter'
+	th["LinkDownedCounter"] = '$LinkDownedCounter'
+	th["PortRcvErrors"] = '$PortRcvErrors'
+	th["PortRcvRemotePhysicalErrors"] = '$PortRcvRemotePhysicalErrors'
+	th["PortRcvSwitchRelayErrors"] = '$PortRcvSwitchRelayErrors'
+	th["PortXmitDiscards"] = '$PortXmitDiscards'
+	th["PortXmitConstraintErrors"] = '$PortXmitConstraintErrors'
+	th["PortRcvConstraintErrors"] = '$PortRcvConstraintErrors'
+	th["LocalLinkIntegrityErrors"] = '$LocalLinkIntegrityErrors'
+	th["ExcessiveBufferOverrunErrors"] = '$ExcessiveBufferOverrunErrors'
 	th["VL15Dropped"] = '$VL15Dropped'
 }
 
diff --git a/scripts/ibcheckerrs.in b/scripts/ibcheckerrs.in
index 305379a..4b34efc 100644
--- a/scripts/ibcheckerrs.in
+++ b/scripts/ibcheckerrs.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -30,17 +30,17 @@ function red() {
 }
 
 function show_thresholds() {
-	echo "SymbolErrors=$SymbolErrors"
-	echo "LinkRecovers=$LinkRecovers"
-	echo "LinkDowned=$LinkDowned"
-	echo "RcvErrors=$RcvErrors"
-	echo "RcvRemotePhysErrors=$RcvRemotePhysErrors"
-	echo "RcvSwRelayErrors=$RcvSwRelayErrors"
-	echo "XmtDiscards=$XmtDiscards"
-	echo "XmtConstraintErrors=$XmtConstraintErrors"
-	echo "RcvConstraintErrors=$RcvConstraintErrors"
-	echo "LinkIntegrityErrors=$LinkIntegrityErrors"
-	echo "ExcBufOverrunErrors=$ExcBufOverrunErrors"
+	echo "SymbolErrorCounter=$SymbolErrorCounter"
+	echo "LinkErrorRecoveryCounter=$LinkErrorRecoveryCounter"
+	echo "LinkDownedCounter=$LinkDownedCounter"
+	echo "PortRcvErrors=$PortRcvErrors"
+	echo "PortRcvRemotePhysicalErrors=$PortRcvRemotePhysicalErrors"
+	echo "PortRcvSwitchRelayErrors=$PortRcvSwitchRelayErrors"
+	echo "PortXmitDiscards=$PortXmitDiscards"
+	echo "PortXmitConstraintErrors=$PortXmitConstraintErrors"
+	echo "PortRcvConstraintErrors=$PortRcvConstraintErrors"
+	echo "LocalLinkIntegrityErrors=$LocalLinkIntegrityErrors"
+	echo "ExcessiveBufferOverrunErrors=$ExcessiveBufferOverrunErrors"
 	echo "VL15Dropped=$VL15Dropped"
 }
 
@@ -49,17 +49,17 @@ function get_thresholds() {
 }
 
 # Default thresholds
-SymbolErrors=10
-LinkRecovers=10
-LinkDowned=10
-RcvErrors=10
-RcvRemotePhysErrors=100
-RcvSwRelayErrors=100
-XmtDiscards=100
-XmtConstraintErrors=100
-RcvConstraintErrors=100
-LinkIntegrityErrors=10
-ExcBufOverrunErrors=10
+SymbolErrorCounter=10
+LinkErrorRecoveryCounter=10
+LinkDownedCounter=10
+PortRcvErrors=10
+PortRcvRemotePhysicalErrors=100
+PortRcvSwitchRelayErrors=100
+PortXmitDiscards=100
+PortXmitConstraintErrors=100
+PortRcvConstraintErrors=100
+LocalLinkIntegrityErrors=10
+ExcessiveBufferOverrunErrors=10
 VL15Dropped=100
 
 guid_addr=""
@@ -67,6 +67,7 @@ bw=""
 verbose=""
 brief=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -96,6 +97,9 @@ while [ "$1" ]; do
 		show_thresholds
 		exit 0
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-P | -C | -t | -timeout)
 		case $2 in
 		-*)
@@ -135,6 +139,10 @@ else
 	portname=$2
 fi
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors\"\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
@@ -155,6 +163,14 @@ nodename=`$IBPATH/smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:
 
 text="`eval $IBPATH/perfquery $ca_info $lid $portnum`"
 rv=$?
+if echo $text | grep -q 'AllPortSelect not supported'; then
+	if [ "$verbose" = "yes" ]; then
+		echo -n "Error check on lid $lid ($nodename) port $portname: "
+		green "AllPortSelect not supported"
+	fi
+	exit 0
+fi
+
 if echo "$text" | awk -v mono=$bw -v brief=$brief -F '[.:]*' '
 function blue(s)
 {
@@ -170,17 +186,17 @@ function blue(s)
 }
 
 BEGIN {
-	th["SymbolErrors"] = '$SymbolErrors'
-	th["LinkRecovers"] = '$LinkRecovers'
-	th["LinkDowned"] = '$LinkDowned'
-	th["RcvErrors"] = '$RcvErrors'
-	th["RcvRemotePhysErrors"] = '$RcvRemotePhysErrors'
-	th["RcvSwRelayErrors"] = '$RcvSwRelayErrors'
-	th["XmtDiscards"] = '$XmtDiscards'
-	th["XmtConstraintErrors"] = '$XmtConstraintErrors'
-	th["RcvConstraintErrors"] = '$RcvConstraintErrors'
-	th["LinkIntegrityErrors"] = '$LinkIntegrityErrors'
-	th["ExcBufOverrunErrors"] = '$ExcBufOverrunErrors'
+	th["SymbolErrorCounter"] = '$SymbolErrorCounter'
+	th["LinkErrorRecoveryCounter"] = '$LinkErrorRecoveryCounter'
+	th["LinkDownedCounter"] = '$LinkDownedCounter'
+	th["PortRcvErrors"] = '$PortRcvErrors'
+	th["PortRcvRemotePhysicalErrors"] = '$PortRcvRemotePhysicalErrors'
+	th["PortRcvSwitchRelayErrors"] = '$PortRcvSwitchRelayErrors'
+	th["PortXmitDiscards"] = '$PortXmitDiscards'
+	th["PortXmitConstraintErrors"] = '$PortXmitConstraintErrors'
+	th["PortRcvConstraintErrors"] = '$PortRcvConstraintErrors'
+	th["LocalLinkIntegrityErrors"] = '$LocalLinkIntegrityErrors'
+	th["ExcessiveBufferOverrunErrors"] = '$ExcessiveBufferOverrunErrors'
 	th["VL15Dropped"] = '$VL15Dropped'
 }
 
diff --git a/scripts/ibchecknet b/scripts/ibchecknet
index 6e34648..de1c59d 100644
--- a/scripts/ibchecknet
+++ b/scripts/ibchecknet
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -74,12 +74,12 @@ BEGIN {
 }
 function check_node(lid, port)
 {
-	if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
 		return 1;
 	}
-	if (system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+	if (system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 		return  2;
 	return 0;
 }
@@ -109,9 +109,9 @@ function check_node(lid, port)
 			if (check_node(lid, port) == 2)
   				pcnterr++;
 		} else if (err &&
-			   system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+			   system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 			pcnterr++;
-		if (system("'$IBPATH'/ibcheckport'"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
+		if (system("'$IBPATH'/ibcheckport -S '"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
 			if (!'$v' && oldlid != lid) {
 				print "# Checked " ntype ": nodeguid 0x" nodeguid " with failure"
 				oldlid = lid
@@ -126,6 +126,7 @@ function check_node(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors -f\""
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d bad ports found\n", nports, pe
 	printf "##          %d ports have errors beyond threshold\n", pcnterr
diff --git a/scripts/ibchecknet.in b/scripts/ibchecknet.in
index 6447835..75bc45a 100644
--- a/scripts/ibchecknet.in
+++ b/scripts/ibchecknet.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -74,12 +74,12 @@ BEGIN {
 }
 function check_node(lid, port)
 {
-	if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
 		return 1;
 	}
-	if (system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+	if (system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 		return  2;
 	return 0;
 }
@@ -109,9 +109,9 @@ function check_node(lid, port)
 			if (check_node(lid, port) == 2)
   				pcnterr++;
 		} else if (err &&
-			   system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
+			   system("'$IBPATH'/ibcheckerrs -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port))
 			pcnterr++;
-		if (system("'$IBPATH'/ibcheckport'"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
+		if (system("'$IBPATH'/ibcheckport -S '"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
 			if (!'$v' && oldlid != lid) {
 				print "# Checked " ntype ": nodeguid 0x" nodeguid " with failure"
 				oldlid = lid
@@ -126,6 +126,7 @@ function check_node(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors -f\""
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d bad ports found\n", nports, pe
 	printf "##          %d ports have errors beyond threshold\n", pcnterr
diff --git a/scripts/ibchecknode b/scripts/ibchecknode
index 1211fad..e8c33d1 100644
--- a/scripts/ibchecknode
+++ b/scripts/ibchecknode
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -56,6 +57,9 @@ while [ "$1" ]; do
 		ca_info="$ca_info $1 $2"
 		shift
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-*)
 		usage
 		;;
@@ -70,6 +74,10 @@ if [ -z "$1" ]; then
 	usage
 fi
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated; Please use \"smpquery nodeinfo\"\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
diff --git a/scripts/ibchecknode.in b/scripts/ibchecknode.in
index 5eea7b5..eac8069 100644
--- a/scripts/ibchecknode.in
+++ b/scripts/ibchecknode.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -56,6 +57,9 @@ while [ "$1" ]; do
 		ca_info="$ca_info $1 $2"
 		shift
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-*)
 		usage
 		;;
@@ -70,6 +74,10 @@ if [ -z "$1" ]; then
 	usage
 fi
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated; Please use \"smpquery nodeinfo\"\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
diff --git a/scripts/ibcheckport b/scripts/ibcheckport
index 94fdddd..0f4d7aa 100644
--- a/scripts/ibcheckport
+++ b/scripts/ibcheckport
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -56,6 +57,9 @@ while [ "$1" ]; do
 		ca_info="$ca_info $1 $2"
 		shift
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-*)
 		usage
 		;;
@@ -72,6 +76,10 @@ fi
 
 portnum=$2
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
@@ -88,10 +96,15 @@ else
 	fi
 fi
 
+is_switch=`$IBPATH/smpquery $ca_info nodeinfo $lid $portnum | awk -F '[.:]*' '/^NodeType/{ if ($2 == "Switch") {print 1}}'`
+
+if [ "$is_switch" -a "$portnum" == "0" ]; then
+	ignore_check=true
+fi
 
 text="`eval $IBPATH/smpquery $ca_info portinfo $lid $portnum`"
 rv=$?
-if echo "$text" | awk -v mono=$bw -F '[.:]*' '
+if echo "$text" | awk -v ignore_check=$ignore_check -v mono=$bw -F '[.:]*' '
 function blue(s)
 {
 	if (mono)
@@ -110,9 +123,9 @@ function blue(s)
 
 /^LinkWidthActive/{ if ($2 == "1X") warn = warn "#warn: Link configured as 1X  lid '$lid' port '$portnum'\n"}
 
-/^Lid/{ if ($2 == "0") warn = warn "#warn: Lid is not configured lid '$lid' port '$portnum'\n"}
+/^Lid/{ if (ignore_check == "0" && $2 == "0") warn = warn "#warn: Lid is not configured lid '$lid' port '$portnum'\n"}
 
-/^SMLid/{ if ($2 == "0") warn = warn "#warn: SM Lid is not configured\n"}
+/^SMLid/{ if (ignore_check == "0" && $2 == "0") warn = warn "#warn: SM Lid is not configured\n"}
 
 #/^LocalPort/	{ if ($2 != '$portnum') {err = err "#error: port " $2 " does not match query ('$portnum')\n"; exit -1}}
 
diff --git a/scripts/ibcheckport.in b/scripts/ibcheckport.in
index fa5e81e..3c8588e 100644
--- a/scripts/ibcheckport.in
+++ b/scripts/ibcheckport.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -56,6 +57,9 @@ while [ "$1" ]; do
 		ca_info="$ca_info $1 $2"
 		shift
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-*)
 		usage
 		;;
@@ -72,6 +76,10 @@ fi
 
 portnum=$2
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
@@ -88,10 +96,15 @@ else
 	fi
 fi
 
+is_switch=`$IBPATH/smpquery $ca_info nodeinfo $lid $portnum | awk -F '[.:]*' '/^NodeType/{ if ($2 == "Switch") {print 1}}'`
+
+if [ "$is_switch" -a "$portnum" == "0" ]; then
+	ignore_check=true
+fi
 
 text="`eval $IBPATH/smpquery $ca_info portinfo $lid $portnum`"
 rv=$?
-if echo "$text" | awk -v mono=$bw -F '[.:]*' '
+if echo "$text" | awk -v ignore_check=$ignore_check -v mono=$bw -F '[.:]*' '
 function blue(s)
 {
 	if (mono)
@@ -110,9 +123,9 @@ function blue(s)
 
 /^LinkWidthActive/{ if ($2 == "1X") warn = warn "#warn: Link configured as 1X  lid '$lid' port '$portnum'\n"}
 
-/^Lid/{ if ($2 == "0") warn = warn "#warn: Lid is not configured lid '$lid' port '$portnum'\n"}
+/^Lid/{ if (ignore_check == "0" && $2 == "0") warn = warn "#warn: Lid is not configured lid '$lid' port '$portnum'\n"}
 
-/^SMLid/{ if ($2 == "0") warn = warn "#warn: SM Lid is not configured\n"}
+/^SMLid/{ if (ignore_check == "0" && $2 == "0") warn = warn "#warn: SM Lid is not configured\n"}
 
 #/^LocalPort/	{ if ($2 != '$portnum') {err = err "#error: port " $2 " does not match query ('$portnum')\n"; exit -1}}
 
diff --git a/scripts/ibcheckportstate b/scripts/ibcheckportstate
index b26b9f6..7621c84 100644
--- a/scripts/ibcheckportstate
+++ b/scripts/ibcheckportstate
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -44,6 +45,9 @@ while [ "$1" ]; do
 	-v)
 		verbose=yes
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-P | -C | -t | -timeout)
 		case $2 in
 		-*)
@@ -72,6 +76,10 @@ fi
 
 portnum=$2
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
diff --git a/scripts/ibcheckportstate.in b/scripts/ibcheckportstate.in
index dc4fb14..eb5e304 100644
--- a/scripts/ibcheckportstate.in
+++ b/scripts/ibcheckportstate.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -44,6 +45,9 @@ while [ "$1" ]; do
 	-v)
 		verbose=yes
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-P | -C | -t | -timeout)
 		case $2 in
 		-*)
@@ -72,6 +76,10 @@ fi
 
 portnum=$2
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
diff --git a/scripts/ibcheckportwidth b/scripts/ibcheckportwidth
index 9f542a8..c205e88 100644
--- a/scripts/ibcheckportwidth
+++ b/scripts/ibcheckportwidth
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -44,6 +45,9 @@ while [ "$1" ]; do
 	-v)
 		verbose=yes
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-P | -C | -t | -timeout)
 		case $2 in
 		-*)
@@ -72,6 +76,10 @@ fi
 
 portnum=$2
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
@@ -103,7 +111,7 @@ function blue(s)
 }
 
 # Only check LinkWidthActive if LinkWidthSupported is not 1X
-/^LinkWidthSupported/{ if ($2 != "1X") { next } }
+/^LinkWidthSupported/{ if ($2 == "1X") { exit } }
 /^LinkWidthActive/{ if ($2 == "1X") warn = warn "#warn: Link configured as 1X  lid '$lid' port '$portnum'\n"}
 
 /^ib/	{print $0; next}
diff --git a/scripts/ibcheckportwidth.in b/scripts/ibcheckportwidth.in
index 32c5c5e..0df7a11 100644
--- a/scripts/ibcheckportwidth.in
+++ b/scripts/ibcheckportwidth.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -32,6 +32,7 @@ guid_addr=""
 bw=""
 verbose=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -44,6 +45,9 @@ while [ "$1" ]; do
 	-v)
 		verbose=yes
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-P | -C | -t | -timeout)
 		case $2 in
 		-*)
@@ -72,6 +76,10 @@ fi
 
 portnum=$2
 
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated\n\n" 1>&2
+fi
+
 if [ "$guid_addr" ]; then
 	if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
 		echo -n "guid $1 address resolution: "
@@ -103,7 +111,7 @@ function blue(s)
 }
 
 # Only check LinkWidthActive if LinkWidthSupported is not 1X
-/^LinkWidthSupported/{ if ($2 != "1X") { next } }
+/^LinkWidthSupported/{ if ($2 == "1X") { exit } }
 /^LinkWidthActive/{ if ($2 == "1X") warn = warn "#warn: Link configured as 1X  lid '$lid' port '$portnum'\n"}
 
 /^ib/	{print $0; next}
diff --git a/scripts/ibcheckstate b/scripts/ibcheckstate
index b936f7f..6e96b3b 100644
--- a/scripts/ibcheckstate
+++ b/scripts/ibcheckstate
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -77,13 +77,14 @@ BEGIN {
 function check_node(lid)
 {
 	nodechecked=1
-	if (system("'$IBPATH'/ibchecknode'"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		badnode=1
 		return
 	}
 }
 
+
 /^Ca/ || /^Switch/ || /^Rt/ {
 			nnodes++
 			ntype=$1; nodeguid=substr($3, 4, 16); ports=$2
@@ -113,7 +114,7 @@ function check_node(lid)
 		}
 		sub("\\(.*\\)", "", port)
 		gsub("[\\[\\]]", "", port)
-		if (system("'$IBPATH'/ibcheckportstate'"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
+		if (system("'$IBPATH'/ibcheckportstate -S '"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
 			if (!'$v' && oldlid != lid) {
 				print "# Checked " ntype ": nodeguid 0x" nodeguid " with failure"
 				oldlid = lid
@@ -128,6 +129,7 @@ function check_node(lid)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated\n"
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d ports with bad state found\n", nports, pe
 }
diff --git a/scripts/ibcheckstate.in b/scripts/ibcheckstate.in
index 63551d5..8f85f7b 100644
--- a/scripts/ibcheckstate.in
+++ b/scripts/ibcheckstate.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -77,13 +77,14 @@ BEGIN {
 function check_node(lid)
 {
 	nodechecked=1
-	if (system("'$IBPATH'/ibchecknode'"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		badnode=1
 		return
 	}
 }
 
+
 /^Ca/ || /^Switch/ || /^Rt/ {
 			nnodes++
 			ntype=$1; nodeguid=substr($3, 4, 16); ports=$2
@@ -113,7 +114,7 @@ function check_node(lid)
 		}
 		sub("\\(.*\\)", "", port)
 		gsub("[\\[\\]]", "", port)
-		if (system("'$IBPATH'/ibcheckportstate'"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
+		if (system("'$IBPATH'/ibcheckportstate -S '"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
 			if (!'$v' && oldlid != lid) {
 				print "# Checked " ntype ": nodeguid 0x" nodeguid " with failure"
 				oldlid = lid
@@ -128,6 +129,7 @@ function check_node(lid)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated\n"
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d ports with bad state found\n", nports, pe
 }
diff --git a/scripts/ibcheckwidth b/scripts/ibcheckwidth
index e59b80d..084c242 100644
--- a/scripts/ibcheckwidth
+++ b/scripts/ibcheckwidth
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -77,7 +77,7 @@ BEGIN {
 function check_node(lid)
 {
 	nodechecked=1
-	if (system("'$IBPATH'/ibchecknode'"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		badnode=1
 		return
@@ -113,7 +113,7 @@ function check_node(lid)
 		}
 		sub("\\(.*\\)", "", port)
 		gsub("[\\[\\]]", "", port)
-		if (system("'$IBPATH'/ibcheckportwidth'"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
+		if (system("'$IBPATH'/ibcheckportwidth -S '"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
 			if (!'$v' && oldlid != lid) {
 				print "# Checked " ntype ": nodeguid 0x" nodeguid " with failure"
 				oldlid = lid
@@ -128,6 +128,7 @@ function check_node(lid)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated\n"
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d ports with 1x width in error found\n", nports, pe
 }
diff --git a/scripts/ibcheckwidth.in b/scripts/ibcheckwidth.in
index 6b723c5..bf917fb 100644
--- a/scripts/ibcheckwidth.in
+++ b/scripts/ibcheckwidth.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -77,7 +77,7 @@ BEGIN {
 function check_node(lid)
 {
 	nodechecked=1
-	if (system("'$IBPATH'/ibchecknode'"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		badnode=1
 		return
@@ -113,7 +113,7 @@ function check_node(lid)
 		}
 		sub("\\(.*\\)", "", port)
 		gsub("[\\[\\]]", "", port)
-		if (system("'$IBPATH'/ibcheckportwidth'"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
+		if (system("'$IBPATH'/ibcheckportwidth -S '"$ca_info"' '$gflags' '$verbose' " lid " " port)) {
 			if (!'$v' && oldlid != lid) {
 				print "# Checked " ntype ": nodeguid 0x" nodeguid " with failure"
 				oldlid = lid
@@ -128,6 +128,7 @@ function check_node(lid)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated\n"
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked, %d ports with 1x width in error found\n", nports, pe
 }
diff --git a/scripts/ibclearcounters b/scripts/ibclearcounters
index f32d962..c0891b0 100644
--- a/scripts/ibclearcounters
+++ b/scripts/ibclearcounters
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -101,6 +101,7 @@ function clear_port_counters(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors -K\"\n"
 	printf "\n## Summary: %d nodes cleared %d errors\n", nnodes, nodeerr
 }
 '
diff --git a/scripts/ibclearcounters.in b/scripts/ibclearcounters.in
index 86a5528..318fa84 100644
--- a/scripts/ibclearcounters.in
+++ b/scripts/ibclearcounters.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -101,6 +101,7 @@ function clear_port_counters(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors -K\"\n"
 	printf "\n## Summary: %d nodes cleared %d errors\n", nnodes, nodeerr
 }
 '
diff --git a/scripts/ibclearerrors b/scripts/ibclearerrors
index c3fcf3f..9a71ecf 100644
--- a/scripts/ibclearerrors
+++ b/scripts/ibclearerrors
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -105,6 +105,7 @@ function clear_errors(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors -k\"\n"
 	printf "\n## Summary: %d nodes cleared %d errors\n", nnodes, nodeerr
 }
 '
diff --git a/scripts/ibclearerrors.in b/scripts/ibclearerrors.in
index 3dfb96b..4329ae6 100644
--- a/scripts/ibclearerrors.in
+++ b/scripts/ibclearerrors.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -105,6 +105,7 @@ function clear_errors(lid, port)
 /iberror:/	{print $0}
 
 END {
+	printf "\n*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors -k\"\n"
 	printf "\n## Summary: %d nodes cleared %d errors\n", nnodes, nodeerr
 }
 '
diff --git a/scripts/ibdatacounters b/scripts/ibdatacounters
index d65c752..4505f0d 100644
--- a/scripts/ibdatacounters
+++ b/scripts/ibdatacounters
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -80,12 +80,12 @@ BEGIN {
 }
 function check_node(lid, port)
 {
-	if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
 		return 1;
 	}
-	return system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
+	return system("'$IBPATH'/ibdatacounts -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
 }
 
 /^Ca/ || /^Switch/ || /^Rt/ {
@@ -112,7 +112,7 @@ function check_node(lid, port)
 			lid = substr(lid, 1, index(lid, " ") - 1)
 			check_node(lid, port)
 		} else if (err)
-			system("'$IBPATH'/ibdatacounts '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
+			system("'$IBPATH'/ibdatacounts -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
 }
 
 /^ib/	{print $0; next}
@@ -121,9 +121,11 @@ function check_node(lid, port)
 /iberror:/	{print $0}
 
 END {
+   printf "*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors --counters\n"
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked\n", nports
 	exit (ne )
 }
 '
+
 exit $rv
diff --git a/scripts/ibdatacounters.in b/scripts/ibdatacounters.in
index 5967406..d7bf185 100644
--- a/scripts/ibdatacounters.in
+++ b/scripts/ibdatacounters.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -80,12 +80,12 @@ BEGIN {
 }
 function check_node(lid, port)
 {
-	if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
+	if (system("'$IBPATH'/ibchecknode -S '"$ca_info"' '$gflags' '$verbose' " lid)) {
 		ne++
 		print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
 		return 1;
 	}
-	return system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
+	return system("'$IBPATH'/ibdatacounts -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
 }
 
 /^Ca/ || /^Switch/ || /^Rt/ {
@@ -112,7 +112,7 @@ function check_node(lid, port)
 			lid = substr(lid, 1, index(lid, " ") - 1)
 			check_node(lid, port)
 		} else if (err)
-			system("'$IBPATH'/ibdatacounts '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
+			system("'$IBPATH'/ibdatacounts -S '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
 }
 
 /^ib/	{print $0; next}
@@ -121,9 +121,11 @@ function check_node(lid, port)
 /iberror:/	{print $0}
 
 END {
+   printf "*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors --counters\n"
 	printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
 	printf "##          %d ports checked\n", nports
 	exit (ne )
 }
 '
+
 exit $rv
diff --git a/scripts/ibdatacounts b/scripts/ibdatacounts
index 8ab4a79..d1ab302 100644
--- a/scripts/ibdatacounts
+++ b/scripts/ibdatacounts
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
@@ -34,6 +34,7 @@ bw=""
 verbose=""
 brief=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -63,6 +64,9 @@ while [ "$1" ]; do
 		ca_info="$ca_info $1 $2"
 		shift
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-*)
 		usage
 		;;
@@ -106,7 +110,11 @@ else
 	fi
 fi
 
-nodename=`smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:\.*\(.*\)/\1/"`
+nodename=`$IBPATH/smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:\.*\(.*\)/\1/"`
+
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors --counters\"\n\n" 1>&2
+fi
 
 text="`eval $IBPATH/perfquery $ca_info $lid $portnum`"
 rv=$?
diff --git a/scripts/ibdatacounts.in b/scripts/ibdatacounts.in
index 3dbc56a..ed5f85d 100644
--- a/scripts/ibdatacounts.in
+++ b/scripts/ibdatacounts.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
@@ -34,6 +34,7 @@ bw=""
 verbose=""
 brief=""
 ca_info=""
+suppress_deprecated="no"
 
 while [ "$1" ]; do
 	case $1 in
@@ -63,6 +64,9 @@ while [ "$1" ]; do
 		ca_info="$ca_info $1 $2"
 		shift
 		;;
+	-S)
+		suppress_deprecated="yes"
+		;;
 	-*)
 		usage
 		;;
@@ -106,7 +110,11 @@ else
 	fi
 fi
 
-nodename=`smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:\.*\(.*\)/\1/"`
+nodename=`$IBPATH/smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:\.*\(.*\)/\1/"`
+
+if [ "$suppress_deprecated" = "no" ]; then
+echo "*** WARNING ***: this command is deprecated; Please use \"ibqueryerrors --counters\"\n\n" 1>&2
+fi
 
 text="`eval $IBPATH/perfquery $ca_info $lid $portnum`"
 rv=$?
diff --git a/scripts/ibdiscover.pl b/scripts/ibdiscover.pl
index 8606919..1462584 100755
--- a/scripts/ibdiscover.pl
+++ b/scripts/ibdiscover.pl
@@ -1,5 +1,9 @@
 #!/usr/bin/perl
 
+printf (STDERR "*** WARNING ***; this command is deprecated;\n");
+printf (STDERR "                 see ibnetdiscover cache features\n");
+printf (STDERR "                 and/or iblinkinfo \"check\" features\n\n");
+
 #
 # Read mapfile
 #
@@ -84,3 +88,8 @@ foreach $el (keys %topo) {
 			$val{$lg}, $val{$rg});
 	}
 }
+
+printf (STDERR "*** WARNING ***; this command is deprecated;\n");
+printf (STDERR "                 see ibnetdiscover cache features\n");
+printf (STDERR "                 and/or iblinkinfo \"check\" features\n\n");
+
diff --git a/scripts/ibhosts b/scripts/ibhosts
index c1bf104..c3aaba6 100644
--- a/scripts/ibhosts
+++ b/scripts/ibhosts
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
 function usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t(imeout) timeout_ms]"
+	    "-P ca_port -t timeout_ms]"
 	exit -1
 }
 
@@ -13,10 +13,10 @@ ca_info=""
 
 while [ "$1" ]; do
 	case $1 in
-	-h)
+	-h | --help)
 		usage
 		;;
-	-P | -C | -t | -timeout)
+	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
 			usage
diff --git a/scripts/ibhosts.in b/scripts/ibhosts.in
index baba105..20abdf3 100644
--- a/scripts/ibhosts.in
+++ b/scripts/ibhosts.in
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
 function usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t(imeout) timeout_ms]"
+	    "-P ca_port -t timeout_ms]"
 	exit -1
 }
 
@@ -13,10 +13,10 @@ ca_info=""
 
 while [ "$1" ]; do
 	case $1 in
-	-h)
+	-h | --help)
 		usage
 		;;
-	-P | -C | -t | -timeout)
+	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
 			usage
diff --git a/scripts/ibidsverify.pl b/scripts/ibidsverify.pl
index 0d017ba..cf290de 100755
--- a/scripts/ibidsverify.pl
+++ b/scripts/ibidsverify.pl
@@ -37,6 +37,8 @@ use strict;
 use Getopt::Std;
 use IBswcountlimits;
 
+my $return_code = 0;
+
 sub usage_and_exit
 {
 	my $prog = $_[0];
@@ -46,16 +48,22 @@ sub usage_and_exit
 	print "   -h This help message\n";
 	print
 "   -R Recalculate ibnetdiscover information (Default is to reuse ibnetdiscover output)\n";
+	print "   -C <ca_name> use selected Channel Adaptor name for queries\n";
+	print "   -P <ca_port> use selected channel adaptor port for queries\n";
 	exit 2;
 }
 
 my $argv0          = `basename $0`;
 my $regenerate_map = undef;
+my $ca_name        = "";
+my $ca_port        = "";
 
 chomp $argv0;
-if (!getopts("hR")) { usage_and_exit $argv0; }
+if (!getopts("hRC:P:"))          { usage_and_exit $argv0; }
 if (defined $Getopt::Std::opt_h) { usage_and_exit $argv0; }
 if (defined $Getopt::Std::opt_R) { $regenerate_map = $Getopt::Std::opt_R; }
+if (defined $Getopt::Std::opt_C) { $ca_name        = $Getopt::Std::opt_C; }
+if (defined $Getopt::Std::opt_P) { $ca_port        = $Getopt::Std::opt_P; }
 
 sub validate_non_zero_lid
 {
@@ -100,10 +108,13 @@ sub insert_lid
 		if (defined($insert_lid::lids{$lid})) {
 			print
 "LID $lid already defined for NodeGUID $insert_lid::lids{$lid}->{nodeguid}\n";
+			$return_code = 1;
 		} else {
 			$rec = {lid => $lid, nodeguid => $nodeguid};
 			$insert_lid::lids{$lid} = $rec;
 		}
+	} else {
+		$return_code = $status;
 	}
 }
 
@@ -120,22 +131,25 @@ sub insert_nodeguid
 		if (defined($insert_nodeguid::nodeguids{$nodeguid})) {
 			print
 "NodeGUID $nodeguid already defined for LID $insert_nodeguid::nodeguids{$nodeguid}->{lid}\n";
+			$return_code = 1;
 		} else {
 			$rec = {lid => $lid, nodeguid => $nodeguid};
 			$insert_nodeguid::nodeguids{$nodeguid} = $rec;
 		}
+	} else {
+		$return_code = $status;
 	}
 }
 
 sub validate_portguid
 {
 	my ($portguid)  = shift(@_);
-	my ($firstport) = shift(@_);
+	my ($nodeguid)  = shift(@_);
 
-	if (defined($insert_nodeguid::nodeguids{$portguid})
-		&& ($firstport ne "yes"))
-	{
-		print "PortGUID $portguid is invalid duplicate of a NodeGUID\n";
+	if (($nodeguid ne $portguid)
+		&& defined($insert_nodeguid::nodeguids{$portguid})) {
+		print "PortGUID $portguid is an invalid duplicate of a NodeGUID\n";
+		$return_code = 1;
 	}
 }
 
@@ -144,7 +158,7 @@ sub insert_portguid
 	my ($lid)       = shift(@_);
 	my ($portguid)  = shift(@_);
 	my ($nodetype)  = shift(@_);
-	my ($firstport) = shift(@_);
+	my ($nodeguid)  = shift(@_);
 	my $rec         = undef;
 	my $status      = "";
 
@@ -153,23 +167,25 @@ sub insert_portguid
 		if (defined($insert_portguid::portguids{$portguid})) {
 			print
 "PortGUID $portguid already defined for LID $insert_portguid::portguids{$portguid}->{lid}\n";
+			$return_code = 1;
 		} else {
 			$rec = {lid => $lid, portguid => $portguid};
 			$insert_portguid::portguids{$portguid} = $rec;
-			validate_portguid($portguid, $firstport);
+			validate_portguid($portguid, $nodeguid);
 		}
+	} else {
+		$return_code = $status;
 	}
 }
 
 sub main
 {
-	if ($regenerate_map
-		|| !(-f "$IBswcountlimits::cache_dir/ibnetdiscover.topology"))
-	{
-		generate_ibnetdiscover_topology;
-	}
+	my $cache_file = get_cache_file($ca_name, $ca_port);
 
-	open IBNET_TOPO, "<$IBswcountlimits::cache_dir/ibnetdiscover.topology"
+	if ($regenerate_map || !(-f "$cache_file")) {
+		generate_ibnetdiscover_topology($ca_name, $ca_port);
+	}
+	open IBNET_TOPO, "<$cache_file"
 	  or die "Failed to open ibnet topology: $!\n";
 
 	my $nodetype  = "";
@@ -203,7 +219,7 @@ sub main
 			insert_lid($lid, $nodeguid, $nodetype);
 			insert_nodeguid($lid, $nodeguid, $nodetype);
 			if ($portguid ne "") {
-				insert_portguid($lid, $portguid, $nodetype, $firstport);
+				insert_portguid($lid, $portguid, $nodetype, $nodeguid);
 			}
 		}
 		if ($line =~ /^Ca.*/) {
@@ -242,7 +258,7 @@ sub main
 			}
 			if ($line =~ /^\[(\d+)\]\((.*)\)/) {
 				$portguid = "0x" . $2;
-				insert_portguid($lid, $portguid, $nodetype, $firstport);
+				insert_portguid($lid, $portguid, $nodetype, $nodeguid);
 			}
 		}
 
@@ -252,3 +268,5 @@ sub main
 }
 main;
 
+exit ($return_code);
+
diff --git a/scripts/iblinkinfo.pl b/scripts/iblinkinfo.pl
old mode 100755
new mode 100644
index b6b27ce..575a45a
--- a/scripts/iblinkinfo.pl
+++ b/scripts/iblinkinfo.pl
@@ -1,7 +1,6 @@
 #!/usr/bin/perl
 #
-# Copyright (c) 2006 The Regents of the University of California.
-# Copyright (c) 2007-2008 Voltaire, Inc. All rights reserved.
+# Copyright (c) 2009 Lawrence Livermore National Security
 #
 # Produced at Lawrence Livermore National Laboratory.
 # Written by Ira Weiny <weiny2 at llnl.gov>.
@@ -35,293 +34,9 @@
 # SOFTWARE.
 #
 
-use strict;
 
-use Getopt::Std;
-use IBswcountlimits;
-
-sub usage_and_exit
-{
-	my $prog = $_[0];
-	print
-"Usage: $prog [-Rhclp -S <guid> -D <direct route> -C <ca_name> -P <ca_port>]\n";
-	print
-"   Report link speed and connection for each port of each switch which is active\n";
-	print "   -h This help message\n";
-	print
-"   -R Recalculate ibnetdiscover information (Default is to reuse ibnetdiscover output)\n";
-	print
-"   -D <direct route> output only the switch specified by direct route path\n";
-	print "   -S <guid> output only the switch specified by <guid> (hex format)\n";
-	print "   -d print only down links\n";
-	print
-	  "   -l (line mode) print all information for each link on each line\n";
-	print
-"   -p print additional switch settings (PktLifeTime,HoqLife,VLStallCount)\n";
-	print "   -c print port capabilities (enabled/supported values)\n";
-	print "   -C <ca_name> use selected Channel Adaptor name for queries\n";
-	print "   -P <ca_port> use selected channel adaptor port for queries\n";
-	print "   -g print port guids instead of node guids\n";
-	exit 2;
-}
-
-my $argv0              = `basename $0`;
-my $regenerate_map     = undef;
-my $single_switch      = undef;
-my $direct_route       = undef;
-my $line_mode          = undef;
-my $print_add_switch   = undef;
-my $print_extended_cap = undef;
-my $only_down_links    = undef;
-my $ca_name            = "";
-my $ca_port            = "";
-my $print_port_guids   = undef;
-my $switch_found       = "no";
-chomp $argv0;
-
-if (!getopts("hcpldRS:D:C:P:g")) { usage_and_exit $argv0; }
-if (defined $Getopt::Std::opt_h) { usage_and_exit $argv0; }
-if (defined $Getopt::Std::opt_D) { $direct_route   = $Getopt::Std::opt_D; }
-if (defined $Getopt::Std::opt_R) { $regenerate_map = $Getopt::Std::opt_R; }
-if (defined $Getopt::Std::opt_S) {
-	$single_switch = format_guid($Getopt::Std::opt_S);
-}
-if (defined $Getopt::Std::opt_d) { $only_down_links    = $Getopt::Std::opt_d; }
-if (defined $Getopt::Std::opt_l) { $line_mode          = $Getopt::Std::opt_l; }
-if (defined $Getopt::Std::opt_p) { $print_add_switch   = $Getopt::Std::opt_p; }
-if (defined $Getopt::Std::opt_c) { $print_extended_cap = $Getopt::Std::opt_c; }
-if (defined $Getopt::Std::opt_C) { $ca_name            = $Getopt::Std::opt_C; }
-if (defined $Getopt::Std::opt_P) { $ca_port            = $Getopt::Std::opt_P; }
-if (defined $Getopt::Std::opt_g) { $print_port_guids   = $Getopt::Std::opt_g; }
-
-my $extra_smpquery_params = get_ca_name_port_param_string($ca_name, $ca_port);
-
-sub main
-{
-	get_link_ends($regenerate_map, $ca_name, $ca_port);
-	if (defined($direct_route)) {
-		# convert DR to guid, then use original single_switch option
-		$single_switch = convert_dr_to_guid($direct_route);
-		if (!defined($single_switch) || !is_switch($single_switch)) {
-			printf("The direct route (%s) does not map to a switch.\n",
-				$direct_route);
-			return;
-		}
-	}
-	foreach my $switch (sort (keys(%IBswcountlimits::link_ends))) {
-		if ($single_switch && $switch ne $single_switch) {
-			next;
-		} else {
-			$switch_found = "yes";
-		}
-		my $switch_prompt = "no";
-		my $num_ports = get_num_ports($switch, $ca_name, $ca_port);
-		if ($num_ports == 0) {
-			printf("ERROR: switch $switch has 0 ports???\n");
-		}
-		my @output_lines    = undef;
-		my $pkt_lifetime    = "";
-		my $pkt_life_prompt = "";
-		my $port_timeouts   = "";
-		my $print_switch    = "yes";
-		if ($only_down_links) { $print_switch = "no"; }
-		if ($print_add_switch) {
-			my $data = `smpquery $extra_smpquery_params -G switchinfo $switch`;
-			if ($data eq "") {
-				printf("ERROR: failed to get switchinfo for $switch\n");
-			}
-			my @lines = split("\n", $data);
-			foreach my $line (@lines) {
-				if ($line =~ /^LifeTime:\.+(.*)/) { $pkt_lifetime = $1; }
-			}
-			$pkt_life_prompt = sprintf(" (LT: %2s)", $pkt_lifetime);
-		}
-		foreach my $port (1 .. $num_ports) {
-			my $hr = $IBswcountlimits::link_ends{$switch}{$port};
-			if ($switch_prompt eq "no" && !$line_mode) {
-				my $switch_name = "";
-				my $tmp_port = $port;
-				while ($switch_name eq "" && $tmp_port <= $num_ports) {
-					# the first port is down find switch name with up port
-					my $hr = $IBswcountlimits::link_ends{$switch}{$tmp_port};
-					$switch_name = $hr->{loc_desc};
-					$tmp_port++;
-				}
-				if ($switch_name eq "") {
-					printf(
-						"WARNING: Switch Name not found for $switch\n");
-				}
-				push(
-					@output_lines,
-					sprintf(
-						"Switch %18s %s%s:\n",
-						$switch, $switch_name, $pkt_life_prompt
-					)
-				);
-				$switch_prompt = "yes";
-			}
-			my $data =
-			  `smpquery $extra_smpquery_params -G portinfo $switch $port`;
-			if ($data eq "") {
-				printf(
-					"ERROR: failed to get portinfo for $switch port $port\n");
-			}
-			my @lines          = split("\n", $data);
-			my $speed          = "";
-			my $speed_sup      = "";
-			my $speed_enable   = "";
-			my $width          = "";
-			my $width_sup      = "";
-			my $width_enable   = "";
-			my $state          = "";
-			my $hoq_life       = "";
-			my $vl_stall       = "";
-			my $phy_link_state = "";
-
-			foreach my $line (@lines) {
-				if ($line =~ /^LinkSpeedActive:\.+(.*)/) { $speed = $1; }
-				if ($line =~ /^LinkSpeedEnabled:\.+(.*)/) {
-					$speed_enable = $1;
-				}
-				if ($line =~ /^LinkSpeedSupported:\.+(.*)/) { $speed_sup = $1; }
-				if ($line =~ /^LinkWidthActive:\.+(.*)/)    { $width     = $1; }
-				if ($line =~ /^LinkWidthEnabled:\.+(.*)/) {
-					$width_enable = $1;
-				}
-				if ($line =~ /^LinkWidthSupported:\.+(.*)/) { $width_sup = $1; }
-				if ($line =~ /^LinkState:\.+(.*)/)          { $state     = $1; }
-				if ($line =~ /^HoqLife:\.+(.*)/)            { $hoq_life  = $1; }
-				if ($line =~ /^VLStallCount:\.+(.*)/)       { $vl_stall  = $1; }
-				if ($line =~ /^PhysLinkState:\.+(.*)/) { $phy_link_state = $1; }
-			}
-			my $rem_port         = $hr->{rem_port};
-			my $rem_lid          = $hr->{rem_lid};
-			my $rem_speed_sup    = "";
-			my $rem_speed_enable = "";
-			my $rem_width_sup    = "";
-			my $rem_width_enable = "";
-			if ($rem_lid ne "" && $rem_port ne "") {
-				$data =
-				  `smpquery $extra_smpquery_params portinfo $rem_lid $rem_port`;
-				if ($data eq "") {
-					printf(
-						"ERROR: failed to get portinfo for $switch port $port\n"
-					);
-				}
-				my @lines = split("\n", $data);
-				foreach my $line (@lines) {
-					if ($line =~ /^LinkSpeedEnabled:\.+(.*)/) {
-						$rem_speed_enable = $1;
-					}
-					if ($line =~ /^LinkSpeedSupported:\.+(.*)/) {
-						$rem_speed_sup = $1;
-					}
-					if ($line =~ /^LinkWidthEnabled:\.+(.*)/) {
-						$rem_width_enable = $1;
-					}
-					if ($line =~ /^LinkWidthSupported:\.+(.*)/) {
-						$rem_width_sup = $1;
-					}
-				}
-			}
-			my $capabilities = "";
-			if ($print_extended_cap) {
-				$capabilities = sprintf("(%3s %s %6s / %8s [%s/%s][%s/%s])",
-					$width, $speed, $state, $phy_link_state, $width_enable,
-					$width_sup, $speed_enable, $speed_sup);
-			} else {
-				$capabilities = sprintf("(%3s %s %6s / %8s)",
-					$width, $speed, $state, $phy_link_state);
-			}
-			if ($print_add_switch) {
-				$port_timeouts =
-				  sprintf(" (HOQ:%s VL_Stall:%s)", $hoq_life, $vl_stall);
-			}
-			if (!$only_down_links || ($only_down_links && $state eq "Down")) {
-				my $width_msg = "";
-				my $speed_msg = "";
-				if ($rem_width_enable ne "" && $rem_width_sup ne "") {
-					if (   $width_enable =~ /12X/
-						&& $rem_width_enable =~ /12X/
-						&& $width !~ /12X/)
-					{
-						$width_msg = "Could be 12X";
-					} else {
-						if (   $width_enable =~ /8X/
-							&& $rem_width_enable =~ /8X/
-							&& $width !~ /8X/)
-						{
-							$width_msg = "Could be 8X";
-						} else {
-							if (   $width_enable =~ /4X/
-								&& $rem_width_enable =~ /4X/
-								&& $width !~ /4X/)
-							{
-								$width_msg = "Could be 4X";
-							}
-						}
-					}
-				}
-				if ($rem_speed_enable ne "" && $rem_speed_sup ne "") {
-					if (   $speed_enable =~ /10\.0/
-						&& $rem_speed_enable =~ /10\.0/
-						&& $speed !~ /10\.0/)
-					{
-						$speed_msg = "Could be 10.0 Gbps";
-					} else {
-						if (   $speed_enable =~ /5\.0/
-							&& $rem_speed_enable =~ /5\.0/
-							&& $speed !~ /5\.0/)
-						{
-							$speed_msg = "Could be 5.0 Gbps";
-						}
-					}
-				}
-
-				if ($line_mode) {
-					my $line_begin = sprintf("%18s \"%30s\"%s",
-						$switch, $hr->{loc_desc}, $pkt_life_prompt);
-					my $ext_guid = sprintf("%18s", $hr->{rem_guid});
-					if ($print_port_guids && $hr->{rem_port_guid} ne "") {
-						$ext_guid = sprintf("0x%016s", $hr->{rem_port_guid});
-					}
-					push(
-						@output_lines,
-						sprintf(
-"%s %6s %4s[%2s]  ==%s%s==>  %18s %6s %4s[%2s] \"%s\" ( %s %s)\n",
-							$line_begin,     $hr->{loc_sw_lid},
-							$port,           $hr->{loc_ext_port},
-							$capabilities,   $port_timeouts,
-							$ext_guid,       $hr->{rem_lid},
-							$hr->{rem_port}, $hr->{rem_ext_port},
-							$hr->{rem_desc}, $width_msg,
-							$speed_msg
-						)
-					);
-				} else {
-					push(
-						@output_lines,
-						sprintf(
-" %6s %4s[%2s]  ==%s%s==>  %6s %4s[%2s] \"%s\" ( %s %s)\n",
-							$hr->{loc_sw_lid},   $port,
-							$hr->{loc_ext_port}, $capabilities,
-							$port_timeouts,      $hr->{rem_lid},
-							$hr->{rem_port},     $hr->{rem_ext_port},
-							$hr->{rem_desc},     $width_msg,
-							$speed_msg
-						)
-					);
-				}
-				$print_switch = "yes";
-			}
-		}
-		if ($print_switch eq "yes") {
-			foreach my $line (@output_lines) { print $line; }
-		}
-	}
-	if ($single_switch && $switch_found ne "yes") {
-		printf("Switch \"%s\" not found.\n", $single_switch);
-	}
-}
-main;
+# this is now just a wrapper for the C based utility
+$str = join " ", at ARGV;
+system "/usr/local/sbin/iblinkinfo $str";
+printf (STDERR "\n*** WARNING ***: this command has been replaced by iblinkinfo\n\n");
 
diff --git a/scripts/iblinkinfo.pl.in b/scripts/iblinkinfo.pl.in
new file mode 100755
index 0000000..865be49
--- /dev/null
+++ b/scripts/iblinkinfo.pl.in
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+#
+# Copyright (c) 2009 Lawrence Livermore National Security
+#
+# Produced at Lawrence Livermore National Laboratory.
+# Written by Ira Weiny <weiny2 at llnl.gov>.
+#
+# This software is available to you under a choice of one of two
+# licenses.  You may choose to be licensed under the terms of the GNU
+# General Public License (GPL) Version 2, available from the file
+# COPYING in the main directory of this source tree, or the
+# OpenIB.org BSD license below:
+#
+#     Redistribution and use in source and binary forms, with or
+#     without modification, are permitted provided that the following
+#     conditions are met:
+#
+#      - Redistributions of source code must retain the above
+#        copyright notice, this list of conditions and the following
+#        disclaimer.
+#
+#      - Redistributions in binary form must reproduce the above
+#        copyright notice, this list of conditions and the following
+#        disclaimer in the documentation and/or other materials
+#        provided with the distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
+
+# this is now just a wrapper for the C based utility
+$str = join " ", at ARGV;
+system "@IBSCRIPTPATH@/iblinkinfo $str";
+printf (STDERR "\n*** WARNING ***: this command has been replaced by iblinkinfo\n\n");
+
diff --git a/scripts/ibnodes b/scripts/ibnodes
index 341e643..5a0f653 100644
--- a/scripts/ibnodes
+++ b/scripts/ibnodes
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
diff --git a/scripts/ibnodes.in b/scripts/ibnodes.in
index 5871da8..0726efc 100644
--- a/scripts/ibnodes.in
+++ b/scripts/ibnodes.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
diff --git a/scripts/ibprintca.pl b/scripts/ibprintca.pl
index 3cac9b4..598229d 100755
--- a/scripts/ibprintca.pl
+++ b/scripts/ibprintca.pl
@@ -40,6 +40,8 @@ use strict;
 use Getopt::Std;
 use IBswcountlimits;
 
+printf (STDERR "*** WARNING ***: this command is deprecated; Please use \"ibhosts\"\n\n");
+
 # =========================================================================
 #
 sub usage_and_exit
@@ -122,6 +124,13 @@ sub main
 		}
 
 	}
+
+	if ($in_hca eq "yes") {
+		foreach my $port (sort { $a <=> $b } (keys %ports)) {
+			print $ports{$port};
+		}
+	}
+
 	if ($found_hca == 0) {
 		die "\"$target_hca\" not found\n" .
 			"   Try running with the \"-R\" option.\n" .
diff --git a/scripts/ibprintrt.pl b/scripts/ibprintrt.pl
index 48c20f8..616be88 100755
--- a/scripts/ibprintrt.pl
+++ b/scripts/ibprintrt.pl
@@ -40,6 +40,8 @@ use strict;
 use Getopt::Std;
 use IBswcountlimits;
 
+printf (STDERR "*** WARNING ***: this command is deprecated; Please use \"ibrouters\"\n\n");
+
 # =========================================================================
 #
 sub usage_and_exit
diff --git a/scripts/ibprintswitch.pl b/scripts/ibprintswitch.pl
index f20bd4b..69d506a 100755
--- a/scripts/ibprintswitch.pl
+++ b/scripts/ibprintswitch.pl
@@ -40,6 +40,8 @@ use strict;
 use Getopt::Std;
 use IBswcountlimits;
 
+printf (STDERR "*** WARNING ***: this command is deprecated; Please use \"ibswitches\"\n\n");
+
 # =========================================================================
 #
 sub usage_and_exit
diff --git a/scripts/ibqueryerrors.pl b/scripts/ibqueryerrors.pl
old mode 100755
new mode 100644
index 99adac7..aab4ecb
--- a/scripts/ibqueryerrors.pl
+++ b/scripts/ibqueryerrors.pl
@@ -1,7 +1,6 @@
 #!/usr/bin/perl
 #
-# Copyright (c) 2008 Voltaire, Inc. All rights reserved.
-# Copyright (c) 2006 The Regents of the University of California.
+# Copyright (c) 2009 Lawrence Livermore National Security
 #
 # Produced at Lawrence Livermore National Laboratory.
 # Written by Ira Weiny <weiny2 at llnl.gov>.
@@ -35,196 +34,8 @@
 # SOFTWARE.
 #
 
-use strict;
-
-use Getopt::Std;
-use IBswcountlimits;
-
-my $print_action          = "no";
-my $report_port_info      = undef;
-my $single_switch         = undef;
-my $include_data_counters = undef;
-my $cache_file            = "";
-my $switch_found          = "no";
-
-# =========================================================================
-#
-sub report_counts
-{
-	my $addr         = $_[0];
-	my $port         = $_[1];
-	my $ca_name      = $_[2];
-	my $ca_port      = $_[3];
-	my $extra_params = get_ca_name_port_param_string($ca_name, $ca_port);
-
-	if (any_counts()) {
-		print("   GUID $addr port $port:");
-		check_counters($print_action);
-		if ($include_data_counters) {
-			check_data_counters($print_action);
-		}
-		print("\n");
-
-		if ($report_port_info) {
-			my $lid   = "";
-			my $speed = "";
-			my $width = "";
-			my $data  = `smpquery $extra_params -G portinfo $addr $port`;
-			my @lines = split("\n", $data);
-			foreach my $line (@lines) {
-				if ($line =~ /^# Port info: Lid (\w+) port.*/) { $lid   = $1; }
-				if ($line =~ /^LinkSpeedActive:\.+(.*)/)       { $speed = $1; }
-				if ($line =~ /^LinkWidthActive:\.+(.*)/)       { $width = $1; }
-			}
-			my $hr = $IBswcountlimits::link_ends{"$addr"}{$port};
-			if ($hr) {
-				printf(
-"         Link info: %6s %4s[%2s]  ==(%3s %s)==>  %18s %4s[%2s] \"%s\"\n",
-					$lid,                $port,
-					$hr->{loc_ext_port}, $width,
-					$speed,              $hr->{rem_guid},
-					$hr->{rem_port},     $hr->{rem_ext_port},
-					$hr->{rem_desc}
-				);
-			} else {
-				printf(
-"         Link info: %6s %4s[  ]  ==(%3s %s)==>     (Disconnected)\n",
-					$lid, $port, $width, $speed);
-			}
-		}
-	}
-}
-
-# =========================================================================
-# use perfquery to get the counters.
-sub get_counts
-{
-	my $addr         = $_[0];
-	my $port         = $_[1];
-	my $ca_name      = $_[2];
-	my $ca_port      = $_[3];
-	my $extra_params = get_ca_name_port_param_string($ca_name, $ca_port);
-
-	my $data = `perfquery $extra_params -G $addr $port` ||
-		die "'perfquery $extra_params -G $addr $port' FAILED.\n";
-	my @lines = split("\n", $data);
-	foreach my $line (@lines) {
-		foreach my $count (@IBswcountlimits::counters) {
-			if ($line =~ /^$count:\.+(\d+)/) {
-				$IBswcountlimits::cur_counts{$count} = $1;
-			}
-		}
-	}
-}
-
-# =========================================================================
-#
-my %switches = ();
-
-sub get_switches
-{
-	my $data = `ibswitches $cache_file` ||
-		die "'ibswitches $cache_file' failed.\n";
-	my @lines = split("\n", $data);
-	foreach my $line (@lines) {
-		if ($line =~ /^Switch\s+:\s+(\w+)\s+ports\s+(\d+)\s+.*/) {
-			$switches{$1} = $2;
-		}
-	}
-}
-
-# =========================================================================
-#
-sub usage_and_exit
-{
-	my $prog = $_[0];
-	print
-"Usage: $prog [-a -c -r -R -s <err1,err2,...> -S <switch_guid> -D <direct route> -d -C <ca_name> -P <ca_port>]\n";
-	print "   Report counters on all switches in subnet\n";
-	print "   -a Report an action to take\n";
-	print "   -c suppress some of the common counters\n";
-	print "   -r report port configuration information\n";
-	print "   -R Recalculate ibnetdiscover information\n";
-	print "   -s <err1,err2,...> suppress errors listed\n";
-	print
-"   -D <direct route> output only the switch specified by direct route path\n";
-	print "   -S <switch_guid> query only <switch_guid> (hex format)\n";
-	print "   -d include the data counters in the output\n";
-	print "   -C <ca_name> use selected Channel Adaptor name for queries\n";
-	print "   -P <ca_port> use selected channel adaptor port for queries\n";
-	exit 2;
-}
-
-my $argv0          = `basename $0`;
-my $regenerate_map = undef;
-my $single_switch  = undef;
-my $direct_route   = undef;
-my $ca_name        = "";
-my $ca_port        = "";
-
-chomp $argv0;
-if (!getopts("has:crRS:D:dC:P:")) { usage_and_exit $argv0; }
-if (defined $Getopt::Std::opt_h)  { usage_and_exit $argv0; }
-if (defined $Getopt::Std::opt_a) { $print_action = "yes"; }
-if (defined $Getopt::Std::opt_s) {
-	@IBswcountlimits::suppress_errors = split(",", $Getopt::Std::opt_s);
-}
-if (defined $Getopt::Std::opt_c) {
-	@IBswcountlimits::suppress_errors = split(",", "RcvSwRelayErrors");
-}
-if (defined $Getopt::Std::opt_r) { $report_port_info = $Getopt::Std::opt_r; }
-if (defined $Getopt::Std::opt_R) { $regenerate_map   = $Getopt::Std::opt_R; }
-if (defined $Getopt::Std::opt_D) { $direct_route     = $Getopt::Std::opt_D; }
-if (defined $Getopt::Std::opt_S) {
-	$single_switch = format_guid($Getopt::Std::opt_S);
-}
-if (defined $Getopt::Std::opt_d) {
-	$include_data_counters = $Getopt::Std::opt_d;
-}
-if (defined $Getopt::Std::opt_C) { $ca_name = $Getopt::Std::opt_C; }
-if (defined $Getopt::Std::opt_P) { $ca_port = $Getopt::Std::opt_P; }
-
-$cache_file = get_cache_file($ca_name, $ca_port);
-
-sub main
-{
-	if (@IBswcountlimits::suppress_errors) {
-		my $msg = join(",", @IBswcountlimits::suppress_errors);
-		print "Suppressing: $msg\n";
-	}
-	get_link_ends($regenerate_map, $ca_name, $ca_port);
-	get_switches;
-	if (defined($direct_route)) {
-		# convert DR to guid, then use original single_switch option
-		$single_switch = convert_dr_to_guid($direct_route);
-		if (!defined($single_switch) || !is_switch($single_switch)) {
-			printf("The direct route (%s) does not map to a switch.\n",
-				$direct_route);
-			return;
-		}
-	}
-	foreach my $sw_addr (keys %switches) {
-		if ($single_switch && $sw_addr ne "$single_switch") {
-			next;
-		} else {
-			$switch_found = "yes";
-		}
-
-		my $switch_prompt = "no";
-		foreach my $sw_port (1 .. $switches{$sw_addr}) {
-			clear_counters;
-			get_counts($sw_addr, $sw_port, $ca_name, $ca_port);
-			if (any_counts() && $switch_prompt eq "no") {
-				my $hr = $IBswcountlimits::link_ends{"$sw_addr"}{$sw_port};
-				printf("Errors for %18s \"%s\"\n", $sw_addr, $hr->{loc_desc});
-				$switch_prompt = "yes";
-			}
-			report_counts($sw_addr, $sw_port);
-		}
-	}
-	if ($single_switch && $switch_found ne "yes") {
-		printf("Switch \"%s\" not found.\n", $single_switch);
-	}
-}
-main;
+# this is now just a wrapper for the C based utility
+$str = join " ", at ARGV;
+system "/usr/local/sbin/ibqueryerrors $str";
+printf (STDERR "\n*** WARNING ***: this command has been replaced by ibqueryerrors\n\n");
 
diff --git a/scripts/ibqueryerrors.pl.in b/scripts/ibqueryerrors.pl.in
new file mode 100644
index 0000000..3d48751
--- /dev/null
+++ b/scripts/ibqueryerrors.pl.in
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+#
+# Copyright (c) 2009 Lawrence Livermore National Security
+#
+# Produced at Lawrence Livermore National Laboratory.
+# Written by Ira Weiny <weiny2 at llnl.gov>.
+#
+# This software is available to you under a choice of one of two
+# licenses.  You may choose to be licensed under the terms of the GNU
+# General Public License (GPL) Version 2, available from the file
+# COPYING in the main directory of this source tree, or the
+# OpenIB.org BSD license below:
+#
+#     Redistribution and use in source and binary forms, with or
+#     without modification, are permitted provided that the following
+#     conditions are met:
+#
+#      - Redistributions of source code must retain the above
+#        copyright notice, this list of conditions and the following
+#        disclaimer.
+#
+#      - Redistributions in binary form must reproduce the above
+#        copyright notice, this list of conditions and the following
+#        disclaimer in the documentation and/or other materials
+#        provided with the distribution.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
+# this is now just a wrapper for the C based utility
+$str = join " ", at ARGV;
+system "@IBSCRIPTPATH@/ibqueryerrors $str";
+printf (STDERR "\n*** WARNING ***: this command has been replaced by ibqueryerrors\n\n");
+
diff --git a/scripts/ibrouters b/scripts/ibrouters
index a81a9e8..ae71157 100644
--- a/scripts/ibrouters
+++ b/scripts/ibrouters
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
 function usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t(imeout) timeout_ms]"
+	    "-P ca_port -t timeout_ms]"
 	exit -1
 }
 
@@ -13,10 +13,10 @@ ca_info=""
 
 while [ "$1" ]; do
 	case $1 in
-	-h)
+	-h | --help)
 		usage
 		;;
-	-P | -C | -t | -timeout)
+	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
 			usage
diff --git a/scripts/ibrouters.in b/scripts/ibrouters.in
index 6404aca..71f4c60 100644
--- a/scripts/ibrouters.in
+++ b/scripts/ibrouters.in
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
 function usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t(imeout) timeout_ms]"
+	    "-P ca_port -t timeout_ms]"
 	exit -1
 }
 
@@ -13,10 +13,10 @@ ca_info=""
 
 while [ "$1" ]; do
 	case $1 in
-	-h)
+	-h | --help)
 		usage
 		;;
-	-P | -C | -t | -timeout)
+	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
 			usage
diff --git a/scripts/ibstatus b/scripts/ibstatus
index 87fbb0c..6f01be0 100755
--- a/scripts/ibstatus
+++ b/scripts/ibstatus
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Usage ibstatus [devname[:port]]
 
@@ -31,6 +31,7 @@ port_status() {
 	echo "	state:		" `[ -r $port_dir/state ] && cat $port_dir/state || echo unknown`
 	echo "	phys state:	" `[ -r $port_dir/phys_state ] && cat $port_dir/phys_state || echo unknown`
 	echo "	rate:		" `[ -r $port_dir/rate ] && cat $port_dir/rate || echo unknown`
+	echo "	link_layer:	" `[ -r $port_dir/link_layer ] && cat $port_dir/link_layer || echo IB`
 	echo
 }
 
diff --git a/scripts/ibswitches b/scripts/ibswitches
index fd9c163..63931cf 100644
--- a/scripts/ibswitches
+++ b/scripts/ibswitches
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:-/usr/local/sbin}
 
 function usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t(imeout) timeout_ms]"
+	    "-P ca_port -t timeout_ms]"
 	exit -1
 }
 
@@ -13,10 +13,10 @@ ca_info=""
 
 while [ "$1" ]; do
 	case $1 in
-	-h)
+	-h | --help)
 		usage
 		;;
-	-P | -C | -t | -timeout)
+	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
 			usage
@@ -56,10 +56,10 @@ echo "$text" | awk '
 			pi=match(desc, "port 0.*")
 			pinfo=substr(desc, pi)
 			desc=substr(desc, 1, pi-2)
-			type="base"
+			type="base port 0"
 			ti=match(desc, type)
 			if (ti==0) {
-				type="enhanced"
+				type="enhanced port 0"
 				ti=match(desc, type)
 				if (ti!=0)
 					desc=substr(desc, 1, ti-2)
diff --git a/scripts/ibswitches.in b/scripts/ibswitches.in
index 163620a..2a1bcae 100644
--- a/scripts/ibswitches.in
+++ b/scripts/ibswitches.in
@@ -1,10 +1,10 @@
-#!/bin/sh
+#!/bin/bash
 
 IBPATH=${IBPATH:- at IBSCRIPTPATH@}
 
 function usage() {
 	echo Usage: `basename $0` "[-h] [<topology-file> | -C ca_name" \
-	    "-P ca_port -t(imeout) timeout_ms]"
+	    "-P ca_port -t timeout_ms]"
 	exit -1
 }
 
@@ -13,10 +13,10 @@ ca_info=""
 
 while [ "$1" ]; do
 	case $1 in
-	-h)
+	-h | --help)
 		usage
 		;;
-	-P | -C | -t | -timeout)
+	-P | --Port | -C | --Ca | -t | --timeout)
 		case $2 in
 		-*)
 			usage
@@ -56,10 +56,10 @@ echo "$text" | awk '
 			pi=match(desc, "port 0.*")
 			pinfo=substr(desc, pi)
 			desc=substr(desc, 1, pi-2)
-			type="base"
+			type="base port 0"
 			ti=match(desc, type)
 			if (ti==0) {
-				type="enhanced"
+				type="enhanced port 0"
 				ti=match(desc, type)
 				if (ti!=0)
 					desc=substr(desc, 1, ti-2)
diff --git a/scripts/set_nodedesc.sh b/scripts/set_nodedesc.sh
index 855ced7..1f08a54 100755
--- a/scripts/set_nodedesc.sh
+++ b/scripts/set_nodedesc.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 if [ -f /etc/sysconfig/network ]; then
 . /etc/sysconfig/network
@@ -7,6 +7,9 @@ fi
 ib_sysfs="/sys/class/infiniband"
 newname="$HOSTNAME"
 
+echo ""
+echo "*** WARNING ***: this command is deprecated."
+echo ""
 
 function usage
 {
diff --git a/src/grouping.c b/src/grouping.c
deleted file mode 100644
index f1a996f..0000000
--- a/src/grouping.c
+++ /dev/null
@@ -1,787 +0,0 @@
-/*
- * Copyright (c) 2004-2007 Voltaire Inc.  All rights reserved.
- * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
- *
- * This software is available to you under a choice of one of two
- * licenses.  You may choose to be licensed under the terms of the GNU
- * General Public License (GPL) Version 2, available from the file
- * COPYING in the main directory of this source tree, or the
- * OpenIB.org BSD license below:
- *
- *     Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *      - Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *
- *      - Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-/*========================================================*/
-/*               FABRIC SCANNER SPECIFIC DATA             */
-/*========================================================*/
-
-#if HAVE_CONFIG_H
-#  include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include <infiniband/common.h>
-#include <infiniband/mad.h>
-
-#include "ibnetdiscover.h"
-#include "grouping.h"
-
-#define OUT_BUFFER_SIZE 16
-
-
-extern Node *nodesdist[MAXHOPS+1];	/* last is CA list */
-extern Node *mynode;
-extern Port *myport;
-extern int maxhops_discovered;
-
-AllChassisList mylist;
-
-char *ChassisTypeStr[5] = { "", "ISR9288", "ISR9096", "ISR2012", "ISR2004" };
-char *ChassisSlotStr[4] = { "", "Line", "Spine", "SRBD" };
-
-
-char *get_chassis_type(unsigned char chassistype)
-{
-	if (chassistype == UNRESOLVED_CT || chassistype > ISR2004_CT)
-		return NULL;
-	return ChassisTypeStr[chassistype];
-}
-
-char *get_chassis_slot(unsigned char chassisslot)
-{
-	if (chassisslot == UNRESOLVED_CS || chassisslot > SRBD_CS)
-		return NULL;
-	return ChassisSlotStr[chassisslot];
-}
-
-static struct ChassisList *find_chassisnum(unsigned char chassisnum)
-{
-	ChassisList *current;
-
-	for (current = mylist.first; current; current = current->next) {
-		if (current->chassisnum == chassisnum)
-			return current;
-	}
-
-	return NULL;
-}
-
-static uint64_t topspin_chassisguid(uint64_t guid)
-{
-	/* Byte 3 in system image GUID is chassis type, and */
-	/* Byte 4 is location ID (slot) so just mask off byte 4 */
-	return guid & 0xffffffff00ffffffULL;
-}
-
-int is_xsigo_guid(uint64_t guid)
-{
-	if ((guid & 0xffffff0000000000ULL) == 0x0013970000000000ULL)
-		return 1;
-	else
-		return 0;
-}
-
-static int is_xsigo_leafone(uint64_t guid)
-{
-	if ((guid & 0xffffffffff000000ULL) == 0x0013970102000000ULL)
-		return 1;
-	else
-		return 0;
-}
-
-int is_xsigo_hca(uint64_t guid)
-{
-	/* NodeType 2 is HCA */
-	if ((guid & 0xffffffff00000000ULL) == 0x0013970200000000ULL)
-		return 1;
-	else
-		return 0;
-}
-
-int is_xsigo_tca(uint64_t guid)
-{
-	/* NodeType 3 is TCA */
-	if ((guid & 0xffffffff00000000ULL) == 0x0013970300000000ULL)
-		return 1;
-	else
-		return 0;
-}
-
-static int is_xsigo_ca(uint64_t guid)
-{
-	if (is_xsigo_hca(guid) || is_xsigo_tca(guid))
-		return 1;
-	else
-		return 0;
-}
-
-static int is_xsigo_switch(uint64_t guid)
-{
-	if ((guid & 0xffffffff00000000ULL) == 0x0013970100000000ULL)
-		return 1;
-	else
-		return 0;
-}
-
-static uint64_t xsigo_chassisguid(Node *node)
-{
-	if (!is_xsigo_ca(node->sysimgguid)) {
-		/* Byte 3 is NodeType and byte 4 is PortType */
-		/* If NodeType is 1 (switch), PortType is masked */
-		if (is_xsigo_switch(node->sysimgguid))
-			return node->sysimgguid & 0xffffffff00ffffffULL;
-		else
-			return node->sysimgguid;
-	} else {
-		/* Is there a peer port ? */
-		if (!node->ports->remoteport)
-			return node->sysimgguid;
-
-		/* If peer port is Leaf 1, use its chassis GUID */
-		if (is_xsigo_leafone(node->ports->remoteport->node->sysimgguid))
-			return node->ports->remoteport->node->sysimgguid &
-			       0xffffffff00ffffffULL;
-		else
-			return node->sysimgguid;
-	}
-}
-
-static uint64_t get_chassisguid(Node *node)
-{
-	if (node->vendid == TS_VENDOR_ID || node->vendid == SS_VENDOR_ID)
-		return topspin_chassisguid(node->sysimgguid);
-	else if (node->vendid == XS_VENDOR_ID || is_xsigo_guid(node->sysimgguid))
-		return xsigo_chassisguid(node);
-	else
-		return node->sysimgguid;
-}
-
-static struct ChassisList *find_chassisguid(Node *node)
-{
-	ChassisList *current;
-	uint64_t chguid;
-
-	chguid = get_chassisguid(node);
-	for (current = mylist.first; current; current = current->next) {
-		if (current->chassisguid == chguid)
-			return current;
-	}
-
-	return NULL;
-}
-
-uint64_t get_chassis_guid(unsigned char chassisnum)
-{
-	ChassisList *chassis;
-
-	chassis = find_chassisnum(chassisnum);
-	if (chassis)
-		return chassis->chassisguid;
-	else
-		return 0;
-}
-
-static int is_router(Node *node)
-{
-	return (node->devid == VTR_DEVID_IB_FC_ROUTER ||
-		node->devid == VTR_DEVID_IB_IP_ROUTER);
-}
-
-static int is_spine_9096(Node *node)
-{
-	return (node->devid == VTR_DEVID_SFB4 ||
-		node->devid == VTR_DEVID_SFB4_DDR);
-}
-
-static int is_spine_9288(Node *node)
-{
-	return (node->devid == VTR_DEVID_SFB12 ||
-		node->devid == VTR_DEVID_SFB12_DDR);
-}
-
-static int is_spine_2004(Node *node)
-{
-	return (node->devid == VTR_DEVID_SFB2004);
-}
-
-static int is_spine_2012(Node *node)
-{
-	return (node->devid == VTR_DEVID_SFB2012);
-}
-
-static int is_spine(Node *node)
-{
-	return (is_spine_9096(node) || is_spine_9288(node) ||
-		is_spine_2004(node) || is_spine_2012(node));
-}
-
-static int is_line_24(Node *node)
-{
-	return (node->devid == VTR_DEVID_SLB24 ||
-		node->devid == VTR_DEVID_SLB24_DDR ||
-		node->devid == VTR_DEVID_SRB2004);
-}
-
-static int is_line_8(Node *node)
-{
-	return (node->devid == VTR_DEVID_SLB8);
-}
-
-static int is_line_2024(Node *node)
-{
-	return (node->devid == VTR_DEVID_SLB2024);
-}
-
-static int is_line(Node *node)
-{
-	return (is_line_24(node) || is_line_8(node) || is_line_2024(node));
-}
-
-int is_chassis_switch(Node *node)
-{
-    return (is_spine(node) || is_line(node));
-}
-
-/* these structs help find Line (Anafa) slot number while using spine portnum */
-int line_slot_2_sfb4[25]        = { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 };
-int anafa_line_slot_2_sfb4[25]  = { 0, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2 };
-int line_slot_2_sfb12[25]       = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,10, 10, 11, 11, 12, 12 };
-int anafa_line_slot_2_sfb12[25] = { 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 };
-
-/* IPR FCR modules connectivity while using sFB4 port as reference */
-int ipr_slot_2_sfb4_port[25]    = { 0, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1 };
-
-/* these structs help find Spine (Anafa) slot number while using spine portnum */
-int spine12_slot_2_slb[25]      = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-int anafa_spine12_slot_2_slb[25]= { 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-int spine4_slot_2_slb[25]       = { 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-int anafa_spine4_slot_2_slb[25] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-/*	reference                     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */
-
-static void get_sfb_slot(Node *node, Port *lineport)
-{
-	ChassisRecord *ch = node->chrecord;
-
-	ch->chassisslot = SPINE_CS;
-	if (is_spine_9096(node)) {
-		ch->chassistype = ISR9096_CT;
-		ch->slotnum = spine4_slot_2_slb[lineport->portnum];
-		ch->anafanum = anafa_spine4_slot_2_slb[lineport->portnum];
-	} else if (is_spine_9288(node)) {
-		ch->chassistype = ISR9288_CT;
-		ch->slotnum = spine12_slot_2_slb[lineport->portnum];
-		ch->anafanum = anafa_spine12_slot_2_slb[lineport->portnum];
-	} else if (is_spine_2012(node)) {
-		ch->chassistype = ISR2012_CT;
-		ch->slotnum = spine12_slot_2_slb[lineport->portnum];
-		ch->anafanum = anafa_spine12_slot_2_slb[lineport->portnum];
-	} else if (is_spine_2004(node)) {
-		ch->chassistype = ISR2004_CT;
-		ch->slotnum = spine4_slot_2_slb[lineport->portnum];
-		ch->anafanum = anafa_spine4_slot_2_slb[lineport->portnum];
-	} else {
-		IBPANIC("Unexpected node found: guid 0x%016" PRIx64, node->nodeguid);
-	}
-}
-
-static void get_router_slot(Node *node, Port *spineport)
-{
-	ChassisRecord *ch = node->chrecord;
-	int guessnum = 0;
-
-	if (!ch) {
-		if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
-			IBPANIC("out of mem");
-		ch = node->chrecord;
-	}
-
-	ch->chassisslot = SRBD_CS;
-	if (is_spine_9096(spineport->node)) {
-		ch->chassistype = ISR9096_CT;
-		ch->slotnum = line_slot_2_sfb4[spineport->portnum];
-		ch->anafanum = ipr_slot_2_sfb4_port[spineport->portnum];
-	} else if (is_spine_9288(spineport->node)) {
-		ch->chassistype = ISR9288_CT;
-		ch->slotnum = line_slot_2_sfb12[spineport->portnum];
-		/* this is a smart guess based on nodeguids order on sFB-12 module */
-		guessnum = spineport->node->nodeguid % 4;
-		/* module 1 <--> remote anafa 3 */
-		/* module 2 <--> remote anafa 2 */
-		/* module 3 <--> remote anafa 1 */
-		ch->anafanum = (guessnum == 3 ? 1 : (guessnum == 1 ? 3 : 2));
-	} else if (is_spine_2012(spineport->node)) {
-		ch->chassistype = ISR2012_CT;
-		ch->slotnum = line_slot_2_sfb12[spineport->portnum];
-		/* this is a smart guess based on nodeguids order on sFB-12 module */
-		guessnum = spineport->node->nodeguid % 4;
-		// module 1 <--> remote anafa 3
-		// module 2 <--> remote anafa 2
-		// module 3 <--> remote anafa 1
-		ch->anafanum = (guessnum == 3? 1 : (guessnum == 1 ? 3 : 2));
-	} else if (is_spine_2004(spineport->node)) {
-		ch->chassistype = ISR2004_CT;
-		ch->slotnum = line_slot_2_sfb4[spineport->portnum];
-		ch->anafanum = ipr_slot_2_sfb4_port[spineport->portnum];
-	} else {
-		IBPANIC("Unexpected node found: guid 0x%016" PRIx64, spineport->node->nodeguid);
-	}
-}
-
-static void get_slb_slot(ChassisRecord *ch, Port *spineport)
-{
-	ch->chassisslot = LINE_CS;
-	if (is_spine_9096(spineport->node)) {
-		ch->chassistype = ISR9096_CT;
-		ch->slotnum = line_slot_2_sfb4[spineport->portnum];
-		ch->anafanum = anafa_line_slot_2_sfb4[spineport->portnum];
-	} else if (is_spine_9288(spineport->node)) {
-		ch->chassistype = ISR9288_CT;
-		ch->slotnum = line_slot_2_sfb12[spineport->portnum];
-		ch->anafanum = anafa_line_slot_2_sfb12[spineport->portnum];
-	} else if (is_spine_2012(spineport->node)) {
-		ch->chassistype = ISR2012_CT;
-		ch->slotnum = line_slot_2_sfb12[spineport->portnum];
-		ch->anafanum = anafa_line_slot_2_sfb12[spineport->portnum];
-	} else if (is_spine_2004(spineport->node)) {
-		ch->chassistype = ISR2004_CT;
-		ch->slotnum = line_slot_2_sfb4[spineport->portnum];
-		ch->anafanum = anafa_line_slot_2_sfb4[spineport->portnum];
-	} else {
-		IBPANIC("Unexpected node found: guid 0x%016" PRIx64, spineport->node->nodeguid);
-	}
-}
-
-/*
-	This function called for every Voltaire node in fabric
-	It could be optimized so, but time overhead is very small
-	and its only diag.util
-*/
-static void fill_chassis_record(Node *node)
-{
-	Port *port;
-	Node *remnode = 0;
-	ChassisRecord *ch = 0;
-
-	if (node->chrecord) /* somehow this node has already been passed */
-		return;
-
-	if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
-		IBPANIC("out of mem");
-
-	ch = node->chrecord;
-
-	/* node is router only in case of using unique lid */
-	/* (which is lid of chassis router port) */
-	/* in such case node->ports is actually a requested port... */
-	if (is_router(node) && is_spine(node->ports->remoteport->node))
-		get_router_slot(node, node->ports->remoteport);
-	else if (is_spine(node)) {
-		for (port = node->ports; port; port = port->next) {
-			if (!port->remoteport)
-				continue;
-			remnode = port->remoteport->node;
-			if (remnode->type != SWITCH_NODE) {
-				if (!remnode->chrecord)
-					get_router_slot(remnode, port);
-				continue;
-			}
-			if (!ch->chassistype)
-				/* we assume here that remoteport belongs to line */
-				get_sfb_slot(node, port->remoteport);
-
-				/* we could break here, but need to find if more routers connected */
-		}
-
-	} else if (is_line(node)) {
-		for (port = node->ports; port; port = port->next) {
-			if (port->portnum > 12)
-				continue;
-			if (!port->remoteport)
-				continue;
-			/* we assume here that remoteport belongs to spine */
-			get_slb_slot(ch, port->remoteport);
-			break;
-		}
-	}
-
-	return;
-}
-
-static int get_line_index(Node *node)
-{
-	int retval = 3 * (node->chrecord->slotnum - 1) + node->chrecord->anafanum;
-
-	if (retval > LINES_MAX_NUM || retval < 1)
-		IBPANIC("Internal error");
-	return retval;
-}
-
-static int get_spine_index(Node *node)
-{
-	int retval;
-
-	if (is_spine_9288(node) || is_spine_2012(node))
-		retval = 3 * (node->chrecord->slotnum - 1) + node->chrecord->anafanum;
-	else
-		retval = node->chrecord->slotnum;
-
-	if (retval > SPINES_MAX_NUM || retval < 1)
-		IBPANIC("Internal error");
-	return retval;
-}
-
-static void insert_line_router(Node *node, ChassisList *chassislist)
-{
-	int i = get_line_index(node);
-
-	if (chassislist->linenode[i])
-		return;		/* already filled slot */
-
-	chassislist->linenode[i] = node;
-	node->chrecord->chassisnum = chassislist->chassisnum;
-}
-
-static void insert_spine(Node *node, ChassisList *chassislist)
-{
-	int i = get_spine_index(node);
-
-	if (chassislist->spinenode[i])
-		return;		/* already filled slot */
-
-	chassislist->spinenode[i] = node;
-	node->chrecord->chassisnum = chassislist->chassisnum;
-}
-
-static void pass_on_lines_catch_spines(ChassisList *chassislist)
-{
-	Node *node, *remnode;
-	Port *port;
-	int i;
-
-	for (i = 1; i <= LINES_MAX_NUM; i++) {
-		node = chassislist->linenode[i];
-
-		if (!(node && is_line(node)))
-			continue;	/* empty slot or router */
-
-		for (port = node->ports; port; port = port->next) {
-			if (port->portnum > 12)
-				continue;
-
-			if (!port->remoteport)
-				continue;
-			remnode = port->remoteport->node;
-
-			if (!remnode->chrecord)
-				continue;	/* some error - spine not initialized ? FIXME */
-			insert_spine(remnode, chassislist);
-		}
-	}
-}
-
-static void pass_on_spines_catch_lines(ChassisList *chassislist)
-{
-	Node *node, *remnode;
-	Port *port;
-	int i;
-
-	for (i = 1; i <= SPINES_MAX_NUM; i++) {
-		node = chassislist->spinenode[i];
-		if (!node)
-			continue;	/* empty slot */
-		for (port = node->ports; port; port = port->next) {
-			if (!port->remoteport)
-				continue;
-			remnode = port->remoteport->node;
-
-			if (!remnode->chrecord)
-				continue;	/* some error - line/router not initialized ? FIXME */
-			insert_line_router(remnode, chassislist);
-		}
-	}
-}
-
-/*
-	Stupid interpolation algorithm...
-	But nothing to do - have to be compliant with VoltaireSM/NMS
-*/
-static void pass_on_spines_interpolate_chguid(ChassisList *chassislist)
-{
-	Node *node;
-	int i;
-
-	for (i = 1; i <= SPINES_MAX_NUM; i++) {
-		node = chassislist->spinenode[i];
-		if (!node)
-			continue;	/* skip the empty slots */
-
-		/* take first guid minus one to be consistent with SM */
-		chassislist->chassisguid = node->nodeguid - 1;
-		break;
-	}
-}
-
-/*
-	This function fills chassislist structure with all nodes
-	in that chassis
-	chassislist structure = structure of one standalone chassis
-*/
-static void build_chassis(Node *node, ChassisList *chassislist)
-{
-	Node *remnode = 0;
-	Port *port = 0;
-
-	/* we get here with node = chassis_spine */
-	chassislist->chassistype = node->chrecord->chassistype;
-	insert_spine(node, chassislist);
-
-	/* loop: pass on all ports of node */
-	for (port = node->ports; port; port = port->next) {
-		if (!port->remoteport)
-			continue;
-		remnode = port->remoteport->node;
-
-		if (!remnode->chrecord)
-			continue; /* some error - line or router not initialized ? FIXME */
-
-		insert_line_router(remnode, chassislist);
-	}
-
-	pass_on_lines_catch_spines(chassislist);
-	/* this pass needed for to catch routers, since routers connected only */
-	/* to spines in slot 1 or 4 and we could miss them first time */
-	pass_on_spines_catch_lines(chassislist);
-
-	/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
-	/* connectivity - extra pass to ensure that all related chips/modules */
-	/* inserted into the chassislist */
-	pass_on_lines_catch_spines(chassislist);
-	pass_on_spines_catch_lines(chassislist);
-	pass_on_spines_interpolate_chguid(chassislist);
-}
-
-/*========================================================*/
-/*                INTERNAL TO EXTERNAL PORT MAPPING       */
-/*========================================================*/
-
-/*
-Description : On ISR9288/9096 external ports indexing
-              is not matching the internal ( anafa ) port
-              indexes. Use this MAP to translate the data you get from
-              the OpenIB diagnostics (smpquery, ibroute, ibtracert, etc.)
-
-
-Module : sLB-24
-                anafa 1             anafa 2
-ext port | 13 14 15 16 17 18 | 19 20 21 22 23 24
-int port | 22 23 24 18 17 16 | 22 23 24 18 17 16
-ext port | 1  2  3  4  5  6  | 7  8  9  10 11 12
-int port | 19 20 21 15 14 13 | 19 20 21 15 14 13
-------------------------------------------------
-
-Module : sLB-8
-                anafa 1             anafa 2
-ext port | 13 14 15 16 17 18 | 19 20 21 22 23 24
-int port | 24 23 22 18 17 16 | 24 23 22 18 17 16
-ext port | 1  2  3  4  5  6  | 7  8  9  10 11 12
-int port | 21 20 19 15 14 13 | 21 20 19 15 14 13
-
------------>
-                anafa 1             anafa 2
-ext port | -  -  5  -  -  6  | -  -  7  -  -  8
-int port | 24 23 22 18 17 16 | 24 23 22 18 17 16
-ext port | -  -  1  -  -  2  | -  -  3  -  -  4
-int port | 21 20 19 15 14 13 | 21 20 19 15 14 13
-------------------------------------------------
-
-Module : sLB-2024
-
-ext port | 13 14 15 16 17 18 19 20 21 22 23 24
-A1 int port| 13 14 15 16 17 18 19 20 21 22 23 24
-ext port | 1 2 3 4 5 6 7 8 9 10 11 12
-A2 int port| 13 14 15 16 17 18 19 20 21 22 23 24
----------------------------------------------------
-
-*/
-
-int int2ext_map_slb24[2][25] = {
-					{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 4, 18, 17, 16, 1, 2, 3, 13, 14, 15 },
-					{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, 10, 24, 23, 22, 7, 8, 9, 19, 20, 21 }
-				};
-int int2ext_map_slb8[2][25] = {
-					{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 6, 6, 6, 1, 1, 1, 5, 5, 5 },
-					{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 8, 8, 8, 3, 3, 3, 7, 7, 7 }
-				};
-int int2ext_map_slb2024[2][25] = {
-					{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 },
-					{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }
-				};
-/*	reference			{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */
-
-/*
-	This function relevant only for line modules/chips
-	Returns string with external port index
-*/
-char *portmapstring(Port *port)
-{
-	static char mapping[OUT_BUFFER_SIZE];
-	ChassisRecord *ch = port->node->chrecord;
-	int portnum = port->portnum;
-	int chipnum = 0;
-	int pindex = 0;
-	Node *node = port->node;
-
-	if (!ch || !is_line(node) || (portnum < 13 || portnum > 24))
-		return NULL;
-
-	if (ch->anafanum < 1 || ch->anafanum > 2)
-		return NULL;
-
-	memset(mapping, 0, sizeof(mapping));
-
-	chipnum = ch->anafanum - 1;
-
-	if (is_line_24(node))
-		pindex = int2ext_map_slb24[chipnum][portnum];
-	else if (is_line_2024(node))
-		pindex = int2ext_map_slb2024[chipnum][portnum];
-	else
-		pindex = int2ext_map_slb8[chipnum][portnum];
-
-	sprintf(mapping, "[ext %d]", pindex);
-
-	return mapping;
-}
-
-static void add_chassislist()
-{
-	if (!(mylist.current = calloc(1, sizeof(ChassisList))))
-		IBPANIC("out of mem");
-
-	if (mylist.first == NULL) {
-		mylist.first = mylist.current;
-		mylist.last = mylist.current;
-	} else {
-		mylist.last->next = mylist.current;
-		mylist.current->next = NULL;
-		mylist.last = mylist.current;
-	}
-}
-
-/*
-	Main grouping function
-	Algorithm:
-	1. pass on every Voltaire node
-	2. catch spine chip for every Voltaire node
-		2.1 build/interpolate chassis around this chip
-		2.2 go to 1.
-	3. pass on non Voltaire nodes (SystemImageGUID based grouping)
-	4. now group non Voltaire nodes by SystemImageGUID
-*/
-ChassisList *group_nodes()
-{
-	Node *node;
-	int dist;
-	int chassisnum = 0;
-	struct ChassisList *chassis;
-
-	mylist.first = NULL;
-	mylist.current = NULL;
-	mylist.last = NULL;
-
-	/* first pass on switches and build for every Voltaire node */
-	/* an appropriate chassis record (slotnum and position) */
-	/* according to internal connectivity */
-	/* not very efficient but clear code so... */
-	for (dist = 0; dist <= maxhops_discovered; dist++) {
-		for (node = nodesdist[dist]; node; node = node->dnext) {
-			if (node->vendid == VTR_VENDOR_ID)
-				fill_chassis_record(node);
-		}
-	}
-
-	/* separate every Voltaire chassis from each other and build linked list of them */
-	/* algorithm: catch spine and find all surrounding nodes */
-	for (dist = 0; dist <= maxhops_discovered; dist++) {
-		for (node = nodesdist[dist]; node; node = node->dnext) {
-			if (node->vendid != VTR_VENDOR_ID)
-				continue;
-			if (!node->chrecord || node->chrecord->chassisnum || !is_spine(node))
-				continue;
-			add_chassislist();
-			mylist.current->chassisnum = ++chassisnum;
-			build_chassis(node, mylist.current);
-		}
-	}
-
-	/* now make pass on nodes for chassis which are not Voltaire */
-	/* grouped by common SystemImageGUID */
-	for (dist = 0; dist <= maxhops_discovered; dist++) {
-		for (node = nodesdist[dist]; node; node = node->dnext) {
-			if (node->vendid == VTR_VENDOR_ID)
-				continue;
-			if (node->sysimgguid) {
-				chassis = find_chassisguid(node);
-				if (chassis)
-					chassis->nodecount++;
-				else {
-					/* Possible new chassis */
-					add_chassislist();
-					mylist.current->chassisguid = get_chassisguid(node);
-					mylist.current->nodecount = 1;
-				}
-			}
-		}
-	}
-
-	/* now, make another pass to see which nodes are part of chassis */
-	/* (defined as chassis->nodecount > 1) */
-	for (dist = 0; dist <= MAXHOPS; ) {
-		for (node = nodesdist[dist]; node; node = node->dnext) {
-			if (node->vendid == VTR_VENDOR_ID)
-				continue;
-			if (node->sysimgguid) {
-				chassis = find_chassisguid(node);
-				if (chassis && chassis->nodecount > 1) {
-					if (!chassis->chassisnum)
-						chassis->chassisnum = ++chassisnum;
-					if (!node->chrecord) {
-						if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
-							IBPANIC("out of mem");
-						node->chrecord->chassisnum = chassis->chassisnum;
-					}
-				}
-			}
-		}
-		if (dist == maxhops_discovered)
-			dist = MAXHOPS;	/* skip to CAs */
-		else
-			dist++;
-	}
-
-	return (mylist.first);
-}
diff --git a/src/ibaddr.c b/src/ibaddr.c
index f48a9c9..9d208f5 100644
--- a/src/ibaddr.c
+++ b/src/ibaddr.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,37 +34,36 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <getopt.h>
 #include <arpa/inet.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 
 #include "ibdiag_common.h"
 
-char *argv0 = "ibaddr";
+struct ibmad_port *srcport;
 
-static int
-ib_resolve_addr(ib_portid_t *portid, int portnum, int show_lid, int show_gid)
+static int ib_resolve_addr(ib_portid_t * portid, int portnum, int show_lid,
+			   int show_gid)
 {
-	char   gid_str[INET6_ADDRSTRLEN];
-	uint8_t portinfo[64];
-	uint8_t nodeinfo[64];
+	char gid_str[INET6_ADDRSTRLEN];
+	uint8_t portinfo[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t nodeinfo[IB_SMP_DATA_SIZE] = { 0 };
 	uint64_t guid, prefix;
 	ibmad_gid_t gid;
 	int lmc;
 
-	if (!smp_query(nodeinfo, portid, IB_ATTR_NODE_INFO, 0, 0))
+	if (!smp_query_via(nodeinfo, portid, IB_ATTR_NODE_INFO, 0, 0, srcport))
 		return -1;
 
-	if (!smp_query(portinfo, portid, IB_ATTR_PORT_INFO, portnum, 0))
+	if (!smp_query_via(portinfo, portid, IB_ATTR_PORT_INFO, portnum, 0,
+			   srcport))
 		return -1;
 
 	mad_decode_field(portinfo, IB_PORT_LID_F, &portid->lid);
@@ -76,120 +76,66 @@ ib_resolve_addr(ib_portid_t *portid, int portnum, int show_lid, int show_gid)
 
 	if (show_gid) {
 		printf("GID %s ", inet_ntop(AF_INET6, gid, gid_str,
-			sizeof gid_str));
+					    sizeof gid_str));
 	}
 
 	if (show_lid > 0)
-		printf("LID start 0x%x end 0x%x", portid->lid, portid->lid + (1 << lmc) - 1);
+		printf("LID start 0x%x end 0x%x", portid->lid,
+		       portid->lid + (1 << lmc) - 1);
 	else if (show_lid < 0)
-		printf("LID start %d end %d", portid->lid, portid->lid + (1 << lmc) - 1);
+		printf("LID start %d end %d", portid->lid,
+		       portid->lid + (1 << lmc) - 1);
 	printf("\n");
 	return 0;
 }
 
-static void
-usage(void)
+static int show_lid, show_gid;
+
+static int process_opt(void *context, int ch, char *optarg)
 {
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -D(irect) -G(uid) -l(id_show) -g(id_show) -s(m_port) sm_lid -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms -V(ersion) -h(elp)] [<lid|dr_path|guid>]\n",
-			basename);
-	fprintf(stderr, "\tExamples:\n");
-	fprintf(stderr, "\t\t%s\t\t\t# local port's address\n", basename);
-	fprintf(stderr, "\t\t%s 32\t\t# show lid range and gid of lid 32\n", basename);
-	fprintf(stderr, "\t\t%s -G 0x8f1040023\t# same but using guid address\n", basename);
-	fprintf(stderr, "\t\t%s -l 32\t\t# show lid range only\n", basename);
-	fprintf(stderr, "\t\t%s -L 32\t\t# show decimal lid range only\n", basename);
-	fprintf(stderr, "\t\t%s -g 32\t\t# show gid address only\n", basename);
-	exit(-1);
+	switch (ch) {
+	case 'g':
+		show_gid = 1;
+		break;
+	case 'l':
+		show_lid++;
+		break;
+	case 'L':
+		show_lid = -100;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	ib_portid_t portid = {0};
-	extern int ibdebug;
-	int dest_type = IB_DEST_LID;
-	int timeout = 0;	/* use default */
-	int show_lid = 0, show_gid = 0;
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
+	ib_portid_t portid = { 0 };
 	int port = 0;
-	char *ca = 0;
-	int ca_port = 0;
-
-	static char const str_opts[] = "C:P:t:s:dDGglLVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "Direct", 0, 0, 'D'},
-		{ "Guid", 0, 0, 'G'},
-		{ "gid_show", 0, 0, 'g'},
-		{ "lid_show", 0, 0, 'l'},
-		{ "Lid_show", 0, 0, 'L'},
-		{ "timeout", 1, 0, 't'},
-		{ "sm_port", 1, 0, 's'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+
+	const struct ibdiag_opt opts[] = {
+		{"gid_show", 'g', 0, NULL, "show gid address only"},
+		{"lid_show", 'l', 0, NULL, "show lid range only"},
+		{"Lid_show", 'L', 0, NULL, "show lid range (in decimal) only"},
+		{0}
+	};
+	char usage_args[] = "[<lid|dr_path|guid>]";
+	const char *usage_examples[] = {
+		"\t\t# local port's address",
+		"32\t\t# show lid range and gid of lid 32",
+		"-G 0x8f1040023\t# same but using guid address",
+		"-l 32\t\t# show lid range only",
+		"-L 32\t\t# show decimal lid range only",
+		"-g 32\t\t# show gid address only",
+		NULL
 	};
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'd':
-			ibdebug++;
-			break;
-		case 'D':
-			dest_type = IB_DEST_DRPATH;
-			break;
-		case 'g':
-			show_gid++;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'l':
-			show_lid++;
-			break;
-		case 'L':
-			show_lid = -100;
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
+	ibdiag_process_opts(argc, argv, NULL, "KL", opts, process_opt,
+			    usage_args, usage_examples);
+
 	argc -= optind;
 	argv += optind;
 
@@ -199,17 +145,24 @@ main(int argc, char **argv)
 	if (!show_lid && !show_gid)
 		show_lid = show_gid = 1;
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
 
 	if (argc) {
-		if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+				       ibd_dest_type, ibd_sm_id, srcport) < 0)
 			IBERROR("can't resolve destination port %s", argv[0]);
 	} else {
-		if (ib_resolve_self(&portid, &port, 0) < 0)
+		if (resolve_self(ibd_ca, ibd_ca_port, &portid, &port, NULL) < 0)
 			IBERROR("can't resolve self port %s", argv[0]);
 	}
 
 	if (ib_resolve_addr(&portid, port, show_lid, show_gid) < 0)
 		IBERROR("can't resolve requested address");
+
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/ibcacheedit.c b/src/ibcacheedit.c
new file mode 100644
index 0000000..f302813
--- /dev/null
+++ b/src/ibcacheedit.c
@@ -0,0 +1,356 @@
+/*
+ * Copyright (c) 2010 Lawrence Livermore National Lab.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <inttypes.h>
+
+#include <infiniband/mad.h>
+#include <infiniband/ibnetdisc.h>
+
+#include "ibdiag_common.h"
+
+uint64_t switchguid_before = 0;
+uint64_t switchguid_after = 0;
+int switchguid_flag = 0;
+
+uint64_t caguid_before = 0;
+uint64_t caguid_after = 0;
+int caguid_flag = 0;
+
+uint64_t sysimgguid_before = 0;
+uint64_t sysimgguid_after = 0;
+int sysimgguid_flag = 0;
+
+uint64_t portguid_nodeguid = 0;
+uint64_t portguid_before = 0;
+uint64_t portguid_after = 0;
+int portguid_flag = 0;
+
+struct guids {
+	uint64_t searchguid;
+	int searchguid_found;
+	uint64_t before;
+	uint64_t after;
+	int found;
+};
+
+static int parse_beforeafter(char *arg, uint64_t *before, uint64_t *after)
+{
+	char *ptr;
+	char *before_str;
+	char *after_str;
+
+	ptr = strchr(optarg, ':');
+	if (!ptr || !(*(ptr + 1))) {
+		fprintf(stderr, "invalid input '%s'\n", arg);
+		return -1;
+	}
+	(*ptr) = '\0';
+	before_str = arg;
+	after_str = ptr + 1;
+
+	(*before) = strtoull(before_str, 0, 0);
+	(*after) = strtoull(after_str, 0, 0);
+	return 0;
+}
+
+static int parse_guidbeforeafter(char *arg,
+				 uint64_t *guid,
+				 uint64_t *before,
+				 uint64_t *after)
+{
+	char *ptr1;
+	char *ptr2;
+	char *guid_str;
+	char *before_str;
+	char *after_str;
+
+	ptr1 = strchr(optarg, ':');
+	if (!ptr1 || !(*(ptr1 + 1))) {
+		fprintf(stderr, "invalid input '%s'\n", arg);
+		return -1;
+	}
+	guid_str = arg;
+	before_str = ptr1 + 1;
+
+	ptr2 = strchr(before_str, ':');
+	if (!ptr2 || !(*(ptr2 + 1))) {
+		fprintf(stderr, "invalid input '%s'\n", arg);
+		return -1;
+	}
+	(*ptr1) = '\0';
+	(*ptr2) = '\0';
+	after_str = ptr2 + 1;
+
+	(*guid) = strtoull(guid_str, 0, 0);
+	(*before) = strtoull(before_str, 0, 0);
+	(*after) = strtoull(after_str, 0, 0);
+	return 0;
+}
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 1:
+		if (parse_beforeafter(optarg,
+				      &switchguid_before,
+				      &switchguid_after) < 0)
+			return -1;
+		switchguid_flag++;
+		break;
+	case 2:
+		if (parse_beforeafter(optarg,
+				      &caguid_before,
+				      &caguid_after) < 0)
+			return -1;
+		caguid_flag++;
+		break;
+	case 3:
+		if (parse_beforeafter(optarg,
+				      &sysimgguid_before,
+				      &sysimgguid_after) < 0)
+			return -1;
+		sysimgguid_flag++;
+		break;
+	case 4:
+		if (parse_guidbeforeafter(optarg,
+					  &portguid_nodeguid,
+					  &portguid_before,
+					  &portguid_after) < 0)
+			return -1;
+		portguid_flag++;
+		break;
+	default:
+		return -1;
+	}
+
+	return 0;
+}
+
+static void update_switchportguids(ibnd_node_t *node, uint64_t guid)
+{
+	ibnd_port_t *port;
+	int p;
+
+	for (p = 0; p <= node->numports; p++) {
+		port = node->ports[p];
+		if (port)
+			port->guid = node->guid;
+	}
+}
+
+static void replace_node_guid(ibnd_node_t *node, void *user_data)
+{
+	struct guids *guids;
+
+	guids = (struct guids *)user_data;
+
+	if (node->guid == guids->before) {
+
+		node->guid = guids->after;
+
+		/* port guids are identical to switch guids on
+		 * switches, so update port guids too
+		 */
+		if (node->type == IB_NODE_SWITCH)
+			update_switchportguids(node, guids->after);
+
+		guids->found++;
+	}
+}
+
+static void replace_sysimgguid(ibnd_node_t *node, void *user_data)
+{
+	struct guids *guids;
+	uint64_t sysimgguid;
+
+	guids = (struct guids *)user_data;
+
+	sysimgguid = mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F);
+	if (sysimgguid == guids->before) {
+		mad_set_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F,
+				guids->after);
+		guids->found++;
+	}
+}
+
+static void replace_portguid(ibnd_node_t *node, void *user_data)
+{
+	struct guids *guids;
+
+	guids = (struct guids *)user_data;
+
+	if (node->guid != guids->searchguid)
+		return;
+
+	guids->searchguid_found++;
+
+	if (node->type == IB_NODE_SWITCH) {
+		/* port guids are identical to switch guids on
+		 * switches, so update switch guid too
+		 */
+		if (node->guid == guids->before) {
+			node->guid = guids->after;
+			update_switchportguids(node, guids->after);
+			guids->found++;
+		}
+	}
+	else {
+		ibnd_port_t *port;
+		int p;
+
+		for (p = 1; p <= node->numports; p++) {
+			port = node->ports[p];
+			if (port
+			    && port->guid == guids->before) {
+				port->guid = guids->after;
+				guids->found++;
+				break;
+			}
+		}
+	}
+}
+
+int main(int argc, char **argv)
+{
+	ibnd_fabric_t *fabric = NULL;
+	char *orig_cache_file = NULL;
+	char *new_cache_file = NULL;
+	struct guids guids;
+
+	const struct ibdiag_opt opts[] = {
+		{"switchguid", 1, 1, "BEFOREGUID:AFTERGUID",
+		 "Specify before and after switchguid to edit"},
+		{"caguid", 2, 1, "BEFOREGUID:AFTERGUID",
+		 "Specify before and after caguid to edit"},
+		{"sysimgguid", 3, 1, "BEFOREGUID:AFTERGUID",
+		 "Specify before and after sysimgguid to edit"},
+		{"portguid", 4, 1, "NODEGUID:BEFOREGUID:AFTERGUID",
+		 "Specify before and after port guid to edit"},
+		{0}
+	};
+	char *usage_args = "<orig.cache> <new.cache>";
+
+	ibdiag_process_opts(argc, argv, NULL, "CDdeGKLPstvy",
+			    opts, process_opt, usage_args,
+			    NULL);
+
+	argc -= optind;
+	argv += optind;
+
+	orig_cache_file = argv[0];
+	new_cache_file = argv[1];
+
+	if (!orig_cache_file)
+		IBERROR("original cache file not specified");
+
+	if (!new_cache_file)
+		IBERROR("new cache file not specified");
+
+	if ((fabric = ibnd_load_fabric(orig_cache_file, 0)) == NULL)
+		IBERROR("loading original cached fabric failed");
+
+	if (switchguid_flag) {
+		guids.before = switchguid_before;
+		guids.after = switchguid_after;
+		guids.found = 0;
+		ibnd_iter_nodes_type(fabric,
+				     replace_node_guid,
+				     IB_NODE_SWITCH,
+				     &guids);
+
+		if (!guids.found)
+			IBERROR("switchguid = %" PRIx64 " not found",
+				switchguid_before);
+	}
+
+	if (caguid_flag) {
+		guids.before = caguid_before;
+		guids.after = caguid_after;
+		guids.found = 0;
+		ibnd_iter_nodes_type(fabric,
+				     replace_node_guid,
+				     IB_NODE_CA,
+				     &guids);
+
+		if (!guids.found)
+			IBERROR("caguid = %" PRIx64 " not found",
+				caguid_before);
+	}
+
+	if (sysimgguid_flag) {
+		guids.before = sysimgguid_before;
+		guids.after = sysimgguid_after;
+		guids.found = 0;
+		ibnd_iter_nodes(fabric,
+				replace_sysimgguid,
+				&guids);
+
+		if (!guids.found)
+			IBERROR("sysimgguid = %" PRIx64 " not found",
+				sysimgguid_before);
+	}
+
+	if (portguid_flag) {
+		guids.searchguid = portguid_nodeguid;
+		guids.searchguid_found = 0;
+		guids.before = portguid_before;
+		guids.after = portguid_after;
+		guids.found = 0;
+		ibnd_iter_nodes(fabric,
+				replace_portguid,
+				&guids);
+
+		if (!guids.searchguid_found)
+			IBERROR("nodeguid = %" PRIx64 " not found",
+				portguid_nodeguid);
+
+		if (!guids.found)
+			IBERROR("portguid = %" PRIx64 " not found",
+				portguid_before);
+	}
+
+	if (ibnd_cache_fabric(fabric, new_cache_file, 0) < 0)
+		IBERROR("caching new cache data failed");
+
+	ibnd_destroy_fabric(fabric);
+	exit(0);
+}
diff --git a/src/ibccconfig.c b/src/ibccconfig.c
new file mode 100644
index 0000000..6dd6b0b
--- /dev/null
+++ b/src/ibccconfig.c
@@ -0,0 +1,643 @@
+/*
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
+ * Copyright (c) 2011 Lawrence Livermore National Lab.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <getopt.h>
+#include <errno.h>
+#include <netinet/in.h>
+#include <limits.h>
+#include <ctype.h>
+
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
+#include <infiniband/mad.h>
+
+#include "ibdiag_common.h"
+
+struct ibmad_port *srcport;
+
+typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
+
+typedef struct match_rec {
+	const char *name, *alias;
+	op_fn_t *fn;
+	unsigned opt_portnum;
+	char *ops_extra;
+} match_rec_t;
+
+static op_fn_t congestion_key_info;
+static op_fn_t switch_congestion_setting;
+static op_fn_t switch_port_congestion_setting;
+static op_fn_t ca_congestion_setting;
+static op_fn_t congestion_control_table;
+
+static const match_rec_t match_tbl[] = {
+	{"CongestionKeyInfo", "CK", congestion_key_info, 0,
+	 "<cckey> <cckeyprotectbit> <cckeyleaseperiod> <cckeyviolations>"},
+	{"SwitchCongestionSetting", "SS", switch_congestion_setting, 0,
+	 "<controlmap> <victimmask> <creditmask> <threshold> <packetsize> "
+	 "<csthreshold> <csreturndelay> <markingrate>"},
+	{"SwitchPortCongestionSetting", "SP", switch_port_congestion_setting, 1,
+	 "<valid> <control_type> <threshold> <packet_size> <cong_parm_marking_rate>"},
+	{"CACongestionSetting", "CS", ca_congestion_setting, 0,
+	 "<port_control> <control_map> <ccti_timer> <ccti_increase> "
+	 "<trigger_threshold> <ccti_min>"},
+	{"CongestionControlTable", "CT", congestion_control_table, 0,
+	 "<cctilimit> <index> <cctentry> <cctentry> ..."},
+	{0}
+};
+
+uint64_t cckey = 0;
+
+/*******************************************/
+static char *parselonglongint(char *arg, uint64_t *val)
+{
+	char *endptr = NULL;
+
+	errno = 0;
+	*val = strtoull(arg, &endptr, 0);
+	if ((endptr && *endptr != '\0')
+	    || errno != 0) {
+		if (errno == ERANGE)
+			return "value out of range";
+		return "invalid integer input";
+	}
+
+	return NULL;
+}
+
+static char *parseint(char *arg, uint32_t *val, int hexonly)
+{
+	char *endptr = NULL;
+
+	errno = 0;
+	*val = strtoul(arg, &endptr, hexonly ? 16 : 0);
+	if ((endptr && *endptr != '\0')
+	    || errno != 0) {
+		if (errno == ERANGE)
+			return "value out of range";
+		return "invalid integer input";
+	}
+
+	return NULL;
+}
+
+static char *congestion_key_info(ib_portid_t * dest, char **argv, int argc)
+{
+	uint8_t rcv[IB_CC_DATA_SZ] = { 0 };
+	uint8_t payload[IB_CC_DATA_SZ] = { 0 };
+	uint64_t cc_key;
+	uint32_t cc_keyprotectbit;
+	uint32_t cc_keyleaseperiod;
+	uint32_t cc_keyviolations;
+	char *errstr;
+
+	if (argc != 4)
+		return "invalid number of parameters for CongestionKeyInfo";
+
+	if ((errstr = parselonglongint(argv[0], &cc_key)))
+		return errstr;
+	if ((errstr = parseint(argv[1], &cc_keyprotectbit, 0)))
+		return errstr;
+	if ((errstr = parseint(argv[2], &cc_keyleaseperiod, 0)))
+		return errstr;
+	if ((errstr = parseint(argv[3], &cc_keyviolations, 0)))
+		return errstr;
+
+	if (cc_keyprotectbit != 0 && cc_keyprotectbit != 1)
+		return "invalid cc_keyprotectbit value";
+
+	if (cc_keyleaseperiod > USHRT_MAX)
+		return "invalid cc_keyleaseperiod value";
+
+	if (cc_keyviolations > USHRT_MAX)
+		return "invalid cc_keyviolations value";
+
+	mad_set_field64(payload,
+			0,
+			IB_CC_CONGESTION_KEY_INFO_CC_KEY_F,
+			cc_key);
+
+	mad_encode_field(payload,
+			 IB_CC_CONGESTION_KEY_INFO_CC_KEY_PROTECT_BIT_F,
+			 &cc_keyprotectbit);
+
+	mad_encode_field(payload,
+			 IB_CC_CONGESTION_KEY_INFO_CC_KEY_LEASE_PERIOD_F,
+			 &cc_keyleaseperiod);
+
+	/* spec says "setting the counter to a value other than zero results
+	 * in the counter being left unchanged.  So if user wants no change,
+	 * they gotta input non-zero
+	 */
+        mad_encode_field(payload,
+			 IB_CC_CONGESTION_KEY_INFO_CC_KEY_VIOLATIONS_F,
+			 &cc_keyviolations);
+	
+	if (!cc_config_status_via(payload, rcv, dest, IB_CC_ATTR_CONGESTION_KEY_INFO,
+				  0, 0, NULL, srcport, cckey))
+		return "congestion key info config failed";
+
+	return NULL;
+}
+
+
+/* parse like it's a hypothetical 256 bit hex code */
+static char *parse256(char *arg, uint8_t *buf)
+{
+	int numdigits = 0;
+	int startindex;
+	char *ptr;
+	int i;
+
+	if (!strncmp(arg, "0x", 2) || !strncmp(arg, "0X", 2))
+		arg += 2;
+
+	for (ptr = arg; *ptr; ptr++) {
+		if (!isxdigit(*ptr))
+			return "invalid hex digit read";
+		numdigits++;
+	}
+
+	if (numdigits > 64)
+		return "hex code too long";
+
+	/* we need to imagine that this is like a 256-bit int stored
+	 * in big endian.  So we need to find the first index
+	 * point where the user's input would start in our array.
+	 */
+	startindex = 32 - ((numdigits - 1) / 2) - 1;
+
+	for (i = startindex; i <= 31; i++) {
+		char tmp[3] = { 0 };
+		uint32_t tmpint;
+		char *errstr;
+
+		/* I can't help but think there is a strtoX that
+		 * will do this for me, but I can't find it.
+		 */
+		if (i == startindex && numdigits % 2) {
+			memcpy(tmp, arg, 1);
+			arg++;
+		}
+		else {
+			memcpy(tmp, arg, 2);
+			arg += 2;
+		}
+
+		if ((errstr = parseint(tmp, &tmpint, 1)))
+			return errstr;
+		buf[i] = tmpint;
+	}
+
+	return NULL;
+}
+
+static char *parsecct(char *arg, uint32_t *shift, uint32_t *multiplier)
+{
+	char buf[1024] = { 0 };
+	char *errstr;
+	char *ptr;
+
+	strcpy(buf, arg);
+
+	if (!(ptr = strchr(buf, ':')))
+		return "ccts are formatted shift:multiplier";
+
+	*ptr = '\0';
+	ptr++;
+
+	if ((errstr = parseint(buf, shift, 0)))
+		return errstr;
+
+	if ((errstr = parseint(ptr, multiplier, 0)))
+		return errstr;
+
+	return NULL;	
+}
+
+static char *switch_congestion_setting(ib_portid_t * dest, char **argv, int argc)
+{
+	uint8_t rcv[IB_CC_DATA_SZ] = { 0 };
+	uint8_t payload[IB_CC_DATA_SZ] = { 0 };
+	uint32_t control_map;
+	uint8_t victim_mask[32] = { 0 };
+	uint8_t credit_mask[32] = { 0 };
+	uint32_t threshold;
+	uint32_t packet_size;
+	uint32_t cs_threshold;
+	uint32_t cs_returndelay_s;
+	uint32_t cs_returndelay_m;
+	uint32_t cs_returndelay;
+	uint32_t marking_rate;
+	char *errstr;
+
+	if (argc != 8)
+		return "invalid number of parameters for SwitchCongestionSetting";
+
+	if ((errstr = parseint(argv[0], &control_map, 0)))
+		return errstr;
+
+	if ((errstr = parse256(argv[1], victim_mask)))
+		return errstr;
+
+	if ((errstr = parse256(argv[2], credit_mask)))
+		return errstr;
+
+	if ((errstr = parseint(argv[3], &threshold, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[4], &packet_size, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[5], &cs_threshold, 0)))
+		return errstr;
+
+	if ((errstr = parsecct(argv[6], &cs_returndelay_s, &cs_returndelay_m)))
+		return errstr;
+
+	cs_returndelay = cs_returndelay_m;
+	cs_returndelay |= (cs_returndelay_s << 14);
+
+	if ((errstr = parseint(argv[7], &marking_rate, 0)))
+		return errstr;
+
+	mad_encode_field(payload,
+			 IB_CC_SWITCH_CONGESTION_SETTING_CONTROL_MAP_F,
+			 &control_map);
+
+	mad_set_array(payload,
+		      0,
+		      IB_CC_SWITCH_CONGESTION_SETTING_VICTIM_MASK_F,
+		      victim_mask);
+
+	mad_set_array(payload,
+		      0,
+		      IB_CC_SWITCH_CONGESTION_SETTING_CREDIT_MASK_F,
+		      credit_mask);
+
+	mad_encode_field(payload,
+			 IB_CC_SWITCH_CONGESTION_SETTING_THRESHOLD_F,
+			 &threshold);
+
+	mad_encode_field(payload,
+			 IB_CC_SWITCH_CONGESTION_SETTING_PACKET_SIZE_F,
+			 &packet_size);
+
+	mad_encode_field(payload,
+			 IB_CC_SWITCH_CONGESTION_SETTING_CS_THRESHOLD_F,
+			 &cs_threshold);
+
+	mad_encode_field(payload,
+			 IB_CC_SWITCH_CONGESTION_SETTING_CS_RETURN_DELAY_F,
+			 &cs_returndelay);
+
+	mad_encode_field(payload,
+			 IB_CC_SWITCH_CONGESTION_SETTING_MARKING_RATE_F,
+			 &marking_rate);
+
+	if (!cc_config_status_via(payload, rcv, dest, IB_CC_ATTR_SWITCH_CONGESTION_SETTING,
+				  0, 0, NULL, srcport, cckey))
+		return "switch congestion setting config failed";
+
+	return NULL;
+}
+
+static char *switch_port_congestion_setting(ib_portid_t * dest, char **argv, int argc)
+{
+	uint8_t rcv[IB_CC_DATA_SZ] = { 0 };
+	uint8_t payload[IB_CC_DATA_SZ] = { 0 };
+	uint8_t data[IB_CC_DATA_SZ] = { 0 };
+	uint32_t portnum;
+	uint32_t valid;
+	uint32_t control_type;
+	uint32_t threshold;
+	uint32_t packet_size;
+	uint32_t cong_parm_marking_rate;
+	uint32_t type;
+	uint32_t numports;
+	uint8_t *ptr;
+	char *errstr;
+
+	if (argc != 6)
+		return "invalid number of parameters for SwitchPortCongestion";
+
+	if ((errstr = parseint(argv[0], &portnum, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[1], &valid, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[2], &control_type, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[3], &threshold, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[4], &packet_size, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[5], &cong_parm_marking_rate, 0)))
+		return errstr;
+
+	if (!portnum)
+		return "invalid port number specified";
+
+	/* Figure out number of ports first */
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
+		return "node info config failed";
+
+	mad_decode_field((uint8_t *)data, IB_NODE_TYPE_F, &type);
+	mad_decode_field((uint8_t *)data, IB_NODE_NPORTS_F, &numports);
+
+	if (type != IB_NODE_SWITCH)
+		return "destination not a switch";
+
+	if (portnum > numports)
+		return "invalid port number specified";
+
+	/* We are modifying only 1 port, so get the current config */
+	if (!cc_query_status_via(payload, dest, IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING,
+				 (portnum - 1) / 32, 0, NULL, srcport, cckey))
+		return "switch congestion setting query failed";
+
+	ptr = payload + (((portnum % 32 - 1) * 4));
+
+	mad_encode_field(ptr,
+			 IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_VALID_F,
+			 &valid);
+
+	mad_encode_field(ptr,
+			 IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_CONTROL_TYPE_F,
+			 &control_type);
+
+	mad_encode_field(ptr,
+			 IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_THRESHOLD_F,
+			 &threshold);
+
+	mad_encode_field(ptr,
+			 IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_PACKET_SIZE_F,
+			 &packet_size);
+
+	mad_encode_field(ptr,
+			 IB_CC_SWITCH_PORT_CONGESTION_SETTING_ELEMENT_CONG_PARM_MARKING_RATE_F,
+			 &cong_parm_marking_rate);
+
+	if (!cc_config_status_via(payload, rcv, dest, IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING,
+				  (portnum - 1) / 32, 0, NULL, srcport, cckey))
+		return "switch congestion setting config failed";
+
+	return NULL;
+}
+
+static char *ca_congestion_setting(ib_portid_t * dest, char **argv, int argc)
+{
+	uint8_t rcv[IB_CC_DATA_SZ] = { 0 };
+	uint8_t payload[IB_CC_DATA_SZ] = { 0 };
+	uint32_t port_control;
+	uint32_t control_map;
+	uint32_t ccti_timer;
+	uint32_t ccti_increase;
+	uint32_t trigger_threshold;
+	uint32_t ccti_min;
+	char *errstr;
+	int i;
+
+	if (argc != 6)
+		return "invalid number of parameters for CACongestionSetting";
+
+	if ((errstr = parseint(argv[0], &port_control, 0)))
+		return errstr;
+	
+	if ((errstr = parseint(argv[1], &control_map, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[2], &ccti_timer, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[3], &ccti_increase, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[4], &trigger_threshold, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[5], &ccti_min, 0)))
+		return errstr;
+
+	mad_encode_field(payload,
+			 IB_CC_CA_CONGESTION_SETTING_PORT_CONTROL_F,
+			 &port_control);
+
+	mad_encode_field(payload,
+			 IB_CC_CA_CONGESTION_SETTING_CONTROL_MAP_F,
+			 &control_map);
+
+	for (i = 0; i < 16; i++) {
+		uint8_t *ptr;
+
+		if (!(control_map & (0x1 << i)))
+			continue;
+
+		ptr = payload + 2 + 2 + i * 8;
+
+		mad_encode_field(ptr,
+				 IB_CC_CA_CONGESTION_ENTRY_CCTI_TIMER_F,
+				 &ccti_timer);
+
+		mad_encode_field(ptr,
+				 IB_CC_CA_CONGESTION_ENTRY_CCTI_INCREASE_F,
+				 &ccti_increase);
+
+		mad_encode_field(ptr,
+				 IB_CC_CA_CONGESTION_ENTRY_TRIGGER_THRESHOLD_F,
+				 &trigger_threshold);
+
+		mad_encode_field(ptr,
+				 IB_CC_CA_CONGESTION_ENTRY_CCTI_MIN_F,
+				 &ccti_min);
+	}
+			 
+	if (!cc_config_status_via(payload, rcv, dest, IB_CC_ATTR_CA_CONGESTION_SETTING,
+				  0, 0, NULL, srcport, cckey))
+		return "ca congestion setting config failed";
+
+	return NULL;
+}
+
+static char *congestion_control_table(ib_portid_t * dest, char **argv, int argc)
+{
+	uint8_t rcv[IB_CC_DATA_SZ] = { 0 };
+	uint8_t payload[IB_CC_DATA_SZ] = { 0 };
+	uint32_t ccti_limit;
+	uint32_t index;
+	uint32_t cctshifts[64];
+	uint32_t cctmults[64];
+	char *errstr;
+	int i;
+
+	if (argc < 2 || argc > 66)
+		return "invalid number of parameters for CongestionControlTable";
+
+	if ((errstr = parseint(argv[0], &ccti_limit, 0)))
+		return errstr;
+
+	if ((errstr = parseint(argv[1], &index, 0)))
+		return errstr;
+
+	if (ccti_limit && (ccti_limit + 1) != (index * 64 + (argc - 2)))
+		return "invalid number of cct entries input given ccti_limit and index";
+
+	for (i = 0; i < (argc - 2); i++) {
+		if ((errstr = parsecct(argv[i + 2], &cctshifts[i], &cctmults[i])))
+			return errstr;
+	}
+
+	mad_encode_field(payload,
+			 IB_CC_CONGESTION_CONTROL_TABLE_CCTI_LIMIT_F,
+			 &ccti_limit);
+
+	for (i = 0; i < (argc - 2); i++) {
+		mad_encode_field(payload + 4 + i * 2,
+				 IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_CCT_SHIFT_F,
+				 &cctshifts[i]);
+
+		mad_encode_field(payload + 4 + i * 2,
+				 IB_CC_CONGESTION_CONTROL_TABLE_ENTRY_CCT_MULTIPLIER_F,
+				 &cctmults[i]);
+	}
+
+	if (!cc_config_status_via(payload, rcv, dest, IB_CC_ATTR_CONGESTION_CONTROL_TABLE,
+				  index, 0, NULL, srcport, cckey))
+		return "congestion control table config failed";	
+
+	return NULL;
+}
+
+static op_fn_t *match_op(char *name)
+{
+	const match_rec_t *r;
+	for (r = match_tbl; r->name; r++)
+		if (!strcasecmp(r->name, name) ||
+		    (r->alias && !strcasecmp(r->alias, name)))
+			return r->fn;
+	return NULL;
+}
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 'c':
+		cckey = (uint64_t) strtoull(optarg, 0, 0);
+		break;
+	default:
+		return -1;
+	}
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	char usage_args[1024];
+	int mgmt_classes[3] = { IB_SMI_CLASS, IB_SA_CLASS, IB_CC_CLASS };
+	ib_portid_t portid = { 0 };
+	char *err;
+	op_fn_t *fn;
+	const match_rec_t *r;
+	int n;
+
+	const struct ibdiag_opt opts[] = {
+		{"cckey", 'c', 1, "<key>", "CC key"},
+		{0}
+	};
+	const char *usage_examples[] = {
+		"SwitchCongestionSetting 2 0x1F 0x1FFFFFFFFF 0x0 0xF 8 0 0:0 1\t# Configure Switch Congestion Settings",
+		"CACongestionSetting 1 0 0x3 150 1 0 0\t\t# Configure CA Congestion Settings to SL 0 and SL 1",
+		"CACongestionSetting 1 0 0x4 200 1 0 0\t\t# Configure CA Congestion Settings to SL 2",
+		"CongestionControlTable 1 63 0 0:0 0:1 ...\t# Configure first block of Congestion Control Table",
+		"CongestionControlTable 1 127 0 0:64 0:65 ...\t# Configure second block of Congestion Control Table",
+		NULL
+	};
+
+	n = sprintf(usage_args, "[-c key] <op> <lid|guid>\n"
+		    "\nWARNING -- You should understand what you are "
+		    "doing before using this tool.  Misuse of this "
+		    "tool could result in a broken fabric.\n"
+		    "\nSupported ops (and aliases, case insensitive):\n");
+	for (r = match_tbl; r->name; r++) {
+		n += snprintf(usage_args + n, sizeof(usage_args) - n,
+			      "  %s (%s) <lid|guid>%s%s%s\n", r->name,
+			      r->alias ? r->alias : "",
+			      r->opt_portnum ? " <portnum>" : "",
+			      r->ops_extra ? " " : "",
+			      r->ops_extra ? r->ops_extra : "");
+		if (n >= sizeof(usage_args))
+			exit(-1);
+	}
+
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+			    usage_args, usage_examples);
+
+	argc -= optind;
+	argv += optind;
+
+	if (argc < 2)
+		ibdiag_show_usage();
+
+	if (!(fn = match_op(argv[0])))
+		IBERROR("operation '%s' not supported", argv[0]);
+
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
+
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
+		IBERROR("can't resolve destination %s", argv[1]);
+	if ((err = fn(&portid, argv + 2, argc - 2)))
+		IBERROR("operation %s: %s", argv[0], err);
+
+	mad_rpc_close_port(srcport);
+	exit(0);
+}
diff --git a/src/ibccquery.c b/src/ibccquery.c
new file mode 100644
index 0000000..476436f
--- /dev/null
+++ b/src/ibccquery.c
@@ -0,0 +1,427 @@
+/*
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
+ * Copyright (c) 2011 Lawrence Livermore National Lab.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <getopt.h>
+#include <netinet/in.h>
+
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
+#include <infiniband/mad.h>
+
+#include "ibdiag_common.h"
+
+struct ibmad_port *srcport;
+
+typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
+
+typedef struct match_rec {
+	const char *name, *alias;
+	op_fn_t *fn;
+	unsigned opt_portnum;
+} match_rec_t;
+
+static op_fn_t class_port_info;
+static op_fn_t congestion_info;
+static op_fn_t congestion_key_info;
+static op_fn_t congestion_log;
+static op_fn_t switch_congestion_setting;
+static op_fn_t switch_port_congestion_setting;
+static op_fn_t ca_congestion_setting;
+static op_fn_t congestion_control_table;
+static op_fn_t timestamp_dump;
+
+static const match_rec_t match_tbl[] = {
+	{"ClassPortInfo", "CP", class_port_info, 0},
+	{"CongestionInfo", "CI", congestion_info, 0},
+	{"CongestionKeyInfo", "CK", congestion_key_info, 0},
+	{"CongestionLog", "CL", congestion_log, 0},
+	{"SwitchCongestionSetting", "SS", switch_congestion_setting, 0},
+	{"SwitchPortCongestionSetting", "SP", switch_port_congestion_setting, 1},
+	{"CACongestionSetting", "CS", ca_congestion_setting, 0},
+	{"CongestionControlTable", "CT", congestion_control_table, 0},
+	{"Timestamp", "TI", timestamp_dump, 0},
+	{0}
+};
+
+uint64_t cckey = 0;
+
+/*******************************************/
+static char *class_port_info(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+
+	if (!cc_query_status_via(data, dest, CLASS_PORT_INFO,
+				 0, 0, NULL, srcport, cckey))
+		return "class port info query failed";
+
+	mad_dump_classportinfo(buf, sizeof buf, data, sizeof data);
+
+	printf("# ClassPortInfo: %s\n%s", portid2str(dest), buf);
+	return NULL;
+}
+
+static char *congestion_info(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_CONGESTION_INFO,
+				 0, 0, NULL, srcport, cckey))
+		return "congestion info query failed";
+
+	mad_dump_cc_congestioninfo(buf, sizeof buf, data, sizeof data);
+
+	printf("# CongestionInfo: %s\n%s", portid2str(dest), buf);
+	return NULL;
+}
+
+static char *congestion_key_info(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+	
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_CONGESTION_KEY_INFO,
+				 0, 0, NULL, srcport, cckey))
+		return "congestion key info query failed";
+
+	mad_dump_cc_congestionkeyinfo(buf, sizeof buf, data, sizeof data);
+
+	printf("# CongestionKeyInfo: %s\n%s", portid2str(dest), buf);
+	return NULL;
+}
+
+static char *congestion_log(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_LOG_DATA_SZ] = { 0 };
+	char emptybuf[16] = { 0 };
+	int i, type;
+
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_CONGESTION_LOG,
+				 0, 0, NULL, srcport, cckey))
+		return "congestion log query failed";
+
+	mad_decode_field((uint8_t *)data, IB_CC_CONGESTION_LOG_LOGTYPE_F, &type);
+
+	if (type != 1 && type != 2)
+		return "unrecognized log type";
+
+	mad_dump_cc_congestionlog(buf, sizeof buf, data, sizeof data);
+
+	printf("# CongestionLog: %s\n%s", portid2str(dest), buf);
+
+	if (type == 1) {
+		mad_dump_cc_congestionlogswitch(buf, sizeof buf, data, sizeof data);
+		printf("%s\n", buf);
+		for (i = 0; i < 15; i++) {
+			/* output only if entry not 0 */
+			if (memcmp(data + 40 + i * 12, emptybuf, 12)) {
+				mad_dump_cc_congestionlogentryswitch(buf, sizeof buf,
+								     data + 40 + i * 12,
+								     12);
+				printf("%s\n", buf);
+			}
+		}
+	}
+	else {
+		/* XXX: Q3/2010 errata lists first entry offset at 80, but we assume
+		 * will be updated to 96 once CurrentTimeStamp field is word aligned.
+		 * In addition, assume max 13 log events instead of 16.  Due to 
+		 * errata changes increasing size of CA log event, 16 log events is
+		 * no longer possible to fit in max MAD size.
+		 */
+		mad_dump_cc_congestionlogca(buf, sizeof buf, data, sizeof data);
+		printf("%s\n", buf);
+		for (i = 0; i < 13; i++) {
+			/* output only if entry not 0 */
+			if (memcmp(data + 12 + i * 16, emptybuf, 16)) {
+				mad_dump_cc_congestionlogentryca(buf, sizeof buf,
+								 data + 12 + i * 16,
+								 16);
+				printf("%s\n", buf);
+			}
+		}
+	}
+
+	return NULL;
+}
+
+static char *switch_congestion_setting(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+	
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_SWITCH_CONGESTION_SETTING,
+				 0, 0, NULL, srcport, cckey))
+		return "switch congestion setting query failed";
+
+	mad_dump_cc_switchcongestionsetting(buf, sizeof buf, data, sizeof data);
+
+	printf("# SwitchCongestionSetting: %s\n%s", portid2str(dest), buf);
+	return NULL;
+}
+
+static char *switch_port_congestion_setting(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+	int type, numports, maxblocks, i, j;
+	int portnum = 0;
+	int outputcount = 0;
+
+	if (argc > 0)
+		portnum = strtol(argv[0], 0, 0);
+
+	/* Figure out number of ports first */
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
+		return "node info query failed";
+
+	mad_decode_field((uint8_t *)data, IB_NODE_TYPE_F, &type);
+	mad_decode_field((uint8_t *)data, IB_NODE_NPORTS_F, &numports);
+
+	if (type != IB_NODE_SWITCH)
+		return "destination not a switch";
+
+	printf("# SwitchPortCongestionSetting: %s\n", portid2str(dest));
+
+	if (portnum) {
+		if (portnum > numports)
+			return "invalid port number specified";
+
+		memset(data, '\0', sizeof data);
+		if (!cc_query_status_via(data, dest, IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING,
+					 (portnum - 1) / 32, 0, NULL, srcport, cckey))
+			return "switch congestion setting query failed";
+
+		mad_dump_cc_switchportcongestionsettingelement(buf, sizeof buf,
+							       data + (((portnum % 32) - 1) * 4),
+							       4);
+		printf("%s", buf);
+		return NULL;
+	}
+
+	/* else get all port info */
+
+	maxblocks = ((numports - 1) / 32) + 1;
+
+	for (i = 0; i < maxblocks; i++) {
+		memset(data, '\0', sizeof data);
+		if (!cc_query_status_via(data, dest, IB_CC_ATTR_SWITCH_PORT_CONGESTION_SETTING,
+					 i, 0, NULL, srcport, cckey))
+			return "switch congestion setting query failed";
+
+		for (j = 0; j < 32 && outputcount < numports; j++) {
+			printf("Port:............................%u\n", i * 32 + j + 1);
+			mad_dump_cc_switchportcongestionsettingelement(buf, sizeof buf,
+								       data + j * 4,
+								       4);
+			printf("%s\n", buf);
+			outputcount++;
+		}
+	}
+
+	return NULL;
+}
+
+static char *ca_congestion_setting(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+	int i;
+	
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_CA_CONGESTION_SETTING,
+				 0, 0, NULL, srcport, cckey))
+		return "ca congestion setting query failed";
+
+	mad_dump_cc_cacongestionsetting(buf, sizeof buf, data, sizeof data);
+
+	printf("# CACongestionSetting: %s\n%s\n", portid2str(dest), buf);
+
+	for (i = 0; i < 16; i++) {
+		printf("SL:..............................%u\n", i);
+		mad_dump_cc_cacongestionentry(buf, sizeof buf,
+					      data + 4 + i * 8,
+					      8);
+		printf("%s\n", buf);
+	}
+	return NULL;
+}
+
+static char *congestion_control_table(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+	int limit, outputcount = 0;
+	int i, j;
+	
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_CONGESTION_CONTROL_TABLE,
+				 0, 0, NULL, srcport, cckey))
+		return "congestion control table query failed";
+
+	mad_decode_field((uint8_t *)data, IB_CC_CONGESTION_CONTROL_TABLE_CCTI_LIMIT_F, &limit);
+
+	mad_dump_cc_congestioncontroltable(buf, sizeof buf, data, sizeof data);
+
+	printf("# CongestionControlTable: %s\n%s\n", portid2str(dest), buf);
+
+	if (!limit)
+		return NULL;
+
+	for (i = 0; i < (limit/64) + 1; i++) {
+
+		/* first query done */
+		if (i)
+			if (!cc_query_status_via(data, dest, IB_CC_ATTR_CONGESTION_CONTROL_TABLE,
+					  i, 0, NULL, srcport, cckey))
+				return "congestion control table query failed";
+
+		for (j = 0; j < 64 && outputcount <= limit; j++) {
+			printf("Entry:...........................%u\n", i*64 + j);
+			mad_dump_cc_congestioncontroltableentry(buf, sizeof buf,
+								data + 4 + j * 2,
+								sizeof data - 4 - j * 2);
+			printf("%s\n", buf);
+			outputcount++;
+		}
+	}
+	return NULL;
+}
+
+static char *timestamp_dump(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2048];
+	char data[IB_CC_DATA_SZ] = { 0 };
+
+	if (!cc_query_status_via(data, dest, IB_CC_ATTR_TIMESTAMP,
+				 0, 0, NULL, srcport, cckey))
+		return "timestamp query failed";
+
+	mad_dump_cc_timestamp(buf, sizeof buf, data, sizeof data);
+
+	printf("# Timestamp: %s\n%s", portid2str(dest), buf);
+	return NULL;
+}
+
+static op_fn_t *match_op(char *name)
+{
+	const match_rec_t *r;
+	for (r = match_tbl; r->name; r++)
+		if (!strcasecmp(r->name, name) ||
+		    (r->alias && !strcasecmp(r->alias, name)))
+			return r->fn;
+	return NULL;
+}
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 'c':
+		cckey = (uint64_t) strtoull(optarg, 0, 0);
+		break;
+	default:
+		return -1;
+	}
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	char usage_args[1024];
+	int mgmt_classes[3] = { IB_SMI_CLASS, IB_SA_CLASS, IB_CC_CLASS };
+	ib_portid_t portid = { 0 };
+	char *err;
+	op_fn_t *fn;
+	const match_rec_t *r;
+	int n;
+
+	const struct ibdiag_opt opts[] = {
+		{"cckey", 'c', 1, "<key>", "CC key"},
+		{0}
+	};
+	const char *usage_examples[] = {
+		"CongestionInfo 3\t\t\t# Congestion Info by lid",
+		"SwitchPortCongestionSetting 3\t# Query all Switch Port Congestion Settings",
+		"SwitchPortCongestionSetting 3 1\t# Query Switch Port Congestion Setting for port 1",
+		NULL
+	};
+
+	n = sprintf(usage_args, "[-c key] <op> <lid|guid>\n"
+		    "\nSupported ops (and aliases, case insensitive):\n");
+	for (r = match_tbl; r->name; r++) {
+		n += snprintf(usage_args + n, sizeof(usage_args) - n,
+			      "  %s (%s) <lid|guid>%s\n", r->name,
+			      r->alias ? r->alias : "",
+			      r->opt_portnum ? " [<portnum>]" : "");
+		if (n >= sizeof(usage_args))
+			exit(-1);
+	}
+
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+			    usage_args, usage_examples);
+
+	argc -= optind;
+	argv += optind;
+
+	if (argc < 2)
+		ibdiag_show_usage();
+
+	if (!(fn = match_op(argv[0])))
+		IBERROR("operation '%s' not supported", argv[0]);
+
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
+
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
+		IBERROR("can't resolve destination %s", argv[1]);
+	if ((err = fn(&portid, argv + 2, argc - 2)))
+		IBERROR("operation %s: %s", argv[0], err);
+
+	mad_rpc_close_port(srcport);
+	exit(0);
+}
diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c
index 2d573b9..ebe8797 100644
--- a/src/ibdiag_common.c
+++ b/src/ibdiag_common.c
@@ -1,6 +1,10 @@
 /*
  * Copyright (c) 2006-2007 The Regents of the University of California.
- * Copyright (c) 2004-2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2010 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.
+ * Copyright (c) 2011 Lawrence Livermore National Security. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -46,15 +50,368 @@
 #include <unistd.h>
 #include <ctype.h>
 #include <config.h>
+#include <getopt.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+
+#include <infiniband/umad.h>
+#include <infiniband/mad.h>
+#include <ibdiag_common.h>
+#include <ibdiag_version.h>
+
+int ibverbose;
+enum MAD_DEST ibd_dest_type = IB_DEST_LID;
+ib_portid_t *ibd_sm_id;
+static ib_portid_t sm_portid = { 0 };
+
+/* general config options */
+#define IBDIAG_CONFIG_GENERAL IBDIAG_CONFIG_PATH"/ibdiag.conf"
+char *ibd_ca = NULL;
+int ibd_ca_port = 0;
+int ibd_timeout = 0;
+uint32_t ibd_ibnetdisc_flags = IBND_CONFIG_MLX_EPI;
+uint64_t ibd_mkey;
+uint64_t ibd_sakey = 0;
+int show_keys = 0;
+
+static const char *prog_name;
+static const char *prog_args;
+static const char **prog_examples;
+static struct option *long_opts = NULL;
+static const struct ibdiag_opt *opts_map[256];
+
+const static char *get_build_version(void)
+{
+	return "BUILD VERSION: " IBDIAG_VERSION " Build date: " __DATE__ " "
+	    __TIME__;
+}
+
+static void pretty_print(int start, int width, const char *str)
+{
+	int len = width - start;
+	const char *p, *e;
+
+	while (1) {
+		while (isspace(*str))
+			str++;
+		p = str;
+		do {
+			e = p + 1;
+			p = strchr(e, ' ');
+		} while (p && p - str < len);
+		if (!p) {
+			fprintf(stderr, "%s", str);
+			break;
+		}
+		if (e - str == 1)
+			e = p;
+		fprintf(stderr, "%.*s\n%*s", (int)(e - str), str, start, "");
+		str = e;
+	}
+}
+
+static inline int val_str_true(const char *val_str)
+{
+	return ((strncmp(val_str, "TRUE", strlen("TRUE")) == 0) ||
+		(strncmp(val_str, "true", strlen("true")) == 0));
+}
+
+void read_ibdiag_config(const char *file)
+{
+	char buf[1024];
+	FILE *config_fd = NULL;
+	char *p_prefix, *p_last;
+	char *name;
+	char *val_str;
+	struct stat statbuf;
+
+	/* silently ignore missing config file */
+	if (stat(file, &statbuf))
+		return;
+
+	config_fd = fopen(file, "r");
+	if (!config_fd)
+		return;
+
+	while (fgets(buf, sizeof buf, config_fd) != NULL) {
+		p_prefix = strtok_r(buf, "\n", &p_last);
+		if (!p_prefix)
+			continue; /* ignore blank lines */
 
-#include "ibdiag_common.h"
+		if (*p_prefix == '#')
+			continue; /* ignore comment lines */
 
-int ibdebug;
+		name = strtok_r(p_prefix, "=", &p_last);
+		val_str = strtok_r(NULL, "\n", &p_last);
 
-void
-iberror(const char *fn, char *msg, ...)
+		if (strncmp(name, "CA", strlen("CA")) == 0) {
+			free(ibd_ca);
+			ibd_ca = strdup(val_str);
+		} else if (strncmp(name, "Port", strlen("Port")) == 0) {
+			ibd_ca_port = strtoul(val_str, NULL, 0);
+		} else if (strncmp(name, "timeout", strlen("timeout")) == 0) {
+			ibd_timeout = strtoul(val_str, NULL, 0);
+		} else if (strncmp(name, "MLX_EPI", strlen("MLX_EPI")) == 0) {
+			if (val_str_true(val_str)) {
+				ibd_ibnetdisc_flags |= IBND_CONFIG_MLX_EPI;
+			} else {
+				ibd_ibnetdisc_flags &= ~IBND_CONFIG_MLX_EPI;
+			}
+		} else if (strncmp(name, "m_key", strlen("m_key")) == 0) {
+			ibd_mkey = strtoull(val_str, 0, 0);
+		} else if (strncmp(name, "sa_key",
+				   strlen("sa_key")) == 0) {
+			ibd_sakey = strtoull(val_str, 0, 0);
+		}
+	}
+
+	fclose(config_fd);
+}
+
+
+void ibdiag_show_usage()
 {
-	char buf[512], *s;
+	struct option *o = long_opts;
+	int n;
+
+	fprintf(stderr, "\nUsage: %s [options] %s\n\n", prog_name,
+		prog_args ? prog_args : "");
+
+	if (long_opts[0].name)
+		fprintf(stderr, "Options:\n");
+	for (o = long_opts; o->name; o++) {
+		const struct ibdiag_opt *io = opts_map[o->val];
+		n = fprintf(stderr, "  --%s", io->name);
+		if (isprint(io->letter))
+			n += fprintf(stderr, ", -%c", io->letter);
+		if (io->has_arg)
+			n += fprintf(stderr, " %s",
+				     io->arg_tmpl ? io->arg_tmpl : "<val>");
+		if (io->description && *io->description) {
+			n += fprintf(stderr, "%*s  ", 24 - n > 0 ? 24 - n : 0,
+				     "");
+			pretty_print(n, 74, io->description);
+		}
+		fprintf(stderr, "\n");
+	}
+
+	if (prog_examples) {
+		const char **p;
+		fprintf(stderr, "\nExamples:\n");
+		for (p = prog_examples; *p && **p; p++)
+			fprintf(stderr, "  %s %s\n", prog_name, *p);
+	}
+
+	fprintf(stderr, "\n");
+
+	exit(2);
+}
+
+static int process_opt(int ch, char *optarg)
+{
+	char *endp;
+	long val;
+
+	switch (ch) {
+	case 'z':
+		read_ibdiag_config(optarg);
+		break;
+	case 'h':
+		ibdiag_show_usage();
+		break;
+	case 'V':
+		fprintf(stderr, "%s %s\n", prog_name, get_build_version());
+		exit(0);
+	case 'e':
+		madrpc_show_errors(1);
+		break;
+	case 'v':
+		ibverbose++;
+		break;
+	case 'd':
+		ibdebug++;
+		madrpc_show_errors(1);
+		umad_debug(ibdebug - 1);
+		break;
+	case 'C':
+		ibd_ca = optarg;
+		break;
+	case 'P':
+		ibd_ca_port = strtoul(optarg, 0, 0);
+		break;
+	case 'D':
+		ibd_dest_type = IB_DEST_DRPATH;
+		break;
+	case 'L':
+		ibd_dest_type = IB_DEST_LID;
+		break;
+	case 'G':
+		ibd_dest_type = IB_DEST_GUID;
+		break;
+	case 't':
+		errno = 0;
+		val = strtol(optarg, &endp, 0);
+		if (errno || (endp && *endp != '\0') || val <= 0 ||
+		    val > INT_MAX)
+			IBERROR("Invalid timeout \"%s\".  Timeout requires a "
+				"positive integer value < %d.", optarg, INT_MAX);
+		else {
+			madrpc_set_timeout((int)val);
+			ibd_timeout = (int)val;
+		}
+		break;
+	case 's':
+		/* srcport is not required when resolving via IB_DEST_LID */
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &sm_portid, optarg,
+				IB_DEST_LID, 0, NULL) < 0)
+			IBERROR("cannot resolve SM destination port %s",
+				optarg);
+		ibd_sm_id = &sm_portid;
+		break;
+	case 'K':
+		show_keys = 1;
+		break;
+	case 'y':
+		errno = 0;
+		ibd_mkey = strtoull(optarg, &endp, 0);
+		if (errno || *endp != '\0') {
+			errno = 0;
+			ibd_mkey = strtoull(getpass("M_Key: "), &endp, 0);
+			if (errno || *endp != '\0') {
+				IBERROR("Bad M_Key");
+			}
+                }
+                break;
+	default:
+		return -1;
+	}
+
+	return 0;
+}
+
+static const struct ibdiag_opt common_opts[] = {
+	{"config", 'z', 1, "<config>", "use config file, default: " IBDIAG_CONFIG_GENERAL},
+	{"Ca", 'C', 1, "<ca>", "Ca name to use"},
+	{"Port", 'P', 1, "<port>", "Ca port number to use"},
+	{"Direct", 'D', 0, NULL, "use Direct address argument"},
+	{"Lid", 'L', 0, NULL, "use LID address argument"},
+	{"Guid", 'G', 0, NULL, "use GUID address argument"},
+	{"timeout", 't', 1, "<ms>", "timeout in ms"},
+	{"sm_port", 's', 1, "<lid>", "SM port lid"},
+	{"show_keys", 'K', 0, NULL, "display security keys in output"},
+	{"m_key", 'y', 1, "<key>", "M_Key to use in request"},
+	{"errors", 'e', 0, NULL, "show send and receive errors"},
+	{"verbose", 'v', 0, NULL, "increase verbosity level"},
+	{"debug", 'd', 0, NULL, "raise debug level"},
+	{"help", 'h', 0, NULL, "help message"},
+	{"version", 'V', 0, NULL, "show version"},
+	{0}
+};
+
+static void make_opt(struct option *l, const struct ibdiag_opt *o,
+		     const struct ibdiag_opt *map[])
+{
+	l->name = o->name;
+	l->has_arg = o->has_arg;
+	l->flag = NULL;
+	l->val = o->letter;
+	if (!map[l->val])
+		map[l->val] = o;
+}
+
+static struct option *make_long_opts(const char *exclude_str,
+				     const struct ibdiag_opt *custom_opts,
+				     const struct ibdiag_opt *map[])
+{
+	struct option *long_opts, *l;
+	const struct ibdiag_opt *o;
+	unsigned n = 0;
+
+	if (custom_opts)
+		for (o = custom_opts; o->name; o++)
+			n++;
+
+	long_opts = malloc((sizeof(common_opts) / sizeof(common_opts[0]) + n) *
+			   sizeof(*long_opts));
+	if (!long_opts)
+		return NULL;
+
+	l = long_opts;
+
+	if (custom_opts)
+		for (o = custom_opts; o->name; o++)
+			make_opt(l++, o, map);
+
+	for (o = common_opts; o->name; o++) {
+		if (exclude_str && strchr(exclude_str, o->letter))
+			continue;
+		make_opt(l++, o, map);
+	}
+
+	memset(l, 0, sizeof(*l));
+
+	return long_opts;
+}
+
+static void make_str_opts(const struct option *o, char *p, unsigned size)
+{
+	unsigned i, n = 0;
+
+	for (n = 0; o->name && n + 2 + o->has_arg < size; o++) {
+		p[n++] = (char)o->val;
+		for (i = 0; i < (unsigned)o->has_arg; i++)
+			p[n++] = ':';
+	}
+	p[n] = '\0';
+}
+
+int ibdiag_process_opts(int argc, char *const argv[], void *cxt,
+			const char *exclude_common_str,
+			const struct ibdiag_opt custom_opts[],
+			int (*custom_handler) (void *cxt, int val,
+					       char *optarg),
+			const char *usage_args, const char *usage_examples[])
+{
+	char str_opts[1024];
+	const struct ibdiag_opt *o;
+
+	prog_name = argv[0];
+	prog_args = usage_args;
+	prog_examples = usage_examples;
+
+	if (long_opts)
+		free(long_opts);
+
+	long_opts = make_long_opts(exclude_common_str, custom_opts, opts_map);
+	if (!long_opts)
+		return -1;
+
+	read_ibdiag_config(IBDIAG_CONFIG_GENERAL);
+
+	make_str_opts(long_opts, str_opts, sizeof(str_opts));
+
+	while (1) {
+		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
+		if (ch == -1)
+			break;
+		o = opts_map[ch];
+		if (!o)
+			ibdiag_show_usage();
+		if (custom_handler) {
+			if (custom_handler(cxt, ch, optarg) &&
+			    process_opt(ch, optarg))
+				ibdiag_show_usage();
+		} else if (process_opt(ch, optarg))
+			ibdiag_show_usage();
+	}
+
+	return 0;
+}
+
+void iberror(const char *fn, char *msg, ...)
+{
+	char buf[512];
 	va_list va;
 	int n;
 
@@ -63,14 +420,599 @@ iberror(const char *fn, char *msg, ...)
 	va_end(va);
 	buf[n] = 0;
 
-	if ((s = strrchr(argv0, '/')))
-		argv0 = s + 1;
-
 	if (ibdebug)
-		printf("%s: iberror: [pid %d] %s: failed: %s\n", argv0, getpid(), fn, buf);
+		printf("%s: iberror: [pid %d] %s: failed: %s\n",
+		       prog_name ? prog_name : "", getpid(), fn, buf);
 	else
-		printf("%s: iberror: failed: %s\n", argv0, buf);
+		printf("%s: iberror: failed: %s\n",
+		       prog_name ? prog_name : "", buf);
 
 	exit(-1);
 }
 
+char *
+conv_cnt_human_readable(uint64_t val64, float *val, int data)
+{
+	uint64_t tmp = val64;
+	int ui = 0;
+	int div = 1;
+
+	tmp /= 1024;
+	while (tmp) {
+		ui++;
+		tmp /= 1024;
+		div *= 1024;
+	}
+
+	*val = (float)(val64);
+	if (data) {
+		*val *= 4;
+		if (*val/div > 1024) {
+			ui++;
+			div *= 1024;
+		}
+	}
+	*val /= div;
+
+	if (data) {
+		switch (ui) {
+			case 0:
+				return ("B");
+			case 1:
+				return ("KB");
+			case 2:
+				return ("MB");
+			case 3:
+				return ("GB");
+			case 4:
+				return ("TB");
+			case 5:
+				return ("PB");
+			case 6:
+				return ("EB");
+			default:
+				return ("");
+		}
+	} else {
+		switch (ui) {
+			case 0:
+				return ("");
+			case 1:
+				return ("K");
+			case 2:
+				return ("M");
+			case 3:
+				return ("G");
+			case 4:
+				return ("T");
+			case 5:
+				return ("P");
+			case 6:
+				return ("E");
+			default:
+				return ("");
+		}
+	}
+	return ("");
+}
+
+int is_mlnx_ext_port_info_supported(uint32_t devid)
+{
+	if (ibd_ibnetdisc_flags & IBND_CONFIG_MLX_EPI) {
+		if (devid == 0xc738)
+			return 1;
+		if (devid >= 0x1003 && devid <= 0x1011)
+			return 1;
+	}
+	return 0;
+}
+
+/** =========================================================================
+ * Resolve the SM portid using the umad layer rather than using
+ * ib_resolve_smlid_via which requires a PortInfo query on the local port.
+ */
+int resolve_sm_portid(char *ca_name, uint8_t portnum, ib_portid_t *sm_id)
+{
+	umad_port_t port;
+	int rc;
+
+	if (!sm_id)
+		return (-1);
+
+	if ((rc = umad_get_port(ca_name, portnum, &port)) < 0)
+		return rc;
+
+	memset(sm_id, 0, sizeof(*sm_id));
+	sm_id->lid = port.sm_lid;
+	sm_id->sl = port.sm_sl;
+
+	umad_release_port(&port);
+
+	return 0;
+}
+
+/** =========================================================================
+ * Resolve local CA characteristics using the umad layer rather than using
+ * ib_resolve_self_via which requires SMP queries on the local port.
+ */
+int resolve_self(char *ca_name, uint8_t ca_port, ib_portid_t *portid,
+		 int *portnum, ibmad_gid_t *gid)
+{
+	umad_port_t port;
+	uint64_t prefix, guid;
+	int rc;
+
+	if (!(portid || portnum || gid))
+		return (-1);
+
+	if ((rc = umad_get_port(ca_name, ca_port, &port)) < 0)
+		return rc;
+
+	if (portid) {
+		memset(portid, 0, sizeof(*portid));
+		portid->lid = port.base_lid;
+		portid->sl = port.sm_sl;
+	}
+	if (portnum)
+		*portnum = port.portnum;
+	if (gid) {
+		memset(gid, 0, sizeof(*gid));
+		prefix = cl_hton64(port.gid_prefix);
+		guid = cl_hton64(port.port_guid);
+		mad_encode_field(*gid, IB_GID_PREFIX_F, &prefix);
+		mad_encode_field(*gid, IB_GID_GUID_F, &guid);
+	}
+
+	umad_release_port(&port);
+
+	return 0;
+}
+
+int resolve_gid(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
+		ibmad_gid_t gid, ib_portid_t * sm_id,
+		const struct ibmad_port *srcport)
+{
+	ib_portid_t sm_portid;
+	char buf[IB_SA_DATA_SIZE] = { 0 };
+
+	if (!sm_id) {
+		sm_id = &sm_portid;
+		if (resolve_sm_portid(ca_name, ca_port, sm_id) < 0)
+			return -1;
+	}
+
+	if ((portid->lid =
+	     ib_path_query_via(srcport, gid, gid, sm_id, buf)) < 0)
+		return -1;
+
+	return 0;
+}
+
+int resolve_guid(char *ca_name, uint8_t ca_port, ib_portid_t *portid,
+		 uint64_t *guid, ib_portid_t *sm_id,
+		 const struct ibmad_port *srcport)
+{
+	ib_portid_t sm_portid;
+	uint8_t buf[IB_SA_DATA_SIZE] = { 0 };
+	uint64_t prefix;
+	ibmad_gid_t selfgid;
+
+	if (!sm_id) {
+		sm_id = &sm_portid;
+		if (resolve_sm_portid(ca_name, ca_port, sm_id) < 0)
+			return -1;
+	}
+
+	if (resolve_self(ca_name, ca_port, NULL, NULL, &selfgid) < 0)
+		return -1;
+
+	memcpy(&prefix, portid->gid, sizeof(prefix));
+	if (!prefix)
+		mad_set_field64(portid->gid, 0, IB_GID_PREFIX_F,
+				IB_DEFAULT_SUBN_PREFIX);
+	if (guid)
+		mad_set_field64(portid->gid, 0, IB_GID_GUID_F, *guid);
+
+	if ((portid->lid =
+	     ib_path_query_via(srcport, selfgid, portid->gid, sm_id, buf)) < 0)
+		return -1;
+
+	mad_decode_field(buf, IB_SA_PR_SL_F, &portid->sl);
+	return 0;
+}
+
+/*
+ * Callers of this function should ensure their ibmad_port has been opened with
+ * IB_SA_CLASS as this function may require the SA to resolve addresses.
+ */
+int resolve_portid_str(char *ca_name, uint8_t ca_port, ib_portid_t * portid,
+		       char *addr_str, enum MAD_DEST dest_type,
+		       ib_portid_t *sm_id, const struct ibmad_port *srcport)
+{
+	ibmad_gid_t gid;
+	uint64_t guid;
+	int lid;
+	char *routepath;
+	ib_portid_t selfportid = { 0 };
+	int selfport = 0;
+
+	memset(portid, 0, sizeof *portid);
+
+	switch (dest_type) {
+	case IB_DEST_LID:
+		lid = strtol(addr_str, 0, 0);
+		if (!IB_LID_VALID(lid))
+			return -1;
+		return ib_portid_set(portid, lid, 0, 0);
+
+	case IB_DEST_DRPATH:
+		if (str2drpath(&portid->drpath, addr_str, 0, 0) < 0)
+			return -1;
+		return 0;
+
+	case IB_DEST_GUID:
+		if (!(guid = strtoull(addr_str, 0, 0)))
+			return -1;
+
+		/* keep guid in portid? */
+		return resolve_guid(ca_name, ca_port, portid, &guid, sm_id,
+				    srcport);
+
+	case IB_DEST_DRSLID:
+		lid = strtol(addr_str, &routepath, 0);
+		routepath++;
+		if (!IB_LID_VALID(lid))
+			return -1;
+		ib_portid_set(portid, lid, 0, 0);
+
+		/* handle DR parsing and set DrSLID to local lid */
+		if (resolve_self(ca_name, ca_port, &selfportid, &selfport,
+				 NULL) < 0)
+			return -1;
+		if (str2drpath(&portid->drpath, routepath, selfportid.lid, 0) <
+		    0)
+			return -1;
+		return 0;
+
+	case IB_DEST_GID:
+		if (inet_pton(AF_INET6, addr_str, &gid) <= 0)
+			return -1;
+		return resolve_gid(ca_name, ca_port, portid, gid, sm_id,
+				   srcport);
+	default:
+		IBWARN("bad dest_type %d", dest_type);
+	}
+
+	return -1;
+}
+
+/* define a common SA query structure
+ * This is by no means optimal but it moves the saquery functionality out of
+ * the saquery tool and provides it to other utilities.
+ */
+bind_handle_t sa_get_bind_handle(void)
+{
+	bind_handle_t handle;
+	handle = calloc(1, sizeof(*handle));
+	if (!handle)
+		IBPANIC("calloc failed");
+
+	resolve_sm_portid(ibd_ca, ibd_ca_port, &handle->dport);
+	if (!handle->dport.lid) {
+		IBWARN("No SM/SA found on port %s:%d",
+			ibd_ca ? "" : ibd_ca,
+			ibd_ca_port);
+		free(handle);
+		return (NULL);
+	}
+
+	handle->dport.qp = 1;
+	if (!handle->dport.qkey)
+		handle->dport.qkey = IB_DEFAULT_QP1_QKEY;
+
+	handle->fd = umad_open_port(ibd_ca, ibd_ca_port);
+	handle->agent = umad_register(handle->fd, IB_SA_CLASS, 2, 1, NULL);
+
+	return handle;
+}
+
+void sa_free_bind_handle(bind_handle_t h)
+{
+	umad_unregister(h->fd, h->agent);
+	umad_close_port(h->fd);
+	free(h);
+}
+
+int sa_query(bind_handle_t h, uint8_t method,
+		    uint16_t attr, uint32_t mod, uint64_t comp_mask,
+		    uint64_t sm_key, void *data, size_t datasz,
+		    struct sa_query_result *result)
+{
+	ib_rpc_t rpc;
+	void *umad, *mad;
+	int ret, offset, len = 256;
+
+	memset(&rpc, 0, sizeof(rpc));
+	rpc.mgtclass = IB_SA_CLASS;
+	rpc.method = method;
+	rpc.attr.id = attr;
+	rpc.attr.mod = mod;
+	rpc.mask = comp_mask;
+	rpc.datasz = datasz;
+	rpc.dataoffs = IB_SA_DATA_OFFS;
+
+	umad = calloc(1, len + umad_size());
+	if (!umad)
+		IBPANIC("cannot alloc mem for umad: %s\n", strerror(errno));
+
+	mad_build_pkt(umad, &rpc, &h->dport, NULL, data);
+
+	mad_set_field64(umad_get_mad(umad), 0, IB_SA_MKEY_F, sm_key);
+
+	if (ibdebug > 1)
+		xdump(stdout, "SA Request:\n", umad_get_mad(umad), len);
+
+	ret = umad_send(h->fd, h->agent, umad, len, ibd_timeout, 0);
+	if (ret < 0) {
+		IBWARN("umad_send failed: attr %u: %s\n",
+			attr, strerror(errno));
+		free(umad);
+		return (-ret);
+	}
+
+recv_mad:
+	ret = umad_recv(h->fd, umad, &len, ibd_timeout);
+	if (ret < 0) {
+		if (errno == ENOSPC) {
+			umad = realloc(umad, umad_size() + len);
+			goto recv_mad;
+		}
+		IBWARN("umad_recv failed: attr 0x%x: %s\n", attr,
+			strerror(errno));
+		free(umad);
+		return (-ret);
+	}
+
+	if ((ret = umad_status(umad)))
+		return ret;
+
+	mad = umad_get_mad(umad);
+
+	if (ibdebug > 1)
+		xdump(stdout, "SA Response:\n", mad, len);
+
+	method = (uint8_t) mad_get_field(mad, 0, IB_MAD_METHOD_F);
+	offset = mad_get_field(mad, 0, IB_SA_ATTROFFS_F);
+	result->status = mad_get_field(mad, 0, IB_MAD_STATUS_F);
+	result->p_result_madw = mad;
+	if (result->status != IB_SA_MAD_STATUS_SUCCESS)
+		result->result_cnt = 0;
+	else if (method != IB_MAD_METHOD_GET_TABLE)
+		result->result_cnt = 1;
+	else if (!offset)
+		result->result_cnt = 0;
+	else
+		result->result_cnt = (len - IB_SA_DATA_OFFS) / (offset << 3);
+
+	return 0;
+}
+
+void sa_free_result_mad(struct sa_query_result *result)
+{
+	if (result->p_result_madw) {
+		free((uint8_t *) result->p_result_madw - umad_size());
+		result->p_result_madw = NULL;
+	}
+}
+
+void *sa_get_query_rec(void *mad, unsigned i)
+{
+	int offset = mad_get_field(mad, 0, IB_SA_ATTROFFS_F);
+	return (uint8_t *) mad + IB_SA_DATA_OFFS + i * (offset << 3);
+}
+
+static const char *ib_sa_error_str[] = {
+	"SA_NO_ERROR",
+	"SA_ERR_NO_RESOURCES",
+	"SA_ERR_REQ_INVALID",
+	"SA_ERR_NO_RECORDS",
+	"SA_ERR_TOO_MANY_RECORDS",
+	"SA_ERR_REQ_INVALID_GID",
+	"SA_ERR_REQ_INSUFFICIENT_COMPONENTS",
+	"SA_ERR_REQ_DENIED",
+	"SA_ERR_STATUS_PRIO_SUGGESTED",
+	"SA_ERR_UNKNOWN"
+};
+
+#define ARR_SIZE(a) (sizeof(a)/sizeof((a)[0]))
+#define SA_ERR_UNKNOWN (ARR_SIZE(ib_sa_error_str) - 1)
+
+static inline const char *ib_sa_err_str(IN uint8_t status)
+{
+	if (status > SA_ERR_UNKNOWN)
+		status = SA_ERR_UNKNOWN;
+	return (ib_sa_error_str[status]);
+}
+
+void sa_report_err(int status)
+{
+	int st = status & 0xff;
+	char sm_err_str[64] = { 0 };
+	char sa_err_str[64] = { 0 };
+
+	if (st)
+		sprintf(sm_err_str, " SM(%s)", ib_get_err_str(st));
+
+	st = status >> 8;
+	if (st)
+		sprintf(sa_err_str, " SA(%s)", ib_sa_err_str((uint8_t) st));
+
+	fprintf(stderr, "ERROR: Query result returned 0x%04x, %s%s\n",
+		status, sm_err_str, sa_err_str);
+}
+
+static unsigned int get_max(unsigned int num)
+{
+	unsigned r = 0;		// r will be lg(num)
+
+	while (num >>= 1)	// unroll for more speed...
+		r++;
+
+	return (1 << r);
+}
+
+void get_max_msg(char *width_msg, char *speed_msg, int msg_size, ibnd_port_t * port)
+{
+	char buf[64];
+	uint32_t max_speed = 0;
+	uint32_t cap_mask, rem_cap_mask, fdr10;
+	uint8_t *info = NULL;
+
+	uint32_t max_width = get_max(mad_get_field(port->info, 0,
+						   IB_PORT_LINK_WIDTH_SUPPORTED_F)
+				     & mad_get_field(port->remoteport->info, 0,
+						     IB_PORT_LINK_WIDTH_SUPPORTED_F));
+	if ((max_width & mad_get_field(port->info, 0,
+				       IB_PORT_LINK_WIDTH_ACTIVE_F)) == 0)
+		// we are not at the max supported width
+		// print what we could be at.
+		snprintf(width_msg, msg_size, "Could be %s",
+			 mad_dump_val(IB_PORT_LINK_WIDTH_ACTIVE_F,
+				      buf, 64, &max_width));
+
+	if (port->node->type == IB_NODE_SWITCH) {
+		if (port->node->ports[0])
+			info = (uint8_t *)&port->node->ports[0]->info;
+	}
+	else
+		info = (uint8_t *)&port->info;
+
+	if (info)
+		cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+	else
+		cap_mask = 0;
+
+	info = NULL;
+	if (port->remoteport->node->type == IB_NODE_SWITCH) {
+		if (port->remoteport->node->ports[0])
+			info = (uint8_t *)&port->remoteport->node->ports[0]->info;
+	} else
+		info = (uint8_t *)&port->remoteport->info;
+
+	if (info)
+		rem_cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+	else
+		rem_cap_mask = 0;
+	if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS) &&
+	    rem_cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+		goto check_ext_speed;
+check_fdr10_supp:
+	fdr10 = (mad_get_field(port->ext_info, 0,
+			       IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F) & FDR10)
+		&& (mad_get_field(port->remoteport->ext_info, 0,
+				  IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F) & FDR10);
+	if (fdr10)
+		goto check_fdr10_active;
+
+	max_speed = get_max(mad_get_field(port->info, 0,
+					  IB_PORT_LINK_SPEED_SUPPORTED_F)
+			    & mad_get_field(port->remoteport->info, 0,
+					    IB_PORT_LINK_SPEED_SUPPORTED_F));
+	if ((max_speed & mad_get_field(port->info, 0,
+				       IB_PORT_LINK_SPEED_ACTIVE_F)) == 0)
+		// we are not at the max supported speed
+		// print what we could be at.
+		snprintf(speed_msg, msg_size, "Could be %s",
+			 mad_dump_val(IB_PORT_LINK_SPEED_ACTIVE_F,
+				      buf, 64, &max_speed));
+	return;
+
+check_ext_speed:
+	if (mad_get_field(port->info, 0,
+			  IB_PORT_LINK_SPEED_EXT_SUPPORTED_F) == 0 ||
+	    mad_get_field(port->remoteport->info, 0,
+			  IB_PORT_LINK_SPEED_EXT_SUPPORTED_F) == 0)
+		goto check_fdr10_supp;
+	max_speed = get_max(mad_get_field(port->info, 0,
+					  IB_PORT_LINK_SPEED_EXT_SUPPORTED_F)
+			    & mad_get_field(port->remoteport->info, 0,
+					    IB_PORT_LINK_SPEED_EXT_SUPPORTED_F));
+	if ((max_speed & mad_get_field(port->info, 0,
+				       IB_PORT_LINK_SPEED_EXT_ACTIVE_F)) == 0)
+		// we are not at the max supported extended speed
+		// print what we could be at.
+		snprintf(speed_msg, msg_size, "Could be %s",
+			 mad_dump_val(IB_PORT_LINK_SPEED_EXT_ACTIVE_F,
+				      buf, 64, &max_speed));
+	return;
+
+check_fdr10_active:
+	if ((mad_get_field(port->ext_info, 0,
+			   IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10) == 0)
+		snprintf(speed_msg, msg_size, "Could be FDR10");
+}
+
+int vsnprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		   const char *format, va_list va_args)
+{
+	int len, i, ret;
+
+	len = strlen(mad_field_name(f));
+        if (len + 2 > n || spacing + 1 > n)
+		return 0;
+
+	strncpy(buf, mad_field_name(f), n);
+	buf[len] = ':';
+	for (i = len+1; i < spacing+1; i++) {
+		buf[i] = '.';
+	}
+
+	ret = vsnprintf(&buf[spacing+1], n - spacing, format, va_args);
+	if (ret >= n - spacing)
+		buf[n] = '\0';
+
+	return ret + spacing;
+}
+
+int snprint_field(char *buf, size_t n, enum MAD_FIELDS f, int spacing,
+		  const char *format, ...)
+{
+	va_list val;
+	int ret;
+
+	va_start(val, format);
+	ret = vsnprint_field(buf, n, f, spacing, format, val);
+	va_end(val);
+
+	return ret;
+}
+
+void dump_portinfo(void *pi, int pisize, int tabs)
+{
+	int field, i;
+	char val[64];
+	char buf[1024];
+
+	for (field = IB_PORT_FIRST_F; field < IB_PORT_LAST_F; field++) {
+		for (i=0;i<tabs;i++)
+			printf("\t");
+		if (field == IB_PORT_MKEY_F && show_keys == 0) {
+			snprint_field(buf, 1024, field, 32, NOT_DISPLAYED_STR);
+		} else {
+			mad_decode_field(pi, field, val);
+			if (!mad_dump_field(field, buf, 1024, val))
+				return;
+		}
+		printf("%s\n", buf);
+	}
+
+	for (field = IB_PORT_CAPMASK2_F;
+	     field < IB_PORT_LINK_SPEED_EXT_LAST_F; field++) {
+		for (i=0;i<tabs;i++)
+			printf("\t");
+		mad_decode_field(pi, field, val);
+		if (!mad_dump_field(field, buf, 1024, val))
+			return;
+		printf("%s\n", buf);
+	}
+}
diff --git a/src/iblinkinfo.c b/src/iblinkinfo.c
new file mode 100644
index 0000000..5a4cfe5
--- /dev/null
+++ b/src/iblinkinfo.c
@@ -0,0 +1,765 @@
+/*
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2010,2011 Mellanox Technologies LTD.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <time.h>
+#include <string.h>
+#include <getopt.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#include <complib/cl_nodenamemap.h>
+#include <infiniband/ibnetdisc.h>
+
+#include "ibdiag_common.h"
+
+#define DIFF_FLAG_PORT_CONNECTION  0x01
+#define DIFF_FLAG_PORT_STATE       0x02
+#define DIFF_FLAG_LID              0x04
+#define DIFF_FLAG_NODE_DESCRIPTION 0x08
+
+#define DIFF_FLAG_DEFAULT (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE)
+
+static char *node_name_map_file = NULL;
+static nn_map_t *node_name_map = NULL;
+static char *load_cache_file = NULL;
+static char *diff_cache_file = NULL;
+static unsigned diffcheck_flags = DIFF_FLAG_DEFAULT;
+static char *filterdownports_cache_file = NULL;
+static ibnd_fabric_t *filterdownports_fabric = NULL;
+
+static uint64_t guid = 0;
+static char *guid_str = NULL;
+static char *dr_path = NULL;
+static int all = 0;
+
+static int down_links_only = 0;
+static int line_mode = 0;
+static int add_sw_settings = 0;
+static int only_flag = 0;
+static int only_type = 0;
+
+int filterdownport_check(ibnd_node_t * node, ibnd_port_t * port)
+{
+	ibnd_node_t *fsw;
+	ibnd_port_t *fport;
+	int fistate;
+
+	fsw = ibnd_find_node_guid(filterdownports_fabric, node->guid);
+
+	if (!fsw)
+		return 0;
+
+	if (port->portnum > fsw->numports)
+		return 0;
+
+	fport = fsw->ports[port->portnum];
+
+	if (!fport)
+		return 0;
+
+	fistate = mad_get_field(fport->info, 0, IB_PORT_STATE_F);
+
+	return (fistate == IB_LINK_DOWN) ? 1 : 0;
+}
+
+void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)
+{
+	char width[64], speed[64], state[64], physstate[64];
+	char remote_guid_str[256];
+	char remote_str[256];
+	char link_str[256];
+	char width_msg[256];
+	char speed_msg[256];
+	char ext_port_str[256];
+	int iwidth, ispeed, fdr10, espeed, istate, iphystate, cap_mask;
+	int n = 0;
+	uint8_t *info = NULL;
+
+	if (!port)
+		return;
+
+	iwidth = mad_get_field(port->info, 0, IB_PORT_LINK_WIDTH_ACTIVE_F);
+	ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
+	fdr10 = mad_get_field(port->ext_info, 0,
+			      IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10;
+
+	if (port->node->type == IB_NODE_SWITCH) {
+		if (port->node->ports[0])
+			info = (uint8_t *)&port->node->ports[0]->info;
+	}
+	else
+		info = (uint8_t *)&port->info;
+
+	if (info) {
+		cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+		if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+			espeed = mad_get_field(port->info, 0,
+					       IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+		else
+			espeed = 0;
+	} else {
+		ispeed = 0;
+		iwidth = 0;
+		espeed = 0;
+	}
+
+	istate = mad_get_field(port->info, 0, IB_PORT_STATE_F);
+	iphystate = mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F);
+
+	remote_guid_str[0] = '\0';
+	remote_str[0] = '\0';
+	link_str[0] = '\0';
+	width_msg[0] = '\0';
+	speed_msg[0] = '\0';
+
+	if (istate == IB_LINK_DOWN
+	    && filterdownports_fabric
+	    && filterdownport_check(node, port))
+		return;
+
+	/* C14-24.2.1 states that a down port allows for invalid data to be
+	 * returned for all PortInfo components except PortState and
+	 * PortPhysicalState */
+	if (istate != IB_LINK_DOWN) {
+		if (!espeed) {
+			if (fdr10)
+				sprintf(speed, "10.0 Gbps (FDR10)");
+			else
+				mad_dump_val(IB_PORT_LINK_SPEED_ACTIVE_F, speed,
+					     64, &ispeed);
+		} else
+			mad_dump_val(IB_PORT_LINK_SPEED_EXT_ACTIVE_F, speed,
+				     64, &espeed);
+
+		n = snprintf(link_str, 256, "(%3s %18s %6s/%8s)",
+		     mad_dump_val(IB_PORT_LINK_WIDTH_ACTIVE_F, width, 64,
+				  &iwidth),
+		     speed,
+		     mad_dump_val(IB_PORT_STATE_F, state, 64, &istate),
+		     mad_dump_val(IB_PORT_PHYS_STATE_F, physstate, 64,
+				  &iphystate));
+	} else {
+		n = snprintf(link_str, 256, "(              %6s/%8s)",
+		     mad_dump_val(IB_PORT_STATE_F, state, 64, &istate),
+		     mad_dump_val(IB_PORT_PHYS_STATE_F, physstate, 64,
+				  &iphystate));
+	}
+
+	/* again default values due to C14-24.2.1 */
+	if (add_sw_settings && istate != IB_LINK_DOWN) {
+		snprintf(link_str + n, 256 - n,
+			" (HOQ:%d VL_Stall:%d)",
+			mad_get_field(port->info, 0,
+				IB_PORT_HOQ_LIFE_F),
+			mad_get_field(port->info, 0,
+				IB_PORT_VL_STALL_COUNT_F));
+	}
+
+	if (port->remoteport) {
+		char *remap =
+		    remap_node_name(node_name_map, port->remoteport->node->guid,
+				    port->remoteport->node->nodedesc);
+
+		if (port->remoteport->ext_portnum)
+			snprintf(ext_port_str, 256, "%d",
+				 port->remoteport->ext_portnum);
+		else
+			ext_port_str[0] = '\0';
+
+		get_max_msg(width_msg, speed_msg, 256, port);
+
+		if (line_mode) {
+			snprintf(remote_guid_str, 256,
+				 "0x%016" PRIx64 " ",
+				 port->remoteport->guid);
+		}
+
+		snprintf(remote_str, 256, "%s%6d %4d[%2s] \"%s\" (%s %s)\n",
+			 remote_guid_str, port->remoteport->base_lid ?
+			 port->remoteport->base_lid :
+			 port->remoteport->node->smalid,
+			 port->remoteport->portnum, ext_port_str, remap,
+			 width_msg, speed_msg);
+		free(remap);
+	} else {
+		if (istate == IB_LINK_DOWN)
+			snprintf(remote_str, 256, "           [  ] \"\" ( )\n");
+		else
+			snprintf(remote_str, 256, "    \"Port not available\"\n");
+	}
+
+	if (port->ext_portnum)
+		snprintf(ext_port_str, 256, "%d", port->ext_portnum);
+	else
+		ext_port_str[0] = '\0';
+
+	if (line_mode) {
+		char *remap = remap_node_name(node_name_map, node->guid,
+					      node->nodedesc);
+		printf("%s0x%016" PRIx64 " \"%30s\" ",
+		       out_prefix ? out_prefix : "",
+		       port->guid, remap);
+		free(remap);
+	} else
+		printf("%s      ", out_prefix ? out_prefix : "");
+
+	if (port->node->type != IB_NODE_SWITCH) {
+		if (!line_mode)
+			printf("0x%016" PRIx64 " ", port->guid);
+
+		printf("%6d %4d[%2s] ==%s==>  %s",
+			port->base_lid,
+			port->portnum, ext_port_str, link_str, remote_str);
+	} else
+		printf("%6d %4d[%2s] ==%s==>  %s",
+			node->smalid, port->portnum, ext_port_str,
+			link_str, remote_str);
+}
+
+static inline const char *nodetype_str(ibnd_node_t * node)
+{
+	switch (node->type) {
+	case IB_NODE_SWITCH:
+		return "Switch";
+	case IB_NODE_CA:
+		return "CA";
+	case IB_NODE_ROUTER:
+		return "Router";
+	}
+	return "??";
+}
+
+void print_node_header(ibnd_node_t *node, int *out_header_flag,
+			char *out_prefix)
+{
+	uint64_t guid = 0;
+	if ((!out_header_flag || !(*out_header_flag)) && !line_mode) {
+		char *remap =
+			remap_node_name(node_name_map, node->guid, node->nodedesc);
+		if (node->type == IB_NODE_SWITCH) {
+			if (node->ports[0])
+				guid = node->ports[0]->guid;
+			else if (node->info)
+				guid = mad_get_field64(node->info, 0, IB_NODE_PORT_GUID_F);
+
+			printf("%s%s: 0x%016" PRIx64 " %s:\n",
+				out_prefix ? out_prefix : "",
+				nodetype_str(node),
+				guid,
+				remap);
+		} else
+			printf("%s%s: %s:\n",
+				out_prefix ? out_prefix : "",
+				nodetype_str(node), remap);
+		(*out_header_flag)++;
+		free(remap);
+	}
+}
+
+void print_node(ibnd_node_t * node, void *user_data)
+{
+	int i = 0;
+	int head_print = 0;
+	char *out_prefix = (char *)user_data;
+
+	for (i = 1; i <= node->numports; i++) {
+		ibnd_port_t *port = node->ports[i];
+		if (!port)
+			continue;
+		if (!down_links_only ||
+		    mad_get_field(port->info, 0,
+				  IB_PORT_STATE_F) == IB_LINK_DOWN) {
+			print_node_header(node, &head_print, out_prefix);
+			print_port(node, port, out_prefix);
+		}
+	}
+}
+
+struct iter_diff_data {
+        uint32_t diff_flags;
+        ibnd_fabric_t *fabric1;
+        ibnd_fabric_t *fabric2;
+        char *fabric1_prefix;
+        char *fabric2_prefix;
+};
+
+void diff_node_ports(ibnd_node_t * fabric1_node, ibnd_node_t * fabric2_node,
+		       int *head_print, struct iter_diff_data *data)
+{
+	int i = 0;
+
+	for (i = 1; i <= fabric1_node->numports; i++) {
+		ibnd_port_t *fabric1_port, *fabric2_port;
+		int output_diff = 0;
+
+		fabric1_port = fabric1_node->ports[i];
+		fabric2_port = fabric2_node->ports[i];
+
+		if (!fabric1_port && !fabric2_port)
+			continue;
+
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION) {
+			if ((fabric1_port && !fabric2_port)
+			    || (!fabric1_port && fabric2_port)
+			    || (fabric1_port->remoteport
+				&& !fabric2_port->remoteport)
+			    || (!fabric1_port->remoteport
+				&& fabric2_port->remoteport)
+			    || (fabric1_port->remoteport
+				&& fabric2_port->remoteport
+				&& fabric1_port->remoteport->guid !=
+				fabric2_port->remoteport->guid))
+				output_diff++;
+		}
+
+		/* if either fabric1_port or fabric2_port NULL, should be
+		 * handled by port connection diff code
+		 */
+		if (data->diff_flags & DIFF_FLAG_PORT_STATE
+		    && fabric1_port
+		    && fabric2_port) {
+			int state1, state2;
+
+			state1 = mad_get_field(fabric1_port->info, 0,
+					       IB_PORT_STATE_F);
+			state2 = mad_get_field(fabric2_port->info, 0,
+					       IB_PORT_STATE_F);
+
+			if (state1 != state2)
+				output_diff++;
+		}
+
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_LID
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && fabric1_port->remoteport->base_lid != fabric2_port->remoteport->base_lid)
+			output_diff++;
+
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && memcmp(fabric1_port->remoteport->node->nodedesc,
+			      fabric2_port->remoteport->node->nodedesc,
+			      IB_SMP_DATA_SIZE))
+			output_diff++;
+
+		if (output_diff && fabric1_port) {
+			print_node_header(fabric1_node,
+					    head_print,
+					    NULL);
+			print_port(fabric1_node,
+				   fabric1_port,
+				   data->fabric1_prefix);
+		}
+
+		if (output_diff && fabric2_port) {
+			print_node_header(fabric1_node,
+					    head_print,
+					    NULL);
+			print_port(fabric2_node,
+				   fabric2_port,
+				   data->fabric2_prefix);
+		}
+	}
+}
+
+void diff_node_iter(ibnd_node_t * fabric1_node, void *iter_user_data)
+{
+	struct iter_diff_data *data = iter_user_data;
+	ibnd_node_t *fabric2_node;
+	int head_print = 0;
+
+	DEBUG("DEBUG: fabric1_node %p\n", fabric1_node);
+
+	fabric2_node = ibnd_find_node_guid(data->fabric2, fabric1_node->guid);
+	if (!fabric2_node)
+		print_node(fabric1_node, data->fabric1_prefix);
+	else if (data->diff_flags &
+		 (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE
+		  | DIFF_FLAG_LID | DIFF_FLAG_NODE_DESCRIPTION)) {
+
+		if ((fabric1_node->type == IB_NODE_SWITCH
+		     && data->diff_flags & DIFF_FLAG_LID
+		     && fabric1_node->smalid != fabric2_node->smalid) ||
+		    (data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		     && memcmp(fabric1_node->nodedesc, fabric2_node->nodedesc,
+			       IB_SMP_DATA_SIZE))) {
+			print_node_header(fabric1_node,
+					    NULL,
+					    data->fabric1_prefix);
+			print_node_header(fabric2_node,
+					    NULL,
+					    data->fabric2_prefix);
+			head_print++;
+		}
+
+		if (fabric1_node->numports != fabric2_node->numports) {
+			print_node_header(fabric1_node,
+					    &head_print,
+					    NULL);
+			printf("%snumports = %d\n", data->fabric1_prefix,
+			       fabric1_node->numports);
+			printf("%snumports = %d\n", data->fabric2_prefix,
+			       fabric2_node->numports);
+			return;
+		}
+
+		diff_node_ports(fabric1_node, fabric2_node,
+				  &head_print, data);
+	}
+}
+
+int diff_node(ibnd_node_t * node, ibnd_fabric_t * orig_fabric,
+		ibnd_fabric_t * new_fabric)
+{
+	struct iter_diff_data iter_diff_data;
+
+	iter_diff_data.diff_flags = diffcheck_flags;
+	iter_diff_data.fabric1 = orig_fabric;
+	iter_diff_data.fabric2 = new_fabric;
+	iter_diff_data.fabric1_prefix = "< ";
+	iter_diff_data.fabric2_prefix = "> ";
+	if (node)
+		diff_node_iter(node, &iter_diff_data);
+	else {
+		if (only_flag)
+			ibnd_iter_nodes_type(orig_fabric, diff_node_iter,
+					     only_type, &iter_diff_data);
+		else
+			ibnd_iter_nodes(orig_fabric, diff_node_iter,
+					&iter_diff_data);
+	}
+
+	/* Do opposite diff to find existence of node types
+	 * in new_fabric but not in orig_fabric.
+	 *
+	 * In this diff, we don't need to check port connections,
+	 * port state, lids, or node descriptions since it has already
+	 * been done (i.e. checks are only done when guid exists on both
+	 * orig and new).
+	 */
+	iter_diff_data.diff_flags = diffcheck_flags & ~DIFF_FLAG_PORT_CONNECTION;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_PORT_STATE;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_LID;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_NODE_DESCRIPTION;
+	iter_diff_data.fabric1 = new_fabric;
+	iter_diff_data.fabric2 = orig_fabric;
+	iter_diff_data.fabric1_prefix = "> ";
+	iter_diff_data.fabric2_prefix = "< ";
+	if (node)
+		diff_node_iter(node, &iter_diff_data);
+	else {
+		if (only_flag)
+			ibnd_iter_nodes_type(new_fabric, diff_node_iter,
+					     only_type, &iter_diff_data);
+		else
+			ibnd_iter_nodes(new_fabric, diff_node_iter,
+					&iter_diff_data);
+	}
+
+	return 0;
+}
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	struct ibnd_config *cfg = context;
+	char *p;
+
+	switch (ch) {
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
+	case 2:
+		load_cache_file = strdup(optarg);
+		break;
+	case 3:
+		diff_cache_file = strdup(optarg);
+		break;
+	case 4:
+		diffcheck_flags = 0;
+		p = strtok(optarg, ",");
+		while (p) {
+			if (!strcasecmp(p, "port"))
+				diffcheck_flags |= DIFF_FLAG_PORT_CONNECTION;
+			else if (!strcasecmp(p, "state"))
+				diffcheck_flags |= DIFF_FLAG_PORT_STATE;
+			else if (!strcasecmp(p, "lid"))
+				diffcheck_flags |= DIFF_FLAG_LID;
+			else if (!strcasecmp(p, "nodedesc"))
+				diffcheck_flags |= DIFF_FLAG_NODE_DESCRIPTION;
+			else {
+				fprintf(stderr, "invalid diff check key: %s\n",
+					p);
+				return -1;
+			}
+			p = strtok(NULL, ",");
+		}
+		break;
+	case 5:
+		filterdownports_cache_file = strdup(optarg);
+		break;
+	case 6:
+		only_flag = 1;
+		only_type = IB_NODE_SWITCH;
+		break;
+	case 7:
+		only_flag = 1;
+		only_type = IB_NODE_CA;
+		break;
+	case 'S':
+	case 'G':
+		guid_str = optarg;
+		guid = (uint64_t) strtoull(guid_str, 0, 0);
+		break;
+	case 'D':
+		dr_path = strdup(optarg);
+		break;
+	case 'a':
+		all = 1;
+		break;
+	case 'n':
+		cfg->max_hops = strtoul(optarg, NULL, 0);
+		break;
+	case 'd':
+		down_links_only = 1;
+		break;
+	case 'l':
+		line_mode = 1;
+		break;
+	case 'p':
+		add_sw_settings = 1;
+		break;
+	case 'R':		/* nop */
+		break;
+	case 'o':
+		cfg->max_smps = strtoul(optarg, NULL, 0);
+		break;
+	default:
+		return -1;
+	}
+
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	struct ibnd_config config = { 0 };
+	int rc = 0;
+	int resolved = -1;
+	ibnd_fabric_t *fabric = NULL;
+	ibnd_fabric_t *diff_fabric = NULL;
+	struct ibmad_port *ibmad_port;
+	ib_portid_t port_id = { 0 };
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
+
+	const struct ibdiag_opt opts[] = {
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
+		{"switch", 'S', 1, "<port_guid>",
+		 "start partial scan at the port specified by <port_guid> (hex format)"},
+		{"port-guid", 'G', 1, "<port_guid>",
+		 "(same as -S)"},
+		{"Direct", 'D', 1, "<dr_path>",
+		 "start partial scan at the port specified by <dr_path>"},
+		{"all", 'a', 0, NULL,
+		 "print all nodes found in a partial fabric scan"},
+		{"hops", 'n', 1, "<hops>",
+		 "Number of hops to include away from specified node"},
+		{"down", 'd', 0, NULL, "print only down links"},
+		{"line", 'l', 0, NULL,
+		 "(line mode) print all information for each link on a single line"},
+		{"additional", 'p', 0, NULL,
+		 "print additional port settings (PktLifeTime, HoqLife, VLStallCount)"},
+		{"load-cache", 2, 1, "<file>",
+		 "filename of ibnetdiscover cache to load"},
+		{"diff", 3, 1, "<file>",
+		 "filename of ibnetdiscover cache to diff"},
+		{"diffcheck", 4, 1, "<key(s)>",
+		 "specify checks to execute for --diff"},
+		{"filterdownports", 5, 1, "<file>",
+		 "filename of ibnetdiscover cache to filter downports"},
+		{"outstanding_smps", 'o', 1, NULL,
+		 "specify the number of outstanding SMP's which should be "
+		 "issued during the scan"},
+		{"switches-only", 6, 0, NULL,
+		 "Output only switches"},
+		{"cas-only", 7, 0, NULL,
+		 "Output only CAs"},
+		{"GNDN", 'R', 0, NULL,
+		 "(This option is obsolete and does nothing)"},
+		{0}
+	};
+	char usage_args[] = "";
+
+	ibdiag_process_opts(argc, argv, &config, "aDdGgKLlnpRS", opts,
+			    process_opt, usage_args, NULL);
+
+	argc -= optind;
+	argv += optind;
+
+	ibmad_port = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!ibmad_port) {
+		fprintf(stderr, "Failed to open %s port %d\n", ibd_ca,
+			ibd_ca_port);
+		exit(1);
+	}
+
+	smp_mkey_set(ibmad_port, ibd_mkey);
+
+	if (ibd_timeout) {
+		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
+		config.timeout_ms = ibd_timeout;
+	}
+
+	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
+
+	node_name_map = open_node_name_map(node_name_map_file);
+
+	if (dr_path && load_cache_file) {
+		fprintf(stderr, "Cannot specify cache and direct route path\n");
+		exit(1);
+	}
+
+	if (dr_path) {
+		/* only scan part of the fabric */
+		if ((resolved =
+		     resolve_portid_str(ibd_ca, ibd_ca_port, &port_id, dr_path,
+					IB_DEST_DRPATH, NULL, ibmad_port)) < 0)
+			IBWARN("Failed to resolve %s; attempting full scan",
+			       dr_path);
+	} else if (guid_str) {
+		if ((resolved =
+		     resolve_portid_str(ibd_ca, ibd_ca_port, &port_id,
+				        guid_str, IB_DEST_GUID, NULL,
+					ibmad_port)) < 0)
+			IBWARN("Failed to resolve %s; attempting full scan\n",
+			       guid_str);
+	}
+
+	if (diff_cache_file &&
+	    !(diff_fabric = ibnd_load_fabric(diff_cache_file, 0)))
+		IBERROR("loading cached fabric for diff failed\n");
+
+	if (filterdownports_cache_file &&
+	    !(filterdownports_fabric = ibnd_load_fabric(filterdownports_cache_file, 0)))
+		IBERROR("loading cached fabric for filterdownports failed\n");
+
+	if (load_cache_file) {
+		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL) {
+			fprintf(stderr, "loading cached fabric failed\n");
+			exit(1);
+		}
+	} else {
+		if (resolved >= 0) {
+			if (!config.max_hops)
+				config.max_hops = 1;
+			if (!(fabric =
+			    ibnd_discover_fabric(ibd_ca, ibd_ca_port, &port_id, &config)))
+				IBWARN("Partial fabric scan failed;"
+				       " attempting full scan\n");
+		}
+
+		if (!fabric &&
+		    !(fabric = ibnd_discover_fabric(ibd_ca, ibd_ca_port, NULL, &config))) {
+			fprintf(stderr, "discover failed\n");
+			rc = 1;
+			goto close_port;
+		}
+	}
+
+	if (!all && guid_str) {
+		ibnd_port_t *p = ibnd_find_port_guid(fabric, guid);
+		if (p && (!only_flag || p->node->type == only_type)) {
+			ibnd_node_t *n = p->node;
+			if (diff_fabric)
+				diff_node(n, diff_fabric, fabric);
+			else
+				print_node(n, NULL);
+		}
+		else
+			fprintf(stderr, "Failed to find port: %s\n", guid_str);
+	} else if (!all && dr_path) {
+		ibnd_port_t *p = NULL;
+		uint8_t ni[IB_SMP_DATA_SIZE] = { 0 };
+
+		if (!smp_query_via(ni, &port_id, IB_ATTR_NODE_INFO, 0,
+				   ibd_timeout, ibmad_port))
+			return -1;
+		mad_decode_field(ni, IB_NODE_PORT_GUID_F, &(guid));
+
+		p = ibnd_find_port_guid(fabric, guid);
+		if (p && (!only_flag || p->node->type == only_type)) {
+			ibnd_node_t *n = p->node;
+			if (diff_fabric)
+				diff_node(n, diff_fabric, fabric);
+			else
+				print_node(n, NULL);
+		}
+		else
+			fprintf(stderr, "Failed to find port: %s\n", dr_path);
+	} else {
+		if (diff_fabric)
+			diff_node(NULL, diff_fabric, fabric);
+		else {
+			if (only_flag)
+				ibnd_iter_nodes_type(fabric, print_node,
+						     only_type, NULL);
+			else
+				ibnd_iter_nodes(fabric, print_node, NULL);
+		}
+	}
+
+	ibnd_destroy_fabric(fabric);
+	if (diff_fabric)
+		ibnd_destroy_fabric(diff_fabric);
+
+close_port:
+	close_node_name_map(node_name_map);
+	mad_rpc_close_port(ibmad_port);
+	exit(rc);
+}
diff --git a/src/ibnetdiscover.c b/src/ibnetdiscover.c
index 2cfaa8a..b9fb243 100644
--- a/src/ibnetdiscover.c
+++ b/src/ibnetdiscover.c
@@ -1,6 +1,8 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2010,2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,1019 +35,1109 @@
  */
 
 #if HAVE_CONFIG_H
-#  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#include <config.h>
+#endif				/* HAVE_CONFIG_H */
 
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <time.h>
 #include <string.h>
 #include <getopt.h>
-#include <errno.h>
 #include <inttypes.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <complib/cl_nodenamemap.h>
+#include <infiniband/ibnetdisc.h>
 
-#include "ibnetdiscover.h"
-#include "grouping.h"
 #include "ibdiag_common.h"
 
-static char *node_type_str[] = {
-	"???",
-	"ca",
-	"switch",
-	"router",
-	"iwarp rnic"
-};
+#define LIST_CA_NODE	 (1 << IB_NODE_CA)
+#define LIST_SWITCH_NODE (1 << IB_NODE_SWITCH)
+#define LIST_ROUTER_NODE (1 << IB_NODE_ROUTER)
 
-static char *linkwidth_str[] = {
-	"??",
-	"1x",
-	"4x",
-	"??",
-	"8x",
-	"??",
-	"??",
-	"??",
-	"12x"
-};
+#define DIFF_FLAG_SWITCH           0x01
+#define DIFF_FLAG_CA               0x02
+#define DIFF_FLAG_ROUTER           0x04
+#define DIFF_FLAG_PORT_CONNECTION  0x08
+#define DIFF_FLAG_LID              0x10
+#define DIFF_FLAG_NODE_DESCRIPTION 0x20
 
-static char *linkspeed_str[] = {
-	"???",
-	"SDR",
-	"DDR",
-	"???",
-	"QDR"
-};
+#define DIFF_FLAG_DEFAULT (DIFF_FLAG_SWITCH | DIFF_FLAG_CA | DIFF_FLAG_ROUTER \
+			   | DIFF_FLAG_PORT_CONNECTION)
 
-static int timeout = 2000;		/* ms */
-static int dumplevel = 0;
-static int verbose;
 static FILE *f;
 
-char *argv0 = "ibnetdiscover";
-
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
+static char *cache_file = NULL;
+static char *load_cache_file = NULL;
+static char *diff_cache_file = NULL;
+static unsigned diffcheck_flags = DIFF_FLAG_DEFAULT;
 
-Node *nodesdist[MAXHOPS+1];     /* last is Ca list */
-Node *mynode;
-int maxhops_discovered = 0;
-
-struct ChassisList *chassis = NULL;
+static int report_max_hops = 0;
+static int full_info;
 
-static char *
-get_linkwidth_str(int linkwidth)
-{
-	if (linkwidth > 8)
-		return linkwidth_str[0];
-	else
-		return linkwidth_str[linkwidth];
-}
-
-static char *
-get_linkspeed_str(int linkspeed)
-{
-	if (linkspeed > 4)
-		return linkspeed_str[0];
-	else
-		return linkspeed_str[linkspeed];
-}
-
-static inline const char*
-node_type_str2(Node *node)
-{
-	switch(node->type) {
-	case SWITCH_NODE: return "SW";
-	case CA_NODE:     return "CA";
-	case ROUTER_NODE: return "RT";
-	}
-	return "??";
-}
-
-void
-decode_port_info(void *pi, Port *port)
-{
-	mad_decode_field(pi, IB_PORT_LID_F, &port->lid);
-	mad_decode_field(pi, IB_PORT_LMC_F, &port->lmc);
-	mad_decode_field(pi, IB_PORT_STATE_F, &port->state);
-	mad_decode_field(pi, IB_PORT_PHYS_STATE_F, &port->physstate);
-	mad_decode_field(pi, IB_PORT_LINK_WIDTH_ACTIVE_F, &port->linkwidth);
-	mad_decode_field(pi, IB_PORT_LINK_SPEED_ACTIVE_F, &port->linkspeed);
-}
-
-
-int
-get_port(Port *port, int portnum, ib_portid_t *portid)
-{
-	char portinfo[64];
-	void *pi = portinfo;
-
-	port->portnum = portnum;
-
-	if (!smp_query(pi, portid, IB_ATTR_PORT_INFO, portnum, timeout))
-		return -1;
-	decode_port_info(pi, port);
-
-	DEBUG("portid %s portnum %d: lid %d state %d physstate %d %s %s",
-		portid2str(portid), portnum, port->lid, port->state, port->physstate, get_linkwidth_str(port->linkwidth), get_linkspeed_str(port->linkspeed));
-	return 1;
-}
-/*
- * Returns 0 if non switch node is found, 1 if switch is found, -1 if error.
+/**
+ * Define our own conversion functions to maintain compatibility with the old
+ * ibnetdiscover which did not use the ibmad conversion functions.
  */
-int
-get_node(Node *node, Port *port, ib_portid_t *portid)
-{
-	char portinfo[64];
-	char switchinfo[64];
-	void *pi = portinfo, *ni = node->nodeinfo, *nd = node->nodedesc;
-	void *si = switchinfo;
-
-	if (!smp_query(ni, portid, IB_ATTR_NODE_INFO, 0, timeout))
-		return -1;
-
-	mad_decode_field(ni, IB_NODE_GUID_F, &node->nodeguid);
-	mad_decode_field(ni, IB_NODE_TYPE_F, &node->type);
-	mad_decode_field(ni, IB_NODE_NPORTS_F, &node->numports);
-	mad_decode_field(ni, IB_NODE_DEVID_F, &node->devid);
-	mad_decode_field(ni, IB_NODE_VENDORID_F, &node->vendid);
-	mad_decode_field(ni, IB_NODE_SYSTEM_GUID_F, &node->sysimgguid);
-	mad_decode_field(ni, IB_NODE_PORT_GUID_F, &node->portguid);
-	mad_decode_field(ni, IB_NODE_LOCAL_PORT_F, &node->localport);
-	port->portnum = node->localport;
-	port->portguid = node->portguid;
-
-	if (!smp_query(nd, portid, IB_ATTR_NODE_DESC, 0, timeout))
-		return -1;
-
-	if (!smp_query(pi, portid, IB_ATTR_PORT_INFO, 0, timeout))
-		return -1;
-	decode_port_info(pi, port);
-
-	if (node->type != SWITCH_NODE)
-		return 0;
-
-	node->smalid = port->lid;
-	node->smalmc = port->lmc;
-
-	/* after we have the sma information find out the real PortInfo for this port */
-	if (!smp_query(pi, portid, IB_ATTR_PORT_INFO, node->localport, timeout))
-	        return -1;
-	decode_port_info(pi, port);
-
-        if (!smp_query(si, portid, IB_ATTR_SWITCH_INFO, 0, timeout))
-                node->smaenhsp0 = 0;	/* assume base SP0 */
-	else
-        	mad_decode_field(si, IB_SW_ENHANCED_PORT0_F, &node->smaenhsp0);
-
-	DEBUG("portid %s: got switch node %" PRIx64 " '%s'",
-	      portid2str(portid), node->nodeguid, node->nodedesc);
-	return 1;
-}
-
-static int
-extend_dpath(ib_dr_path_t *path, int nextport)
-{
-	if (path->cnt+2 >= sizeof(path->p))
-		return -1;
-	++path->cnt;
-	if (path->cnt > maxhops_discovered)
-		maxhops_discovered = path->cnt;
-	path->p[path->cnt] = nextport;
-	return path->cnt;
-}
-
-static void
-dump_endnode(ib_portid_t *path, char *prompt, Node *node, Port *port)
-{
-	if (!dumplevel)
-		return;
-
-	fprintf(f, "%s -> %s %s {%016" PRIx64 "} portnum %d lid %d-%d\"%s\"\n",
-		portid2str(path), prompt,
-		(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-		node->nodeguid, node->type == SWITCH_NODE ? 0 : port->portnum,
-		port->lid, port->lid + (1 << port->lmc) - 1,
-		clean_nodedesc(node->nodedesc));
-}
-
-#define HASHGUID(guid)		((uint32_t)(((uint32_t)(guid) * 101) ^ ((uint32_t)((guid) >> 32) * 103)))
-#define HTSZ 137
-
-static Node *nodestbl[HTSZ];
-
-static Node *
-find_node(Node *new)
-{
-	int hash = HASHGUID(new->nodeguid) % HTSZ;
-	Node *node;
-
-	for (node = nodestbl[hash]; node; node = node->htnext)
-		if (node->nodeguid == new->nodeguid)
-			return node;
-
-	return NULL;
-}
-
-static Node *
-create_node(Node *temp, ib_portid_t *path, int dist)
-{
-	Node *node;
-	int hash = HASHGUID(temp->nodeguid) % HTSZ;
-
-	node = malloc(sizeof(*node));
-	if (!node)
-		return NULL;
-
-	memcpy(node, temp, sizeof(*node));
-	node->dist = dist;
-	node->path = *path;
-
-	node->htnext = nodestbl[hash];
-	nodestbl[hash] = node;
-
-	if (node->type != SWITCH_NODE)
-		dist = MAXHOPS; 	/* special Ca list */
-
-	node->dnext = nodesdist[dist];
-	nodesdist[dist] = node;
-
-	return node;
-}
-
-static Port *
-find_port(Node *node, Port *port)
-{
-	Port *old;
-
-	for (old = node->ports; old; old = old->next)
-		if (old->portnum == port->portnum)
-			return old;
-
-	return NULL;
-}
-
-static Port *
-create_port(Node *node, Port *temp)
+char *dump_linkspeed_compat(uint32_t speed)
 {
-	Port *port;
-
-	port = malloc(sizeof(*port));
-	if (!port)
-		return NULL;
-
-	memcpy(port, temp, sizeof(*port));
-	port->node = node;
-	port->next = node->ports;
-	node->ports = port;
-
-	return port;
+	switch (speed) {
+	case 1:
+		return ("SDR");
+		break;
+	case 2:
+		return ("DDR");
+		break;
+	case 4:
+		return ("QDR");
+		break;
+	}
+	return ("???");
 }
 
-static void
-link_ports(Node *node, Port *port, Node *remotenode, Port *remoteport)
+char *dump_linkspeedext_compat(uint32_t espeed, uint32_t speed, uint32_t fdr10)
 {
-	DEBUG("linking: 0x%" PRIx64 " %p->%p:%u and 0x%" PRIx64 " %p->%p:%u",
-		node->nodeguid, node, port, port->portnum,
-		remotenode->nodeguid, remotenode, remoteport, remoteport->portnum);
-	if (port->remoteport)
-		port->remoteport->remoteport = NULL;
-	if (remoteport->remoteport)
-		remoteport->remoteport->remoteport = NULL;
-	port->remoteport = remoteport;
-	remoteport->remoteport = port;
+	switch (espeed) {
+	case 0:
+		if (fdr10 & FDR10)
+			return ("FDR10");
+		else
+			return dump_linkspeed_compat(speed);
+		break;
+	case 1:
+		return ("FDR");
+		break;
+	case 2:
+		return ("EDR");
+		break;
+	}
+	return ("???");
 }
 
-static int
-handle_port(Node *node, Port *port, ib_portid_t *path, int portnum, int dist)
+char *dump_linkwidth_compat(uint32_t width)
 {
-	Node node_buf;
-	Port port_buf;
-	Node *remotenode, *oldnode;
-	Port *remoteport, *oldport;
-
-	memset(&node_buf, 0, sizeof(node_buf));
-	memset(&port_buf, 0, sizeof(port_buf));
-
-	DEBUG("handle node %p port %p:%d dist %d", node, port, portnum, dist);
-	if (port->physstate != 5)	/* LinkUp */
-		return -1;
-
-	if (extend_dpath(&path->drpath, portnum) < 0)
-		return -1;
-
-	if (get_node(&node_buf, &port_buf, path) < 0) {
-		IBWARN("NodeInfo on %s failed, skipping port",
-			portid2str(path));
-		path->drpath.cnt--;	/* restore path */
-		return -1;
+	switch (width) {
+	case 1:
+		return ("1x");
+		break;
+	case 2:
+		return ("4x");
+		break;
+	case 4:
+		return ("8x");
+		break;
+	case 8:
+		return ("12x");
+		break;
 	}
-
-	oldnode = find_node(&node_buf);
-	if (oldnode)
-		remotenode = oldnode;
-	else if (!(remotenode = create_node(&node_buf, path, dist + 1)))
-		IBERROR("no memory");
-
-	oldport = find_port(remotenode, &port_buf);
-	if (oldport) {
-		remoteport = oldport;
-		if (node != remotenode || port != remoteport)
-			IBWARN("port moving...");
-	} else if (!(remoteport = create_port(remotenode, &port_buf)))
-		IBERROR("no memory");
-
-	dump_endnode(path, oldnode ? "known remote" : "new remote",
-		     remotenode, remoteport);
-
-	link_ports(node, port, remotenode, remoteport);
-
-	path->drpath.cnt--;	/* restore path */
-	return 0;
+	return ("??");
 }
 
-/*
- * Return 1 if found, 0 if not, -1 on errors.
- */
-static int
-discover(ib_portid_t *from)
+static inline const char *ports_nt_str_compat(ibnd_node_t * node)
 {
-	Node node_buf;
-	Port port_buf;
-	Node *node;
-	Port *port;
-	int i;
-	int dist = 0;
-	ib_portid_t *path;
-
-	DEBUG("from %s", portid2str(from));
-
-	memset(&node_buf, 0, sizeof(node_buf));
-	memset(&port_buf, 0, sizeof(port_buf));
-
-	if (get_node(&node_buf, &port_buf, from) < 0) {
-		IBWARN("can't reach node %s", portid2str(from));
-		return -1;
-	}
-
-	node = create_node(&node_buf, from, 0);
-	if (!node)
-		IBERROR("out of memory");
-
-	mynode = node;
-
-	port = create_port(node, &port_buf);
-	if (!port)
-		IBERROR("out of memory");
-
-	if (node->type != SWITCH_NODE &&
-	    handle_port(node, port, from, node->localport, 0) < 0)
-		return 0;
-
-	for (dist = 0; dist < MAXHOPS; dist++) {
-
-		for (node = nodesdist[dist]; node; node = node->dnext) {
-
-			path = &node->path;
-
-			DEBUG("dist %d node %p", dist, node);
-			dump_endnode(path, "processing", node, port);
-
-			for (i = 1; i <= node->numports; i++) {
-				if (i == node->localport)
-					continue;
-
-				if (get_port(&port_buf, i, path) < 0) {
-					IBWARN("can't reach node %s port %d", portid2str(path), i);
-					continue;
-				}
-
-				port = find_port(node, &port_buf);
-				if (port)
-					continue;
-
-				port = create_port(node, &port_buf);
-				if (!port)
-					IBERROR("out of memory");
-
-				/* If switch, set port GUID to node GUID */
-				if (node->type == SWITCH_NODE)
-					port->portguid = node->portguid;
-
-				handle_port(node, port, path, i, dist);
-			}
-		}
+	switch (node->type) {
+	case IB_NODE_SWITCH:
+		return "SW";
+	case IB_NODE_CA:
+		return "CA";
+	case IB_NODE_ROUTER:
+		return "RT";
 	}
-
-	return 0;
+	return "??";
 }
 
-char *
-node_name(Node *node)
+char *node_name(ibnd_node_t * node)
 {
 	static char buf[256];
 
-	switch(node->type) {
-	case SWITCH_NODE:
+	switch (node->type) {
+	case IB_NODE_SWITCH:
 		sprintf(buf, "\"%s", "S");
 		break;
-	case CA_NODE:
+	case IB_NODE_CA:
 		sprintf(buf, "\"%s", "H");
 		break;
-	case ROUTER_NODE:
+	case IB_NODE_ROUTER:
 		sprintf(buf, "\"%s", "R");
 		break;
 	default:
 		sprintf(buf, "\"%s", "?");
 		break;
 	}
-	sprintf(buf+2, "-%016" PRIx64 "\"", node->nodeguid);
+	sprintf(buf + 2, "-%016" PRIx64 "\"", node->guid);
 
 	return buf;
 }
 
-void
-list_node(Node *node)
+void list_node(ibnd_node_t * node, void *user_data)
 {
 	char *node_type;
-	char *nodename = remap_node_name(node_name_map, node->nodeguid,
-					      node->nodedesc);
+	char *nodename = remap_node_name(node_name_map, node->guid,
+					 node->nodedesc);
 
-	switch(node->type) {
-	case SWITCH_NODE:
+	switch (node->type) {
+	case IB_NODE_SWITCH:
 		node_type = "Switch";
 		break;
-	case CA_NODE:
+	case IB_NODE_CA:
 		node_type = "Ca";
 		break;
-	case ROUTER_NODE:
+	case IB_NODE_ROUTER:
 		node_type = "Router";
 		break;
 	default:
 		node_type = "???";
 		break;
 	}
-	fprintf(f, "%s\t : 0x%016" PRIx64 " ports %d devid 0x%x vendid 0x%x \"%s\"\n",
-		node_type,
-		node->nodeguid, node->numports, node->devid, node->vendid,
-		nodename);
+	fprintf(f,
+		"%s\t : 0x%016" PRIx64
+		" ports %d devid 0x%x vendid 0x%x \"%s\"\n", node_type,
+		node->guid, node->numports, mad_get_field(node->info, 0,
+							  IB_NODE_DEVID_F),
+		mad_get_field(node->info, 0, IB_NODE_VENDORID_F), nodename);
 
 	free(nodename);
 }
 
-void
-out_ids(Node *node, int group, char *chname)
+void list_nodes(ibnd_fabric_t * fabric, int list)
 {
-	fprintf(f, "\nvendid=0x%x\ndevid=0x%x\n", node->vendid, node->devid);
-	if (node->sysimgguid)
-		fprintf(f, "sysimgguid=0x%" PRIx64, node->sysimgguid);
-	if (group
-	    && node->chrecord && node->chrecord->chassisnum) {
-		fprintf(f, "\t\t# Chassis %d", node->chrecord->chassisnum);
+	if (list & LIST_CA_NODE)
+		ibnd_iter_nodes_type(fabric, list_node, IB_NODE_CA, NULL);
+	if (list & LIST_SWITCH_NODE)
+		ibnd_iter_nodes_type(fabric, list_node, IB_NODE_SWITCH, NULL);
+	if (list & LIST_ROUTER_NODE)
+		ibnd_iter_nodes_type(fabric, list_node, IB_NODE_ROUTER, NULL);
+}
+
+void out_ids(ibnd_node_t * node, int group, char *chname, char *out_prefix)
+{
+	uint64_t sysimgguid =
+	    mad_get_field64(node->info, 0, IB_NODE_SYSTEM_GUID_F);
+
+	fprintf(f, "\n%svendid=0x%x\n", out_prefix ? out_prefix : "",
+		mad_get_field(node->info, 0, IB_NODE_VENDORID_F));
+	fprintf(f, "%sdevid=0x%x\n", out_prefix ? out_prefix : "",
+		mad_get_field(node->info, 0, IB_NODE_DEVID_F));
+	if (sysimgguid)
+		fprintf(f, "%ssysimgguid=0x%" PRIx64,
+			out_prefix ? out_prefix : "", sysimgguid);
+	if (group && node->chassis && node->chassis->chassisnum) {
+		fprintf(f, "\t\t# Chassis %d", node->chassis->chassisnum);
 		if (chname)
-			fprintf(f, " (%s)", chname);
-		if (is_xsigo_tca(node->nodeguid) && node->ports->remoteport)
-			fprintf(f, " slot %d", node->ports->remoteport->portnum);
+			fprintf(f, " (%s)", clean_nodedesc(chname));
+		if (ibnd_is_xsigo_tca(node->guid) && node->ports[1] &&
+		    node->ports[1]->remoteport)
+			fprintf(f, " slot %d",
+				node->ports[1]->remoteport->portnum);
 	}
-	fprintf(f, "\n");
+	if (sysimgguid ||
+	    (group && node->chassis && node->chassis->chassisnum))
+		fprintf(f, "\n");
 }
 
-uint64_t
-out_chassis(int chassisnum)
+uint64_t out_chassis(ibnd_fabric_t * fabric, unsigned char chassisnum)
 {
 	uint64_t guid;
 
-	fprintf(f, "\nChassis %d", chassisnum);
-	guid = get_chassis_guid(chassisnum);
+	fprintf(f, "\nChassis %u", chassisnum);
+	guid = ibnd_get_chassis_guid(fabric, chassisnum);
 	if (guid)
 		fprintf(f, " (guid 0x%" PRIx64 ")", guid);
 	fprintf(f, "\n");
 	return guid;
 }
 
-void
-out_switch(Node *node, int group, char *chname)
+void out_switch_detail(ibnd_node_t * node, char *sw_prefix)
 {
-	char *str;
 	char *nodename = NULL;
 
-	out_ids(node, group, chname);
-	fprintf(f, "switchguid=0x%" PRIx64, node->nodeguid);
-	fprintf(f, "(%" PRIx64 ")", node->portguid);
-	/* Currently, only if Voltaire chassis */
-	if (group
-	    && node->chrecord && node->chrecord->chassisnum
-	    && node->vendid == VTR_VENDOR_ID) {
-		str = get_chassis_type(node->chrecord->chassistype);
+	nodename = remap_node_name(node_name_map, node->guid, node->nodedesc);
+
+	fprintf(f, "%sSwitch\t%d %s\t\t# \"%s\" %s port 0 lid %d lmc %d",
+		sw_prefix ? sw_prefix : "", node->numports, node_name(node),
+		nodename, node->smaenhsp0 ? "enhanced" : "base",
+		node->smalid, node->smalmc);
+
+	free(nodename);
+}
+
+void out_switch(ibnd_node_t * node, int group, char *chname, char *id_prefix,
+		char *sw_prefix)
+{
+	char *str;
+	char str2[256];
+
+	out_ids(node, group, chname, id_prefix);
+	fprintf(f, "%sswitchguid=0x%" PRIx64,
+		id_prefix ? id_prefix : "", node->guid);
+	fprintf(f, "(%" PRIx64 ")",
+		mad_get_field64(node->info, 0, IB_NODE_PORT_GUID_F));
+	if (group) {
+		fprintf(f, "\t# ");
+		str = ibnd_get_chassis_type(node);
 		if (str)
 			fprintf(f, "%s ", str);
-		str = get_chassis_slot(node->chrecord->chassisslot);
+		str = ibnd_get_chassis_slot_str(node, str2, 256);
 		if (str)
-			fprintf(f, "%s ", str);
-		fprintf(f, "%d Chip %d", node->chrecord->slotnum, node->chrecord->anafanum);
+			fprintf(f, "%s", str);
 	}
+	fprintf(f, "\n");
 
-	nodename = remap_node_name(node_name_map, node->nodeguid,
-				node->nodedesc);
+	out_switch_detail(node, sw_prefix);
+	fprintf(f, "\n");
+}
 
-	fprintf(f, "\nSwitch\t%d %s\t\t# \"%s\" %s port 0 lid %d lmc %d\n",
-		node->numports, node_name(node),
-		nodename,
-		node->smaenhsp0 ? "enhanced" : "base",
-		node->smalid, node->smalmc);
+void out_ca_detail(ibnd_node_t * node, char *ca_prefix)
+{
+	char *node_type;
 
-	free(nodename);
+	switch (node->type) {
+	case IB_NODE_CA:
+		node_type = "Ca";
+		break;
+	case IB_NODE_ROUTER:
+		node_type = "Rt";
+		break;
+	default:
+		node_type = "???";
+		break;
+	}
+
+	fprintf(f, "%s%s\t%d %s\t\t# \"%s\"", ca_prefix ? ca_prefix : "",
+		node_type, node->numports, node_name(node),
+		clean_nodedesc(node->nodedesc));
 }
 
-void
-out_ca(Node *node, int group, char *chname)
+void out_ca(ibnd_node_t * node, int group, char *chname, char *id_prefix,
+	    char *ca_prefix)
 {
 	char *node_type;
-	char *node_type2;
-	char *nodename = remap_node_name(node_name_map, node->nodeguid,
-					      node->nodedesc);
 
-	out_ids(node, group, chname);
-	switch(node->type) {
-	case CA_NODE:
+	out_ids(node, group, chname, id_prefix);
+	switch (node->type) {
+	case IB_NODE_CA:
 		node_type = "ca";
-		node_type2 = "Ca";
 		break;
-	case ROUTER_NODE:
+	case IB_NODE_ROUTER:
 		node_type = "rt";
-		node_type2 = "Rt";
 		break;
 	default:
 		node_type = "???";
-		node_type2 = "???";
 		break;
 	}
 
-	fprintf(f, "%sguid=0x%" PRIx64 "\n", node_type, node->nodeguid);
-	fprintf(f, "%s\t%d %s\t\t# \"%s\"",
-		node_type2, node->numports, node_name(node),
-		nodename);
-	if (group && is_xsigo_hca(node->nodeguid))
+	fprintf(f, "%s%sguid=0x%" PRIx64 "\n",
+		id_prefix ? id_prefix : "", node_type, node->guid);
+	out_ca_detail(node, ca_prefix);
+	if (group && ibnd_is_xsigo_hca(node->guid))
 		fprintf(f, " (scp)");
 	fprintf(f, "\n");
-
-	free(nodename);
 }
 
-static char *
-out_ext_port(Port *port, int group)
+#define OUT_BUFFER_SIZE 16
+static char *out_ext_port(ibnd_port_t * port, int group)
 {
-	char *str = NULL;
+	static char mapping[OUT_BUFFER_SIZE];
 
-	/* Currently, only if Voltaire chassis */
-	if (group
-	    && port->node->chrecord && port->node->vendid == VTR_VENDOR_ID)
-		str = portmapstring(port);
+	if (group && port->ext_portnum != 0) {
+		snprintf(mapping, OUT_BUFFER_SIZE,
+			 "[ext %d]", port->ext_portnum);
+		return (mapping);
+	}
 
-	return (str);
+	return (NULL);
 }
 
-void
-out_switch_port(Port *port, int group)
+void out_switch_port(ibnd_port_t * port, int group, char *out_prefix)
 {
 	char *ext_port_str = NULL;
 	char *rem_nodename = NULL;
-
-	DEBUG("port %p:%d remoteport %p", port, port->portnum, port->remoteport);
-	fprintf(f, "[%d]", port->portnum);
+	uint32_t iwidth = mad_get_field(port->info, 0,
+					IB_PORT_LINK_WIDTH_ACTIVE_F);
+	uint32_t ispeed = mad_get_field(port->info, 0,
+					IB_PORT_LINK_SPEED_ACTIVE_F);
+	uint32_t fdr10 = mad_get_field(port->ext_info, 0,
+				       IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F);
+	uint32_t cap_mask, espeed;
+
+	DEBUG("port %p:%d remoteport %p\n", port, port->portnum,
+	      port->remoteport);
+	fprintf(f, "%s[%d]", out_prefix ? out_prefix : "", port->portnum);
 
 	ext_port_str = out_ext_port(port, group);
 	if (ext_port_str)
 		fprintf(f, "%s", ext_port_str);
 
 	rem_nodename = remap_node_name(node_name_map,
-				port->remoteport->node->nodeguid,
-				port->remoteport->node->nodedesc);
+				       port->remoteport->node->guid,
+				       port->remoteport->node->nodedesc);
 
 	ext_port_str = out_ext_port(port->remoteport, group);
+
+	if (!port->node->ports[0]) {
+		cap_mask = 0;
+		ispeed = 0;
+		espeed = 0;
+	} else {
+		cap_mask = mad_get_field(port->node->ports[0]->info, 0,
+					 IB_PORT_CAPMASK_F);
+		if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+			espeed = mad_get_field(port->info, 0,
+					       IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+		else
+			espeed = 0;
+	}
 	fprintf(f, "\t%s[%d]%s",
-		node_name(port->remoteport->node),
-		port->remoteport->portnum,
+		node_name(port->remoteport->node), port->remoteport->portnum,
 		ext_port_str ? ext_port_str : "");
-	if (port->remoteport->node->type != SWITCH_NODE)
-		fprintf(f, "(%" PRIx64 ") ", port->remoteport->portguid);
+	if (port->remoteport->node->type != IB_NODE_SWITCH)
+		fprintf(f, "(%" PRIx64 ") ", port->remoteport->guid);
 	fprintf(f, "\t\t# \"%s\" lid %d %s%s",
 		rem_nodename,
-		port->remoteport->node->type == SWITCH_NODE ? port->remoteport->node->smalid : port->remoteport->lid,
-		get_linkwidth_str(port->linkwidth),
-		get_linkspeed_str(port->linkspeed));
-
-	if (is_xsigo_tca(port->remoteport->portguid))
+		port->remoteport->node->type == IB_NODE_SWITCH ?
+		port->remoteport->node->smalid :
+		port->remoteport->base_lid,
+		dump_linkwidth_compat(iwidth),
+		(ispeed != 4 && !espeed) ?
+			dump_linkspeed_compat(ispeed) :
+			dump_linkspeedext_compat(espeed, ispeed, fdr10));
+
+	if (full_info)
+		fprintf(f, " s=%d w=%d", ispeed, iwidth);
+
+	if (ibnd_is_xsigo_tca(port->remoteport->guid))
 		fprintf(f, " slot %d", port->portnum);
-	else if (is_xsigo_hca(port->remoteport->portguid))
+	else if (ibnd_is_xsigo_hca(port->remoteport->guid))
 		fprintf(f, " (scp)");
 	fprintf(f, "\n");
 
 	free(rem_nodename);
 }
 
-void
-out_ca_port(Port *port, int group)
+void out_ca_port(ibnd_port_t * port, int group, char *out_prefix)
 {
 	char *str = NULL;
 	char *rem_nodename = NULL;
-
-	fprintf(f, "[%d]", port->portnum);
-	if (port->node->type != SWITCH_NODE)
-		fprintf(f, "(%" PRIx64 ") ", port->portguid);
+	uint32_t iwidth = mad_get_field(port->info, 0,
+					IB_PORT_LINK_WIDTH_ACTIVE_F);
+	uint32_t ispeed = mad_get_field(port->info, 0,
+					IB_PORT_LINK_SPEED_ACTIVE_F);
+	uint32_t fdr10 = mad_get_field(port->ext_info, 0,
+				       IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F);
+	uint32_t cap_mask, espeed;
+
+	fprintf(f, "%s[%d]", out_prefix ? out_prefix : "", port->portnum);
+	if (port->node->type != IB_NODE_SWITCH)
+		fprintf(f, "(%" PRIx64 ") ", port->guid);
 	fprintf(f, "\t%s[%d]",
-		node_name(port->remoteport->node),
-		port->remoteport->portnum);
+		node_name(port->remoteport->node), port->remoteport->portnum);
 	str = out_ext_port(port->remoteport, group);
 	if (str)
 		fprintf(f, "%s", str);
-	if (port->remoteport->node->type != SWITCH_NODE)
-		fprintf(f, " (%" PRIx64 ") ", port->remoteport->portguid);
+	if (port->remoteport->node->type != IB_NODE_SWITCH)
+		fprintf(f, " (%" PRIx64 ") ", port->remoteport->guid);
 
 	rem_nodename = remap_node_name(node_name_map,
-				port->remoteport->node->nodeguid,
-				port->remoteport->node->nodedesc);
+				       port->remoteport->node->guid,
+				       port->remoteport->node->nodedesc);
 
-	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s\n",
-		port->lid, port->lmc, rem_nodename,
-		port->remoteport->node->type == SWITCH_NODE ? port->remoteport->node->smalid : port->remoteport->lid,
-		get_linkwidth_str(port->linkwidth),
-		get_linkspeed_str(port->linkspeed));
+	cap_mask = mad_get_field(port->info, 0, IB_PORT_CAPMASK_F);
+	if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+		espeed = mad_get_field(port->info, 0,
+				       IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+	else
+		espeed = 0;
+
+	fprintf(f, "\t\t# lid %d lmc %d \"%s\" lid %d %s%s",
+		port->base_lid, port->lmc, rem_nodename,
+		port->remoteport->node->type == IB_NODE_SWITCH ?
+		port->remoteport->node->smalid :
+		port->remoteport->base_lid,
+		dump_linkwidth_compat(iwidth),
+		(ispeed != 4 && !espeed) ?
+			dump_linkspeed_compat(ispeed) :
+			dump_linkspeedext_compat(espeed, ispeed, fdr10));
+
+	if (full_info)
+		fprintf(f, " s=%d w=%d", ispeed, iwidth);
+	fprintf(f, "\n");
 
 	free(rem_nodename);
 }
 
-int
-dump_topology(int listtype, int group)
+struct iter_user_data {
+	int group;
+	int skip_chassis_nodes;
+};
+
+static void switch_iter_func(ibnd_node_t * node, void *iter_user_data)
+{
+	ibnd_port_t *port;
+	int p = 0;
+	struct iter_user_data *data = (struct iter_user_data *)iter_user_data;
+
+	DEBUG("SWITCH: node %p\n", node);
+
+	/* skip chassis based switches if flagged */
+	if (data->skip_chassis_nodes && node->chassis
+	    && node->chassis->chassisnum)
+		return;
+
+	out_switch(node, data->group, NULL, NULL, NULL);
+	for (p = 1; p <= node->numports; p++) {
+		port = node->ports[p];
+		if (port && port->remoteport)
+			out_switch_port(port, data->group, NULL);
+	}
+}
+
+static void ca_iter_func(ibnd_node_t * node, void *iter_user_data)
+{
+	ibnd_port_t *port;
+	int p = 0;
+	struct iter_user_data *data = (struct iter_user_data *)iter_user_data;
+
+	DEBUG("CA: node %p\n", node);
+	/* Now, skip chassis based CAs */
+	if (data->group && node->chassis && node->chassis->chassisnum)
+		return;
+	out_ca(node, data->group, NULL, NULL, NULL);
+
+	for (p = 1; p <= node->numports; p++) {
+		port = node->ports[p];
+		if (port && port->remoteport)
+			out_ca_port(port, data->group, NULL);
+	}
+}
+
+static void router_iter_func(ibnd_node_t * node, void *iter_user_data)
+{
+	ibnd_port_t *port;
+	int p = 0;
+	struct iter_user_data *data = (struct iter_user_data *)iter_user_data;
+
+	DEBUG("RT: node %p\n", node);
+	/* Now, skip chassis based RTs */
+	if (data->group && node->chassis && node->chassis->chassisnum)
+		return;
+	out_ca(node, data->group, NULL, NULL, NULL);
+	for (p = 1; p <= node->numports; p++) {
+		port = node->ports[p];
+		if (port && port->remoteport)
+			out_ca_port(port, data->group, NULL);
+	}
+}
+
+int dump_topology(int group, ibnd_fabric_t * fabric)
 {
-	Node *node;
-	Port *port;
-	int i = 0, dist = 0;
+	ibnd_node_t *node;
+	ibnd_port_t *port;
+	int i = 0, p = 0;
 	time_t t = time(0);
 	uint64_t chguid;
 	char *chname = NULL;
-
-	if (!listtype) {
-		fprintf(f, "#\n# Topology file: generated on %s#\n", ctime(&t));
-		fprintf(f, "# Max of %d hops discovered\n", maxhops_discovered);
-		fprintf(f, "# Initiated from node %016" PRIx64 " port %016" PRIx64 "\n", mynode->nodeguid, mynode->portguid);
-	}
+	struct iter_user_data iter_user_data;
+
+	fprintf(f, "#\n# Topology file: generated on %s#\n", ctime(&t));
+	if (report_max_hops)
+		fprintf(f, "# Reported max hops discovered: %u\n"
+			"# Total MADs used: %u\n",
+			fabric->maxhops_discovered, fabric->total_mads_used);
+	fprintf(f, "# Initiated from node %016" PRIx64 " port %016" PRIx64 "\n",
+		fabric->from_node->guid,
+		mad_get_field64(fabric->from_node->info, 0,
+				IB_NODE_PORT_GUID_F));
 
 	/* Make pass on switches */
-	if (group && !listtype) {
-		ChassisList *ch = NULL;
+	if (group) {
+		ibnd_chassis_t *ch = NULL;
 
 		/* Chassis based switches first */
-		for (ch = chassis; ch; ch = ch->next) {
+		for (ch = fabric->chassis; ch; ch = ch->next) {
 			int n = 0;
 
 			if (!ch->chassisnum)
 				continue;
-			chguid = out_chassis(ch->chassisnum);
-			if (chname)
-				free(chname);
+			chguid = out_chassis(fabric, ch->chassisnum);
 			chname = NULL;
-			if (is_xsigo_guid(chguid)) {
-				for (node = nodesdist[MAXHOPS]; node; node = node->dnext) {
-					if (!node->chrecord ||
-					    !node->chrecord->chassisnum)
-						continue;
-
-					if (node->chrecord->chassisnum != ch->chassisnum)
-						continue;
-
-					if (is_xsigo_hca(node->nodeguid)) {
-						chname = remap_node_name(node_name_map,
-								node->nodeguid,
-								node->nodedesc);
-						fprintf(f, "Hostname: %s\n", chname);
+			if (ibnd_is_xsigo_guid(chguid)) {
+				for (node = ch->nodes; node;
+				     node = node->next_chassis_node) {
+					if (ibnd_is_xsigo_hca(node->guid)) {
+						chname = node->nodedesc;
+						fprintf(f, "Hostname: %s\n",
+							clean_nodedesc
+							(node->nodedesc));
 					}
 				}
 			}
 
 			fprintf(f, "\n# Spine Nodes");
-			for (n = 1; n <= (SPINES_MAX_NUM+1); n++) {
+			for (n = 1; n <= SPINES_MAX_NUM; n++) {
 				if (ch->spinenode[n]) {
-					out_switch(ch->spinenode[n], group, chname);
-					for (port = ch->spinenode[n]->ports; port; port = port->next, i++)
-						if (port->remoteport)
-							out_switch_port(port, group);
+					out_switch(ch->spinenode[n], group,
+						   chname, NULL, NULL);
+					for (p = 1;
+					     p <= ch->spinenode[n]->numports;
+					     p++) {
+						port =
+						    ch->spinenode[n]->ports[p];
+						if (port && port->remoteport)
+							out_switch_port(port,
+									group,
+									NULL);
+					}
 				}
 			}
 			fprintf(f, "\n# Line Nodes");
-			for (n = 1; n <= (LINES_MAX_NUM+1); n++) {
+			for (n = 1; n <= LINES_MAX_NUM; n++) {
 				if (ch->linenode[n]) {
-					out_switch(ch->linenode[n], group, chname);
-					for (port = ch->linenode[n]->ports; port; port = port->next, i++)
-						if (port->remoteport)
-							out_switch_port(port, group);
+					out_switch(ch->linenode[n], group,
+						   chname, NULL, NULL);
+					for (p = 1;
+					     p <= ch->linenode[n]->numports;
+					     p++) {
+						port =
+						    ch->linenode[n]->ports[p];
+						if (port && port->remoteport)
+							out_switch_port(port,
+									group,
+									NULL);
+					}
 				}
 			}
 
 			fprintf(f, "\n# Chassis Switches");
-			for (dist = 0; dist <= maxhops_discovered; dist++) {
-
-				for (node = nodesdist[dist]; node; node = node->dnext) {
-
-					/* Non Voltaire chassis */
-					if (node->vendid == VTR_VENDOR_ID)
-						continue;
-					if (!node->chrecord ||
-					    !node->chrecord->chassisnum)
-						continue;
-
-					if (node->chrecord->chassisnum != ch->chassisnum)
-						continue;
-
-					out_switch(node, group, chname);
-					for (port = node->ports; port; port = port->next, i++)
-						if (port->remoteport)
-							out_switch_port(port, group);
-
+			for (node = ch->nodes; node;
+			     node = node->next_chassis_node) {
+				if (node->type == IB_NODE_SWITCH) {
+					out_switch(node, group, chname, NULL,
+						   NULL);
+					for (p = 1; p <= node->numports; p++) {
+						port = node->ports[p];
+						if (port && port->remoteport)
+							out_switch_port(port,
+									group,
+									NULL);
+					}
 				}
 
 			}
 
 			fprintf(f, "\n# Chassis CAs");
-			for (node = nodesdist[MAXHOPS]; node; node = node->dnext) {
-				if (!node->chrecord ||
-				    !node->chrecord->chassisnum)
-					continue;
+			for (node = ch->nodes; node;
+			     node = node->next_chassis_node) {
+				if (node->type == IB_NODE_CA) {
+					out_ca(node, group, chname, NULL, NULL);
+					for (p = 1; p <= node->numports; p++) {
+						port = node->ports[p];
+						if (port && port->remoteport)
+							out_ca_port(port, group,
+								    NULL);
+					}
+				}
+			}
 
-				if (node->chrecord->chassisnum != ch->chassisnum)
-					continue;
+		}
 
-				out_ca(node, group, chname);
-				for (port = node->ports; port; port = port->next, i++)
-					if (port->remoteport)
-						out_ca_port(port, group);
+	} else {		/* !group */
+		iter_user_data.group = group;
+		iter_user_data.skip_chassis_nodes = 0;
+		ibnd_iter_nodes_type(fabric, switch_iter_func, IB_NODE_SWITCH,
+				     &iter_user_data);
+	}
 
-			}
+	chname = NULL;
+	if (group) {
+		iter_user_data.group = group;
+		iter_user_data.skip_chassis_nodes = 1;
 
-		}
+		fprintf(f, "\nNon-Chassis Nodes\n");
 
-	} else {
-		for (dist = 0; dist <= maxhops_discovered; dist++) {
+		ibnd_iter_nodes_type(fabric, switch_iter_func, IB_NODE_SWITCH,
+				     &iter_user_data);
+	}
 
-			for (node = nodesdist[dist]; node; node = node->dnext) {
+	iter_user_data.group = group;
+	iter_user_data.skip_chassis_nodes = 0;
+	/* Make pass on CAs */
+	ibnd_iter_nodes_type(fabric, ca_iter_func, IB_NODE_CA, &iter_user_data);
 
-				DEBUG("SWITCH: dist %d node %p", dist, node);
-				if (!listtype)
-					out_switch(node, group, chname);
-				else {
-					if (listtype & LIST_SWITCH_NODE)
-						list_node(node);
-					continue;
-				}
+	/* Make pass on routers */
+	ibnd_iter_nodes_type(fabric, router_iter_func, IB_NODE_ROUTER,
+			     &iter_user_data);
 
-				for (port = node->ports; port; port = port->next, i++)
-					if (port->remoteport)
-						out_switch_port(port, group);
-			}
+	return i;
+}
+
+void dump_ports_report(ibnd_node_t * node, void *user_data)
+{
+	int p = 0;
+	ibnd_port_t *port = NULL;
+	char *nodename = NULL;
+	char *rem_nodename = NULL;
+
+	/* for each port */
+	for (p = node->numports, port = node->ports[p]; p > 0;
+	     port = node->ports[--p]) {
+		uint32_t iwidth, ispeed, fdr10, espeed, cap_mask;
+		uint8_t *info = NULL;
+		if (port == NULL)
+			continue;
+		iwidth =
+		    mad_get_field(port->info, 0, IB_PORT_LINK_WIDTH_ACTIVE_F);
+		ispeed =
+		    mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
+		if (port->node->type == IB_NODE_SWITCH) {
+			if (port->node->ports[0])
+				info = (uint8_t *)&port->node->ports[0]->info;
 		}
+		else
+			info = (uint8_t *)&port->info;
+		if (info) {
+			cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+			if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+				espeed = mad_get_field(port->info, 0,
+						       IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+			else
+				espeed = 0;
+		} else {
+			ispeed = 0;
+			iwidth = 0;
+			espeed = 0;
+		}
+		fdr10 = mad_get_field(port->ext_info, 0,
+				      IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F);
+		nodename = remap_node_name(node_name_map,
+					   port->node->guid,
+					   port->node->nodedesc);
+		fprintf(stdout, "%2s %5d %2d 0x%016" PRIx64 " %s %s",
+			ports_nt_str_compat(node),
+			node->type ==
+			IB_NODE_SWITCH ? node->smalid : port->base_lid,
+			port->portnum, port->guid,
+			dump_linkwidth_compat(iwidth),
+			(ispeed != 4 && !espeed) ?
+				dump_linkspeed_compat(ispeed) :
+				dump_linkspeedext_compat(espeed, ispeed, fdr10));
+		if (port->remoteport) {
+			rem_nodename = remap_node_name(node_name_map,
+					      port->remoteport->node->guid,
+					      port->remoteport->node->nodedesc);
+			fprintf(stdout,
+				" - %2s %5d %2d 0x%016" PRIx64
+				" ( '%s' - '%s' )\n",
+				ports_nt_str_compat(port->remoteport->node),
+				port->remoteport->node->type == IB_NODE_SWITCH ?
+				port->remoteport->node->smalid :
+				port->remoteport->base_lid,
+				port->remoteport->portnum,
+				port->remoteport->guid, nodename, rem_nodename);
+			free(rem_nodename);
+		} else
+			fprintf(stdout, "%36s'%s'\n", "", nodename);
+
+		free(nodename);
 	}
+}
 
-	if (chname)
-		free(chname);
-	chname = NULL;
-	if (group && !listtype) {
+struct iter_diff_data {
+	uint32_t diff_flags;
+	ibnd_fabric_t *fabric1;
+	ibnd_fabric_t *fabric2;
+	char *fabric1_prefix;
+	char *fabric2_prefix;
+	void (*out_header) (ibnd_node_t *, int, char *, char *, char *);
+	void (*out_header_detail) (ibnd_node_t *, char *);
+	void (*out_port) (ibnd_port_t *, int, char *);
+};
 
-		fprintf(f, "\nNon-Chassis Nodes\n");
+static void diff_iter_out_header(ibnd_node_t * node,
+				 struct iter_diff_data *data,
+				 int *out_header_flag)
+{
+	if (!(*out_header_flag)) {
+		(*data->out_header) (node, 0, NULL, NULL, NULL);
+		(*out_header_flag)++;
+	}
+}
 
-		for (dist = 0; dist <= maxhops_discovered; dist++) {
+static void diff_ports(ibnd_node_t * fabric1_node, ibnd_node_t * fabric2_node,
+		       int *out_header_flag, struct iter_diff_data *data)
+{
+	ibnd_port_t *fabric1_port;
+	ibnd_port_t *fabric2_port;
+	int p;
+
+	for (p = 1; p <= fabric1_node->numports; p++) {
+		int fabric1_out = 0, fabric2_out = 0;
+
+		fabric1_port = fabric1_node->ports[p];
+		fabric2_port = fabric2_node->ports[p];
+
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION) {
+			if ((fabric1_port && !fabric2_port)
+			    || ((fabric1_port && fabric2_port)
+				&& (fabric1_port->remoteport
+				    && !fabric2_port->remoteport)))
+				fabric1_out++;
+			else if ((!fabric1_port && fabric2_port)
+				 || ((fabric1_port && fabric2_port)
+				     && (!fabric1_port->remoteport
+					 && fabric2_port->remoteport)))
+				fabric2_out++;
+			else if ((fabric1_port && fabric2_port)
+				 && ((fabric1_port->guid != fabric2_port->guid)
+				     ||
+				     ((fabric1_port->remoteport
+				       && fabric2_port->remoteport)
+				      && (fabric1_port->remoteport->guid !=
+					  fabric2_port->remoteport->guid)))) {
+				fabric1_out++;
+				fabric2_out++;
+			}
+		}
 
-			for (node = nodesdist[dist]; node; node = node->dnext) {
+		if ((data->diff_flags & DIFF_FLAG_LID)
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->base_lid != fabric2_port->base_lid) {
+			fabric1_out++;
+			fabric2_out++;
+		}
 
-				DEBUG("SWITCH: dist %d node %p", dist, node);
-				/* Now, skip chassis based switches */
-				if (node->chrecord &&
-				    node->chrecord->chassisnum)
-					continue;
-				out_switch(node, group, chname);
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && memcmp(fabric1_port->remoteport->node->nodedesc,
+			      fabric2_port->remoteport->node->nodedesc,
+			      IB_SMP_DATA_SIZE)) {
+			fabric1_out++;
+			fabric2_out++;
+		}
 
-				for (port = node->ports; port; port = port->next, i++)
-					if (port->remoteport)
-						out_switch_port(port, group);
-			}
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && memcmp(fabric1_port->remoteport->node->nodedesc,
+			      fabric2_port->remoteport->node->nodedesc,
+			      IB_SMP_DATA_SIZE)) {
+			fabric1_out++;
+			fabric2_out++;
+		}
 
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_LID
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && fabric1_port->remoteport->base_lid != fabric2_port->remoteport->base_lid) {
+			fabric1_out++;
+			fabric2_out++;
 		}
 
+		if (fabric1_out) {
+			diff_iter_out_header(fabric1_node, data,
+					     out_header_flag);
+			(*data->out_port) (fabric1_port, 0,
+					   data->fabric1_prefix);
+		}
+		if (fabric2_out) {
+			diff_iter_out_header(fabric1_node, data,
+					     out_header_flag);
+			(*data->out_port) (fabric2_port, 0,
+					   data->fabric2_prefix);
+		}
 	}
+}
 
-	/* Make pass on CAs */
-	for (node = nodesdist[MAXHOPS]; node; node = node->dnext) {
+static void diff_iter_func(ibnd_node_t * fabric1_node, void *iter_user_data)
+{
+	struct iter_diff_data *data = iter_user_data;
+	ibnd_node_t *fabric2_node;
+	ibnd_port_t *fabric1_port;
+	int p;
+
+	DEBUG("DEBUG: fabric1_node %p\n", fabric1_node);
+
+	fabric2_node = ibnd_find_node_guid(data->fabric2, fabric1_node->guid);
+	if (!fabric2_node) {
+		(*data->out_header) (fabric1_node, 0, NULL,
+				     data->fabric1_prefix,
+				     data->fabric1_prefix);
+		for (p = 1; p <= fabric1_node->numports; p++) {
+			fabric1_port = fabric1_node->ports[p];
+			if (fabric1_port && fabric1_port->remoteport)
+				(*data->out_port) (fabric1_port, 0,
+						   data->fabric1_prefix);
+		}
+	} else if (data->diff_flags &
+		   (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_LID
+		    | DIFF_FLAG_NODE_DESCRIPTION)) {
+		int out_header_flag = 0;
+
+		if ((data->diff_flags & DIFF_FLAG_LID
+		     && fabric1_node->smalid != fabric2_node->smalid) ||
+		    (data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		     && memcmp(fabric1_node->nodedesc, fabric2_node->nodedesc,
+			       IB_SMP_DATA_SIZE))) {
+			(*data->out_header) (fabric1_node, 0, NULL, NULL,
+					     data->fabric1_prefix);
+			(*data->out_header_detail) (fabric2_node,
+						    data->fabric2_prefix);
+			fprintf(f, "\n");
+			out_header_flag++;
+		}
 
-		DEBUG("CA: dist %d node %p", dist, node);
-		if (!listtype) {
-			/* Now, skip chassis based CAs */
-			if (group && node->chrecord &&
-			    node->chrecord->chassisnum)
-				continue;
-			out_ca(node, group, chname);
-		} else {
-			if (((listtype & LIST_CA_NODE) && (node->type == CA_NODE)) ||
-			    ((listtype & LIST_ROUTER_NODE) && (node->type == ROUTER_NODE)))
-				list_node(node);
-			continue;
+		if (fabric1_node->numports != fabric2_node->numports) {
+			diff_iter_out_header(fabric1_node, data,
+					     &out_header_flag);
+			fprintf(f, "%snumports = %d\n", data->fabric1_prefix,
+				fabric1_node->numports);
+			fprintf(f, "%snumports = %d\n", data->fabric2_prefix,
+				fabric2_node->numports);
+			return;
 		}
 
-		for (port = node->ports; port; port = port->next, i++)
-			if (port->remoteport)
-				out_ca_port(port, group);
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    || data->diff_flags & DIFF_FLAG_LID)
+			diff_ports(fabric1_node, fabric2_node, &out_header_flag,
+				   data);
 	}
+}
 
-	if (chname)
-		free(chname);
+static int diff_common(ibnd_fabric_t * orig_fabric, ibnd_fabric_t * new_fabric,
+		       int node_type, uint32_t diff_flags,
+		       void (*out_header) (ibnd_node_t *, int, char *, char *,
+					   char *),
+		       void (*out_header_detail) (ibnd_node_t *, char *),
+		       void (*out_port) (ibnd_port_t *, int, char *))
+{
+	struct iter_diff_data iter_diff_data;
+
+	iter_diff_data.diff_flags = diff_flags;
+	iter_diff_data.fabric1 = orig_fabric;
+	iter_diff_data.fabric2 = new_fabric;
+	iter_diff_data.fabric1_prefix = "< ";
+	iter_diff_data.fabric2_prefix = "> ";
+	iter_diff_data.out_header = out_header;
+	iter_diff_data.out_header_detail = out_header_detail;
+	iter_diff_data.out_port = out_port;
+	ibnd_iter_nodes_type(orig_fabric, diff_iter_func, node_type,
+			     &iter_diff_data);
+
+	/* Do opposite diff to find existence of node types
+	 * in new_fabric but not in orig_fabric.
+	 *
+	 * In this diff, we don't need to check port connections,
+	 * lids, or node descriptions since it has already been
+	 * done (i.e. checks are only done when guid exists on both
+	 * orig and new).
+	 */
+	iter_diff_data.diff_flags = diff_flags & ~DIFF_FLAG_PORT_CONNECTION;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_LID;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_NODE_DESCRIPTION;
+	iter_diff_data.fabric1 = new_fabric;
+	iter_diff_data.fabric2 = orig_fabric;
+	iter_diff_data.fabric1_prefix = "> ";
+	iter_diff_data.fabric2_prefix = "< ";
+	iter_diff_data.out_header = out_header;
+	iter_diff_data.out_header_detail = out_header_detail;
+	iter_diff_data.out_port = out_port;
+	ibnd_iter_nodes_type(new_fabric, diff_iter_func, node_type,
+			     &iter_diff_data);
 
-	return i;
+	return 0;
 }
 
-void dump_ports_report ()
+int diff(ibnd_fabric_t * orig_fabric, ibnd_fabric_t * new_fabric)
 {
-	int b, n = 0, p;
-	Node *node;
-	Port *port;
-
-	// If switch and LID == 0, search of other switch ports with
-	// valid LID and assign it to all ports of that switch
-	for (b = 0; b <= MAXHOPS; b++)
-		for (node = nodesdist[b]; node; node = node->dnext)
-			if (node->type == SWITCH_NODE) {
-				int swlid = 0;
-				for (p = 0, port = node->ports;
-				     p < node->numports && port && !swlid;
-				     port = port->next)
-					if (port->lid != 0)
-						swlid = port->lid;
-				for (p = 0, port = node->ports;
-				     p < node->numports && port;
-				     port = port->next)
-					port->lid = swlid;
-			}
+	if (diffcheck_flags & DIFF_FLAG_SWITCH)
+		diff_common(orig_fabric, new_fabric, IB_NODE_SWITCH,
+			    diffcheck_flags, out_switch, out_switch_detail,
+			    out_switch_port);
 
-	for (b = 0; b <= MAXHOPS; b++)
-		for (node = nodesdist[b]; node; node = node->dnext) {
-			for (p = 0, port = node->ports;
-			     p < node->numports && port;
-			     p++, port = port->next) {
-				fprintf(stdout,
-					"%2s %5d %2d 0x%016" PRIx64 " %s %s",
-					node_type_str2(port->node), port->lid,
-					port->portnum,
-					port->portguid,
-					get_linkwidth_str(port->linkwidth),
-					get_linkspeed_str(port->linkspeed));
-				if (port->remoteport)
-					fprintf(stdout,
-						" - %2s %5d %2d 0x%016" PRIx64
-						" ( '%s' - '%s' )\n",
-						node_type_str2(port->remoteport->node),
-						port->remoteport->lid,
-						port->remoteport->portnum,
-						port->remoteport->portguid,
-						port->node->nodedesc,
-						port->remoteport->node->nodedesc);
-				else
-					fprintf(stdout, "%36s'%s'\n", "",
-						port->node->nodedesc);
-			}
-			n++;
-		}
+	if (diffcheck_flags & DIFF_FLAG_CA)
+		diff_common(orig_fabric, new_fabric, IB_NODE_CA,
+			    diffcheck_flags, out_ca, out_ca_detail,
+			    out_ca_port);
+
+	if (diffcheck_flags & DIFF_FLAG_ROUTER)
+		diff_common(orig_fabric, new_fabric, IB_NODE_ROUTER,
+			    diffcheck_flags, out_ca, out_ca_detail,
+			    out_ca_port);
+
+	return 0;
 }
 
-void
-usage(void)
+static int list, group, ports_report;
+
+static int process_opt(void *context, int ch, char *optarg)
 {
-	fprintf(stderr, "Usage: %s [-d(ebug)] -e(rr_show) -v(erbose) -s(how) -l(ist) -g(rouping) -H(ca_list) -S(witch_list) -R(outer_list) -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms --node-name-map node-name-map] -p(orts) [<topology-file>]\n",
-			argv0);
-	fprintf(stderr, "       --node-name-map <node-name-map> specify a node name map file\n");
-	exit(-1);
+	struct ibnd_config *cfg = context;
+	char *p;
+
+	switch (ch) {
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
+	case 2:
+		cache_file = strdup(optarg);
+		break;
+	case 3:
+		load_cache_file = strdup(optarg);
+		break;
+	case 4:
+		diff_cache_file = strdup(optarg);
+		break;
+	case 5:
+		diffcheck_flags = 0;
+		p = strtok(optarg, ",");
+		while (p) {
+			if (!strcasecmp(p, "sw"))
+				diffcheck_flags |= DIFF_FLAG_SWITCH;
+			else if (!strcasecmp(p, "ca"))
+				diffcheck_flags |= DIFF_FLAG_CA;
+			else if (!strcasecmp(p, "router"))
+				diffcheck_flags |= DIFF_FLAG_ROUTER;
+			else if (!strcasecmp(p, "port"))
+				diffcheck_flags |= DIFF_FLAG_PORT_CONNECTION;
+			else if (!strcasecmp(p, "lid"))
+				diffcheck_flags |= DIFF_FLAG_LID;
+			else if (!strcasecmp(p, "nodedesc"))
+				diffcheck_flags |= DIFF_FLAG_NODE_DESCRIPTION;
+			else {
+				fprintf(stderr, "invalid diff check key: %s\n",
+					p);
+				return -1;
+			}
+			p = strtok(NULL, ",");
+		}
+		break;
+	case 's':
+		cfg->show_progress = 1;
+		break;
+	case 'f':
+		full_info = 1;
+		break;
+	case 'l':
+		list = LIST_CA_NODE | LIST_SWITCH_NODE | LIST_ROUTER_NODE;
+		break;
+	case 'g':
+		group = 1;
+		break;
+	case 'S':
+		list = LIST_SWITCH_NODE;
+		break;
+	case 'H':
+		list = LIST_CA_NODE;
+		break;
+	case 'R':
+		list = LIST_ROUTER_NODE;
+		break;
+	case 'p':
+		ports_report = 1;
+		break;
+	case 'm':
+		report_max_hops = 1;
+		break;
+	case 'o':
+		cfg->max_smps = strtoul(optarg, NULL, 0);
+		break;
+	default:
+		return -1;
+	}
+
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[2] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS};
-	ib_portid_t my_portid = {0};
-	int udebug = 0, list = 0;
-	char *ca = 0;
-	int ca_port = 0;
-	int group = 0;
-	int ports_report = 0;
-
-	static char const str_opts[] = "C:P:t:devslgHSRpVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "err_show", 0, 0, 'e'},
-		{ "verbose", 0, 0, 'v'},
-		{ "show", 0, 0, 's'},
-		{ "list", 0, 0, 'l'},
-		{ "grouping", 0, 0, 'g'},
-		{ "Hca_list", 0, 0, 'H'},
-		{ "Switch_list", 0, 0, 'S'},
-		{ "Router_list", 0, 0, 'R'},
-		{ "timeout", 1, 0, 't'},
-		{ "node-name-map", 1, 0, 1},
-		{ "ports", 0, 0, 'p'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+	struct ibnd_config config = { 0 };
+	ibnd_fabric_t *fabric = NULL;
+	ibnd_fabric_t *diff_fabric = NULL;
+
+	const struct ibdiag_opt opts[] = {
+		{"full", 'f', 0, NULL, "show full information (ports' speed and width)"},
+		{"show", 's', 0, NULL, "show more information"},
+		{"list", 'l', 0, NULL, "list of connected nodes"},
+		{"grouping", 'g', 0, NULL, "show grouping"},
+		{"Hca_list", 'H', 0, NULL, "list of connected CAs"},
+		{"Switch_list", 'S', 0, NULL, "list of connected switches"},
+		{"Router_list", 'R', 0, NULL, "list of connected routers"},
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
+		{"cache", 2, 1, "<file>",
+		 "filename to cache ibnetdiscover data to"},
+		{"load-cache", 3, 1, "<file>",
+		 "filename of ibnetdiscover cache to load"},
+		{"diff", 4, 1, "<file>",
+		 "filename of ibnetdiscover cache to diff"},
+		{"diffcheck", 5, 1, "<key(s)>",
+		 "specify checks to execute for --diff"},
+		{"ports", 'p', 0, NULL, "obtain a ports report"},
+		{"max_hops", 'm', 0, NULL,
+		 "report max hops discovered by the library"},
+		{"outstanding_smps", 'o', 1, NULL,
+		 "specify the number of outstanding SMP's which should be "
+		 "issued during the scan"},
+		{0}
 	};
+	char usage_args[] = "[topology-file]";
+
+	ibdiag_process_opts(argc, argv, &config, "DGKLs", opts, process_opt,
+			    usage_args, NULL);
 
 	f = stdout;
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 1:
-			node_name_map_file = strdup(optarg);
-			break;
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			break;
-		case 'v':
-			verbose++;
-			dumplevel++;
-			break;
-		case 's':
-			dumplevel = 1;
-			break;
-		case 'e':
-			madrpc_show_errors(1);
-			break;
-		case 'l':
-			list = LIST_CA_NODE | LIST_SWITCH_NODE | LIST_ROUTER_NODE;
-			break;
-		case 'g':
-			group = 1;
-			break;
-		case 'S':
-			list = LIST_SWITCH_NODE;
-			break;
-		case 'H':
-			list = LIST_CA_NODE;
-			break;
-		case 'R':
-			list = LIST_ROUTER_NODE;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		case 'p':
-			ports_report = 1;
-			break;
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
+	if (ibd_timeout)
+		config.timeout_ms = ibd_timeout;
+
+	config.flags = ibd_ibnetdisc_flags;
+
 	if (argc && !(f = fopen(argv[0], "w")))
 		IBERROR("can't open file %s for writing", argv[0]);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 2);
+	config.mkey = ibd_mkey;
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
-	if (discover(&my_portid) < 0)
-		IBERROR("discover");
+	if (diff_cache_file &&
+	    !(diff_fabric = ibnd_load_fabric(diff_cache_file, 0)))
+		IBERROR("loading cached fabric for diff failed\n");
 
-	if (group)
-		chassis = group_nodes();
+	if (load_cache_file) {
+		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL)
+			IBERROR("loading cached fabric failed\n");
+	} else {
+		if ((fabric =
+		     ibnd_discover_fabric(ibd_ca, ibd_ca_port, NULL, &config)) == NULL)
+			IBERROR("discover failed\n");
+	}
 
 	if (ports_report)
-		dump_ports_report();
+		ibnd_iter_nodes(fabric, dump_ports_report, NULL);
+	else if (list)
+		list_nodes(fabric, list);
+	else if (diff_fabric)
+		diff(diff_fabric, fabric);
 	else
-		dump_topology(list, group);
+		dump_topology(group, fabric);
+
+	if (cache_file)
+		if (ibnd_cache_fabric(fabric, cache_file, 0) < 0)
+			IBERROR("caching ibnetdiscover data failed\n");
 
+	ibnd_destroy_fabric(fabric);
+	if (diff_fabric)
+		ibnd_destroy_fabric(diff_fabric);
 	close_node_name_map(node_name_map);
 	exit(0);
 }
diff --git a/src/ibping.c b/src/ibping.c
index ceb6dd4..beea26d 100644
--- a/src/ibping.c
+++ b/src/ibping.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,35 +33,27 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
-#include <time.h>
 #include <string.h>
 #include <signal.h>
 #include <getopt.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
+#include <complib/cl_timer.h>
 
 #include "ibdiag_common.h"
 
-#undef DEBUG
-#define	DEBUG	if (verbose) IBWARN
+struct ibmad_port *srcport;
 
-static int dest_type = IB_DEST_LID;
-static int verbose;
 static char host_and_domain[IB_VENDOR_RANGE2_DATA_SIZE];
 static char last_host[IB_VENDOR_RANGE2_DATA_SIZE];
 
-char *argv0 = "ibping";
-
-static void
-get_host_and_domain(char *data, int sz)
+static void get_host_and_domain(char *data, int sz)
 {
 	char *s = data;
 	int n;
@@ -69,7 +61,7 @@ get_host_and_domain(char *data, int sz)
 	if (gethostname(s, sz) < 0)
 		snprintf(s, sz, "?hostname?");
 
-	s[sz-1] = 0;
+	s[sz - 1] = 0;
 	if ((n = strlen(s)) >= sz)
 		return;
 	s[n] = '.';
@@ -82,8 +74,7 @@ get_host_and_domain(char *data, int sz)
 		s[-1] = 0;	/* no domain */
 }
 
-static char *
-ibping_serv(void)
+static char *ibping_serv(void)
 {
 	void *umad;
 	void *mad;
@@ -91,18 +82,20 @@ ibping_serv(void)
 
 	DEBUG("starting to serve...");
 
-	while ((umad = mad_receive(0, -1))) {
+	while ((umad = mad_receive_via(0, -1, srcport))) {
 
-		mad = umad_get_mad(umad);
-		data = (char *)mad + IB_VENDOR_RANGE2_DATA_OFFS;
+		if (umad_status(umad) == 0) {
+			mad = umad_get_mad(umad);
+			data = (char *)mad + IB_VENDOR_RANGE2_DATA_OFFS;
 
-		memcpy(data, host_and_domain, IB_VENDOR_RANGE2_DATA_SIZE);
+			memcpy(data, host_and_domain, IB_VENDOR_RANGE2_DATA_SIZE);
 
-		DEBUG("Pong: %s", data);
+			DEBUG("Pong: %s", data);
 
-		if (mad_respond(umad, 0, 0) < 0)
-			DEBUG("respond failed");
+			if (mad_respond_via(umad, 0, 0, srcport) < 0)
+				DEBUG("respond failed");
 
+		}
 		mad_free(umad);
 	}
 
@@ -110,16 +103,15 @@ ibping_serv(void)
 	return 0;
 }
 
-static uint64_t
-ibping(ib_portid_t *portid, int quiet)
+static uint64_t ibping(ib_portid_t * portid, int quiet)
 {
-	char data[IB_VENDOR_RANGE2_DATA_SIZE] = {0};
+	char data[IB_VENDOR_RANGE2_DATA_SIZE] = { 0 };
 	ib_vendor_call_t call;
 	uint64_t start, rtt;
 
 	DEBUG("Ping..");
 
-	start = getcurrenttime();
+	start = cl_get_time_stamp();
 
 	call.method = IB_MAD_METHOD_GET;
 	call.mgmt_class = IB_VENDOR_OPENIB_PING_CLASS;
@@ -129,165 +121,104 @@ ibping(ib_portid_t *portid, int quiet)
 	call.timeout = 0;
 	memset(&call.rmpp, 0, sizeof call.rmpp);
 
-	if (!ib_vendor_call(data, portid, &call))
-		return ~0llu;
+	if (!ib_vendor_call_via(data, portid, &call, srcport))
+		return ~0ull;
 
-	rtt = getcurrenttime() - start;
+	rtt = cl_get_time_stamp() - start;
 
 	if (!last_host[0])
 		memcpy(last_host, data, sizeof last_host);
 
 	if (!quiet)
 		printf("Pong from %s (%s): time %" PRIu64 ".%03" PRIu64 " ms\n",
-			data, portid2str(portid), rtt/1000, rtt%1000);
+		       data, portid2str(portid), rtt / 1000, rtt % 1000);
 
 	return rtt;
 }
 
-static void
-usage(void)
-{
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -e(rr_show) -v(erbose) -G(uid) -s smlid -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms -c ping_count -f(lood) -o oui -S(erver)] <dest lid|guid>\n",
-			basename);
-	exit(-1);
-}
-
 static uint64_t minrtt = ~0ull, maxrtt, total_rtt;
 static uint64_t start, total_time, replied, lost, ntrans;
-static ib_portid_t portid = {0};
+static ib_portid_t portid = { 0 };
 
-void
-report(int sig)
+void report(int sig)
 {
-	total_time = getcurrenttime() - start;
+	total_time = cl_get_time_stamp() - start;
 
 	DEBUG("out due signal %d", sig);
 
-	printf("\n--- %s (%s) ibping statistics ---\n", last_host, portid2str(&portid));
-	printf("%" PRIu64 " packets transmitted, %" PRIu64 " received, %" PRIu64 "%% packet loss, time %" PRIu64 " ms\n",
-		ntrans, replied,
-		(lost != 0) ?  lost * 100 / ntrans : 0, total_time / 1000);
-	printf("rtt min/avg/max = %" PRIu64 ".%03" PRIu64 "/%" PRIu64 ".%03" PRIu64 "/%" PRIu64 ".%03" PRIu64 " ms\n",
-		minrtt == ~0ull ? 0 : minrtt/1000,
-		minrtt == ~0ull ? 0 : minrtt%1000,
-		replied ? total_rtt/replied/1000 : 0,
-		replied ? (total_rtt/replied)%1000 : 0,
-		maxrtt/1000, maxrtt%1000);
+	printf("\n--- %s (%s) ibping statistics ---\n", last_host,
+	       portid2str(&portid));
+	printf("%" PRIu64 " packets transmitted, %" PRIu64 " received, %" PRIu64
+	       "%% packet loss, time %" PRIu64 " ms\n", ntrans, replied,
+	       (lost != 0) ? lost * 100 / ntrans : 0, total_time / 1000);
+	printf("rtt min/avg/max = %" PRIu64 ".%03" PRIu64 "/%" PRIu64 ".%03"
+	       PRIu64 "/%" PRIu64 ".%03" PRIu64 " ms\n",
+	       minrtt == ~0ull ? 0 : minrtt / 1000,
+	       minrtt == ~0ull ? 0 : minrtt % 1000,
+	       replied ? total_rtt / replied / 1000 : 0,
+	       replied ? (total_rtt / replied) % 1000 : 0, maxrtt / 1000,
+	       maxrtt % 1000);
 
 	exit(0);
 }
 
-int
-main(int argc, char **argv)
+static int server = 0, flood = 0, oui = IB_OPENIB_OUI;
+static unsigned count = ~0;
+
+static int process_opt(void *context, int ch, char *optarg)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
+	switch (ch) {
+	case 'c':
+		count = strtoul(optarg, 0, 0);
+		break;
+	case 'f':
+		flood++;
+		break;
+	case 'o':
+		oui = strtoul(optarg, 0, 0);
+		break;
+	case 'S':
+		server++;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int mgmt_classes[1] = { IB_SA_CLASS };
 	int ping_class = IB_VENDOR_OPENIB_PING_CLASS;
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	int timeout = 0, udebug = 0, server = 0, flood = 0;
-	int oui = IB_OPENIB_OUI;
 	uint64_t rtt;
-	uint count = ~0;
-	extern int ibdebug;
 	char *err;
-	char *ca = 0;
-	int ca_port = 0;
-
-	static char const str_opts[] = "C:P:t:s:c:o:devGfSVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "err_show", 0, 0, 'e'},
-		{ "verbose", 0, 0, 'v'},
-		{ "Guid", 0, 0, 'G'},
-		{ "s", 1, 0, 's'},
-		{ "timeout", 1, 0, 't'},
-		{ "c", 1, 0, 'c'},
-		{ "flood", 0, 0, 'f'},
-		{ "o", 1, 0, 'o'},
-		{ "Server", 0, 0, 'S'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+
+	const struct ibdiag_opt opts[] = {
+		{"count", 'c', 1, "<num>", "stop after count packets"},
+		{"flood", 'f', 0, NULL, "flood destination"},
+		{"oui", 'o', 1, NULL, "use specified OUI number"},
+		{"Server", 'S', 0, NULL, "start in server mode"},
+		{0}
 	};
+	char usage_args[] = "<dest lid|guid>";
+
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
+			    usage_args, NULL);
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'c':
-			count = strtoul(optarg, 0, 0);
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'e':
-			madrpc_show_errors(1);
-			break;
-		case 'f':
-			flood++;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'o':
-			oui = strtoul(optarg, 0, 0);
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 'S':
-			server++;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'v':
-			verbose++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
 	if (!argc && !server)
-		usage();
+		ibdiag_show_usage();
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 1);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	if (server) {
-		if (mad_register_server(ping_class, 0, 0, oui) < 0)
-			IBERROR("can't serve class %d on this port", ping_class);
+		if (mad_register_server_via(ping_class, 0, 0, oui, srcport) < 0)
+			IBERROR("can't serve class %d on this port",
+				ping_class);
 
 		get_host_and_domain(host_and_domain, sizeof host_and_domain);
 
@@ -296,16 +227,18 @@ main(int argc, char **argv)
 		exit(0);
 	}
 
-	if (mad_register_client(ping_class, 0) < 0)
-		IBERROR("can't register ping class %d on this port", ping_class);
+	if (mad_register_client_via(ping_class, 0, srcport) < 0)
+		IBERROR("can't register ping class %d on this port",
+			ping_class);
 
-	if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[0]);
 
 	signal(SIGINT, report);
 	signal(SIGTERM, report);
 
-	start = getcurrenttime();
+	start = cl_get_time_stamp();
 
 	while (count-- > 0) {
 		ntrans++;
@@ -327,5 +260,7 @@ main(int argc, char **argv)
 
 	report(0);
 
+	mad_rpc_close_port(srcport);
+
 	exit(-1);
 }
diff --git a/src/ibportstate.c b/src/ibportstate.c
index 36453bb..1d8dc81 100644
--- a/src/ibportstate.c
+++ b/src/ibportstate.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2010,2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,110 +34,243 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
-#include <time.h>
 #include <string.h>
 #include <getopt.h>
+#include <errno.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 
 #include "ibdiag_common.h"
 
-#undef DEBUG
-#define	DEBUG	if (verbose>1) IBWARN
-
-static int dest_type = IB_DEST_LID;
-static int verbose;
-
-char *argv0 = "ibportstate";
+enum port_ops {
+	QUERY,
+	ENABLE,
+	RESET,
+	DISABLE,
+	SPEED,
+	ESPEED,
+	FDR10SPEED,
+	WIDTH,
+	DOWN,
+	ARM,
+	ACTIVE,
+	VLS,
+	MTU,
+	LID,
+	SMLID,
+	LMC,
+	MKEY,
+	MKEYLEASE,
+	MKEYPROT,
+};
+
+struct ibmad_port *srcport;
+uint64_t speed = 0; /* no state change */
+uint64_t espeed = 0; /* no state change */
+uint64_t fdr10 = 0; /* no state change */
+uint64_t width = 0; /* no state change */
+uint64_t lid;
+uint64_t smlid;
+uint64_t lmc;
+uint64_t mtu;
+uint64_t vls = 0; /* no state change */
+uint64_t mkey;
+uint64_t mkeylease;
+uint64_t mkeyprot;
+
+struct {
+	const char *name;
+	uint64_t *val;
+	int set;
+} port_args[] = {
+	{"query", NULL, 0},	/* QUERY */
+	{"enable", NULL, 0},	/* ENABLE */
+	{"reset", NULL, 0},	/* RESET */
+	{"disable", NULL, 0},	/* DISABLE */
+	{"speed", &speed, 0},	/* SPEED */
+	{"espeed", &espeed, 0},	/* EXTENDED SPEED */
+	{"fdr10", &fdr10, 0},	/* FDR10 SPEED */
+	{"width", &width, 0},	/* WIDTH */
+	{"down", NULL, 0},	/* DOWN */
+	{"arm", NULL, 0},	/* ARM */
+	{"active", NULL, 0},	/* ACTIVE */
+	{"vls", &vls, 0},	/* VLS */
+	{"mtu", &mtu, 0},	/* MTU */
+	{"lid", &lid, 0},	/* LID */
+	{"smlid", &smlid, 0},	/* SMLID */
+	{"lmc", &lmc, 0},	/* LMC */
+	{"mkey", &mkey, 0},	/* MKEY */
+	{"mkeylease", &mkeylease, 0},	/* MKEY LEASE */
+	{"mkeyprot", &mkeyprot, 0},	/* MKEY PROTECT BITS */
+};
+
+#define NPORT_ARGS (sizeof(port_args) / sizeof(port_args[0]))
 
 /*******************************************/
 
-static int
-get_node_info(ib_portid_t *dest, uint8_t *data)
+/*
+ * Return 1 if node is a switch, else zero.
+ */
+static int get_node_info(ib_portid_t * dest, uint8_t * data)
 {
 	int node_type;
 
-	if (!smp_query(data, dest, IB_ATTR_NODE_INFO, 0, 0))
-		return -1;
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
+		IBERROR("smp query nodeinfo failed");
 
 	node_type = mad_get_field(data, 0, IB_NODE_TYPE_F);
 	if (node_type == IB_NODE_SWITCH)	/* Switch NodeType ? */
-		return 0;
-	else
 		return 1;
+	else
+		return 0;
 }
 
-static int
-get_port_info(ib_portid_t *dest, uint8_t *data, int portnum, int port_op)
+static int get_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
+			 int is_switch)
 {
-	char buf[2048];
-	char val[64];
+	uint8_t smp[IB_SMP_DATA_SIZE];
+	uint8_t *info;
+	int cap_mask;
+
+	if (is_switch) {
+		if (!smp_query_via(smp, dest, IB_ATTR_PORT_INFO, 0, 0, srcport))
+			IBERROR("smp query port 0 portinfo failed");
+		info = smp;
+	} else
+		info = data;
+
+	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
+		IBERROR("smp query portinfo failed");
+	cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+	return (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS));
+}
 
-	if (!smp_query(data, dest, IB_ATTR_PORT_INFO, portnum, 0))
-		return -1;
+static void show_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
+			   int espeed_cap, int is_switch)
+{
+	char buf[2300];
+	char val[64];
 
-	if (port_op != 4) {
-		mad_dump_portstates(buf, sizeof buf, data, sizeof data);
-		mad_decode_field(data, IB_PORT_LINK_WIDTH_SUPPORTED_F, val);
-		mad_dump_field(IB_PORT_LINK_WIDTH_SUPPORTED_F, buf + strlen(buf), sizeof buf - strlen(buf), val);
-		sprintf(buf+strlen(buf), "%s", "\n");
-		mad_decode_field(data, IB_PORT_LINK_WIDTH_ENABLED_F, val);
-		mad_dump_field(IB_PORT_LINK_WIDTH_ENABLED_F, buf + strlen(buf), sizeof buf - strlen(buf), val);
-		sprintf(buf+strlen(buf), "%s", "\n");
-		mad_decode_field(data, IB_PORT_LINK_WIDTH_ACTIVE_F, val);
-		mad_dump_field(IB_PORT_LINK_WIDTH_ACTIVE_F, buf + strlen(buf), sizeof buf - strlen(buf), val);
-		sprintf(buf+strlen(buf), "%s", "\n");
-		mad_decode_field(data, IB_PORT_LINK_SPEED_SUPPORTED_F, val);
-		mad_dump_field(IB_PORT_LINK_SPEED_SUPPORTED_F, buf + strlen(buf), sizeof buf - strlen(buf), val);
-		sprintf(buf+strlen(buf), "%s", "\n");
-		mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F, val);
-		mad_dump_field(IB_PORT_LINK_SPEED_ENABLED_F, buf + strlen(buf), sizeof buf - strlen(buf), val);
+	mad_dump_portstates(buf, sizeof buf, data, sizeof *data);
+	mad_decode_field(data, IB_PORT_LID_F, val);
+	mad_dump_field(IB_PORT_LID_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_SMLID_F, val);
+	mad_dump_field(IB_PORT_SMLID_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LMC_F, val);
+	mad_dump_field(IB_PORT_LMC_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LINK_WIDTH_SUPPORTED_F, val);
+	mad_dump_field(IB_PORT_LINK_WIDTH_SUPPORTED_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LINK_WIDTH_ENABLED_F, val);
+	mad_dump_field(IB_PORT_LINK_WIDTH_ENABLED_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LINK_WIDTH_ACTIVE_F, val);
+	mad_dump_field(IB_PORT_LINK_WIDTH_ACTIVE_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LINK_SPEED_SUPPORTED_F, val);
+	mad_dump_field(IB_PORT_LINK_SPEED_SUPPORTED_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F, val);
+	mad_dump_field(IB_PORT_LINK_SPEED_ENABLED_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	mad_decode_field(data, IB_PORT_LINK_SPEED_ACTIVE_F, val);
+	mad_dump_field(IB_PORT_LINK_SPEED_ACTIVE_F, buf + strlen(buf),
+		       sizeof buf - strlen(buf), val);
+	sprintf(buf + strlen(buf), "%s", "\n");
+	if (espeed_cap) {
+		mad_decode_field(data, IB_PORT_LINK_SPEED_EXT_SUPPORTED_F, val);
+		mad_dump_field(IB_PORT_LINK_SPEED_EXT_SUPPORTED_F,
+			       buf + strlen(buf), sizeof buf - strlen(buf),
+			       val);
+		sprintf(buf + strlen(buf), "%s", "\n");
+		mad_decode_field(data, IB_PORT_LINK_SPEED_EXT_ENABLED_F, val);
+		mad_dump_field(IB_PORT_LINK_SPEED_EXT_ENABLED_F,
+			       buf + strlen(buf), sizeof buf - strlen(buf),
+			       val);
+		sprintf(buf + strlen(buf), "%s", "\n");
+		mad_decode_field(data, IB_PORT_LINK_SPEED_EXT_ACTIVE_F, val);
+		mad_dump_field(IB_PORT_LINK_SPEED_EXT_ACTIVE_F,
+			       buf + strlen(buf), sizeof buf - strlen(buf),
+			       val);
+		sprintf(buf + strlen(buf), "%s", "\n");
+	}
+	if (!is_switch || portnum == 0) {
+		if (show_keys) {
+			mad_decode_field(data, IB_PORT_MKEY_F, val);
+			mad_dump_field(IB_PORT_MKEY_F, buf + strlen(buf),
+				       sizeof buf - strlen(buf), val);
+		} else
+			snprint_field(buf+strlen(buf), sizeof(buf)-strlen(buf),
+				      IB_PORT_MKEY_F, 32, NOT_DISPLAYED_STR);
 		sprintf(buf+strlen(buf), "%s", "\n");
-		mad_decode_field(data, IB_PORT_LINK_SPEED_ACTIVE_F, val);
-		mad_dump_field(IB_PORT_LINK_SPEED_ACTIVE_F, buf + strlen(buf), sizeof buf - strlen(buf), val);
+		mad_decode_field(data, IB_PORT_MKEY_LEASE_F, val);
+		mad_dump_field(IB_PORT_MKEY_LEASE_F, buf + strlen(buf),
+			       sizeof buf - strlen(buf), val);
 		sprintf(buf+strlen(buf), "%s", "\n");
-	} else {
-		mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F, val);
-		mad_dump_field(IB_PORT_LINK_SPEED_ENABLED_F, buf, sizeof buf, val);
+		mad_decode_field(data, IB_PORT_MKEY_PROT_BITS_F, val);
+		mad_dump_field(IB_PORT_MKEY_PROT_BITS_F, buf + strlen(buf),
+			       sizeof buf - strlen(buf), val);
 		sprintf(buf+strlen(buf), "%s", "\n");
 	}
 
 	printf("# Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
-	return 0;
 }
 
-static int
-set_port_info(ib_portid_t *dest, uint8_t *data, int portnum, int port_op)
+static void set_port_info(ib_portid_t * dest, uint8_t * data, int portnum,
+			  int espeed_cap, int is_switch)
 {
-	char buf[2048];
-	char val[64];
+	if (!smp_set_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
+		IBERROR("smp set portinfo failed");
 
-	if (!smp_set(data, dest, IB_ATTR_PORT_INFO, portnum, 0))
-		return -1;
+	printf("\nAfter PortInfo set:\n");
+	show_port_info(dest, data, portnum, espeed_cap, is_switch);
+}
 
-	if (port_op != 4)
-		mad_dump_portstates(buf, sizeof buf, data, sizeof data);
-	else {
-		mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F, val);
-		mad_dump_field(IB_PORT_LINK_SPEED_ENABLED_F, buf, sizeof buf, val);
-		sprintf(buf+strlen(buf), "%s", "\n");
-	}
+static void get_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
+{
+	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO,
+			   portnum, 0, srcport))
+		IBERROR("smp query ext portinfo failed");
+}
 
-	printf("\nAfter PortInfo set:\n");
-	printf("# Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
-	return 0;
+static void show_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
+{
+	char buf[256];
+
+	mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, IB_SMP_DATA_SIZE);
+
+	printf("# Extended Port info: %s port %d\n%s", portid2str(dest),
+	       portnum, buf);
 }
 
-static int
-get_link_width(int lwe, int lws)
+static void set_ext_port_info(ib_portid_t * dest, uint8_t * data, int portnum)
+{
+	if (!smp_set_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO,
+			 portnum, 0, srcport))
+		IBERROR("smp set ext portinfo failed");
+
+	printf("\nAfter ExtendedPortInfo set:\n");
+	show_ext_port_info(dest, data, portnum);
+}
+
+static int get_link_width(int lwe, int lws)
 {
 	if (lwe == 255)
 		return lws;
@@ -144,8 +278,7 @@ get_link_width(int lwe, int lws)
 		return lwe;
 }
 
-static int
-get_link_speed(int lse, int lss)
+static int get_link_speed(int lse, int lss)
 {
 	if (lse == 15)
 		return lss;
@@ -153,296 +286,447 @@ get_link_speed(int lse, int lss)
 		return lse;
 }
 
-static void
-validate_width(int width, int peerwidth, int lwa)
+static int get_link_speed_ext(int lsee, int lses)
+{
+	if (lsee == 31)
+		return lses;
+	else
+		return lsee;
+}
+
+static void validate_width(int width, int peerwidth, int lwa)
 {
-	if ((width & 0x8) && (peerwidth & 0x8)) {
+	if ((width & peerwidth & 0x8)) {
 		if (lwa != 8)
-			IBWARN("Peer ports operating at active width %d rather than 8 (12x)", lwa);
-	} else {
-		if ((width & 0x4) && (peerwidth & 0x4)) {
-			if (lwa != 4)
-				IBWARN("Peer ports operating at active width %d rather than 4 (8x)", lwa);
-		} else {
-			if ((width & 0x2) && (peerwidth & 0x2)) {
-				if (lwa != 2)
-					IBWARN("Peer ports operating at active width %d rather than 2 (4x)", lwa);
-			} else {
-				if ((width & 0x1) && (peerwidth & 0x1)) {
-					if (lwa != 1)
-						IBWARN("Peer ports operating at active width %d rather than 1 (1x)", lwa);
-				}
-			}
-		}
+			IBWARN
+			    ("Peer ports operating at active width %d rather than 8 (12x)",
+			     lwa);
+	} else if ((width & peerwidth & 0x4)) {
+		if (lwa != 4)
+			IBWARN
+			    ("Peer ports operating at active width %d rather than 4 (8x)",
+			     lwa);
+	} else if ((width & peerwidth & 0x2)) {
+		if (lwa != 2)
+			IBWARN
+			    ("Peer ports operating at active width %d rather than 2 (4x)",
+			     lwa);
+	} else if ((width & peerwidth & 0x1)) {
+		if (lwa != 1)
+			IBWARN
+			    ("Peer ports operating at active width %d rather than 1 (1x)",
+			     lwa);
 	}
 }
 
-static void
-validate_speed(int speed, int peerspeed, int lsa)
+static void validate_speed(int speed, int peerspeed, int lsa)
 {
-	if ((speed & 0x4) && (peerspeed & 0x4)) {
+	if ((speed & peerspeed & 0x4)) {
 		if (lsa != 4)
-			IBWARN("Peer ports operating at active speed %d rather than  4 (10.0 Gbps)", lsa);
-	} else {
-		if ((speed & 0x2) && (peerspeed & 0x2)) {
-			if (lsa != 2)
-				IBWARN("Peer ports operating at active speed %d rather than 2 (5.0 Gbps)", lsa);
-		} else {
-			if ((speed & 0x1) && (peerspeed & 0x1)) {
-				if (lsa != 1)
-					IBWARN("Peer ports operating at active speed %d rather than 1 (2.5 Gbps)", lsa);
-			}
-		}
+			IBWARN
+			    ("Peer ports operating at active speed %d rather than 4 (10.0 Gbps)",
+			     lsa);
+	} else if ((speed & peerspeed & 0x2)) {
+		if (lsa != 2)
+			IBWARN
+			    ("Peer ports operating at active speed %d rather than 2 (5.0 Gbps)",
+			     lsa);
+	} else if ((speed & peerspeed & 0x1)) {
+		if (lsa != 1)
+			IBWARN
+			    ("Peer ports operating at active speed %d rather than 1 (2.5 Gbps)",
+			     lsa);
 	}
 }
 
-void
-usage(void)
+static void validate_extended_speed(int espeed, int peerespeed, int lsea)
 {
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -e(rr_show) -v(erbose) -D(irect) -G(uid) -s smlid -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms] <dest dr_path|lid|guid> <portnum> [<op>]\n",
-			basename);
-	fprintf(stderr, "\tsupported ops: enable, disable, reset, speed, query\n");
-	fprintf(stderr, "\n\texamples:\n");
-	fprintf(stderr, "\t\t%s 3 1 disable\t\t\t# by lid\n", basename);
-	fprintf(stderr, "\t\t%s -G 0x2C9000100D051 1 enable\t# by guid\n", basename);
-	fprintf(stderr, "\t\t%s -D 0 1\t\t\t# (query) by direct route\n", basename);
-	fprintf(stderr, "\t\t%s 3 1 reset\t\t\t# by lid\n", basename);
-	fprintf(stderr, "\t\t%s 3 1 speed 1\t\t\t# by lid\n", basename);
-	exit(-1);
+	if ((espeed & peerespeed & 0x2)) {
+		if (lsea != 2)
+			IBWARN
+			    ("Peer ports operating at active extended speed %d rather than 2 (25.78125 Gbps)",
+			     lsea);
+	} else if ((espeed & peerespeed & 0x1)) {
+		if (lsea != 1)
+			IBWARN
+			    ("Peer ports operating at active extended speed %d rather than 1 (14.0625 Gbps)",
+			     lsea);
+	}
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
-	ib_portid_t portid = {0};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	extern int ibdebug;
-	int err;
-	int timeout = 0, udebug = 0;
-	char *ca = 0;
-	int ca_port = 0;
-	int port_op = 0;	/* default to query */
-	int speed = 15;
-	int is_switch = 1;
-	int state, physstate, lwe, lws, lwa, lse, lss, lsa;
-	int peerlocalportnum, peerlwe, peerlws, peerlwa, peerlse, peerlss, peerlsa;
-	int width, peerwidth, peerspeed;
-	uint8_t data[IB_SMP_DATA_SIZE];
-	ib_portid_t peerportid = {0};
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
+	ib_portid_t portid = { 0 };
+	int port_op = -1;
+	int is_switch, is_peer_switch, espeed_cap, peer_espeed_cap;
+	int state, physstate, lwe, lws, lwa, lse, lss, lsa, lsee, lses, lsea,
+	    fdr10s, fdr10e, fdr10a;
+	int peerlocalportnum, peerlwe, peerlws, peerlwa, peerlse, peerlss,
+	    peerlsa, peerlsee, peerlses, peerlsea, peerfdr10s, peerfdr10e,
+	    peerfdr10a;
+	int peerwidth, peerspeed, peerespeed;
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t data2[IB_SMP_DATA_SIZE] = { 0 };
+	ib_portid_t peerportid = { 0 };
 	int portnum = 0;
-	ib_portid_t selfportid = {0};
+	ib_portid_t selfportid = { 0 };
 	int selfport = 0;
-
-	static char const str_opts[] = "C:P:t:s:devDGVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "err_show", 0, 0, 'e'},
-		{ "verbose", 0, 0, 'v'},
-		{ "Direct", 0, 0, 'D'},
-		{ "Guid", 0, 0, 'G'},
-		{ "timeout", 1, 0, 't'},
-		{ "s", 1, 0, 's'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+	int changed = 0;
+	int i;
+	uint16_t devid, rem_devid;
+	uint64_t val;
+	char *endp;
+	char usage_args[] = "<dest dr_path|lid|guid> <portnum> [<op>]\n"
+	    "\nSupported ops: enable, disable, reset, speed, espeed, fdr10,\n"
+	    "\twidth, query, down, arm, active, vls, mtu, lid, smlid, lmc,\n"
+	    "\tmkey, mkeylease, mkeyprot\n";
+	const char *usage_examples[] = {
+		"3 1 disable\t\t\t# by lid",
+		"-G 0x2C9000100D051 1 enable\t# by guid",
+		"-D 0 1\t\t\t# (query) by direct route",
+		"3 1 reset\t\t\t# by lid",
+		"3 1 speed 1\t\t\t# by lid",
+		"3 1 width 1\t\t\t# by lid",
+		"-D 0 1 lid 0x1234 arm\t\t# by direct route",
+		NULL
 	};
 
-	argv0 = argv[0];
+	ibdiag_process_opts(argc, argv, NULL, NULL, NULL, NULL,
+			    usage_args, usage_examples);
 
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'e':
-			madrpc_show_errors(1);
-			break;
-		case 'D':
-			dest_type = IB_DEST_DRPATH;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'v':
-			verbose++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
 	if (argc < 2)
-		usage();
+		ibdiag_show_usage();
+
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	smp_mkey_set(srcport, ibd_mkey);
 
-	if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[0]);
 
-	/* First, make sure it is a switch port if it is a "set" */
-	if (argc >= 3) {
-		if (!strcmp(argv[2], "enable"))
-			port_op = 1;
-		else if (!strcmp(argv[2], "disable"))
-			port_op = 2;
-		else if (!strcmp(argv[2], "reset"))
-			port_op = 3;
-		else if (!strcmp(argv[2], "speed")) {
-			if (argc < 4)
-				IBERROR("speed requires an additional parameter");
-			port_op = 4;
-			/* Parse speed value */
-			speed = strtoul(argv[3], 0, 0);
-			if (speed > 15)
-				IBERROR("invalid speed value %d", speed);
+	if (argc > 1)
+		portnum = strtol(argv[1], 0, 0);
+
+	for (i = 2; i < argc; i++) {
+		int j;
+
+		for (j = 0; j < NPORT_ARGS; j++) {
+			if (strcmp(argv[i], port_args[j].name))
+				continue;
+			port_args[j].set = 1;
+			if (!port_args[j].val) {
+				if (port_op >= 0)
+					IBERROR("%s only one of: ",
+						"query, enable, disable, "
+						"reset, down, arm, active, "
+						"can be specified",
+						port_args[j].name);
+				port_op = j;
+				break;
+			}
+			if (++i >= argc)
+				IBERROR("%s requires an additional parameter",
+					port_args[j].name);
+			val = strtoull(argv[i], 0, 0);
+			switch (j) {
+			case SPEED:
+				if (val < 0 || val > 15)
+					IBERROR("invalid speed value %ld", val);
+				break;
+			case ESPEED:
+				if (val < 0 || val > 31)
+					IBERROR("invalid extended speed value %ld", val);
+				break;
+			case FDR10SPEED:
+				if (val < 0 || val > 1)
+					IBERROR("invalid fdr10 speed value %ld", val);
+				break;
+			case WIDTH:
+				if (val < 0 || (val > 15 && val != 255))
+					IBERROR("invalid width value %ld", val);
+				break;
+			case VLS:
+				if (val <= 0 || val > 5)
+					IBERROR("invalid vls value %ld", val);
+				break;
+			case MTU:
+				if (val <= 0 || val > 5)
+					IBERROR("invalid mtu value %ld", val);
+				break;
+			case LID:
+				if (val <= 0 || val >= 0xC000)
+					IBERROR("invalid lid value 0x%lx", val);
+				break;
+			case SMLID:
+				if (val <= 0 || val >= 0xC000)
+					IBERROR("invalid smlid value 0x%lx",
+						val);
+				break;
+			case LMC:
+				if (val < 0 || val > 7)
+					IBERROR("invalid lmc value %ld", val);
+				break;
+			case MKEY:
+				errno = 0;
+				val = strtoull(argv[i], &endp, 0);
+				if (errno || *endp != '\0') {
+					errno = 0;
+					val = strtoull(getpass("New M_Key: "),
+						       &endp, 0);
+					if (errno || *endp != '\0') {
+						IBERROR("Bad new M_Key\n");
+					}
+				}
+				/* All 64-bit values are legal */
+				break;
+			case MKEYLEASE:
+				if (val < 0 || val > 0xFFFF)
+					IBERROR("invalid mkey lease time %ld", val);
+				break;
+			case MKEYPROT:
+				if (val < 0 || val > 3)
+					IBERROR("invalid mkey protection bit setting %ld", val);
+			}
+			*port_args[j].val = val;
+			changed = 1;
+			break;
 		}
+		if (j == NPORT_ARGS)
+			IBERROR("invalid operation: %s", argv[i]);
 	}
+	if (port_op < 0)
+		port_op = QUERY;
 
-	err = get_node_info(&portid, data);
-	if (err < 0)
-		IBERROR("smp query nodeinfo failed");
-	if (err) {		/* not switch */
-		if (port_op == 0)	/* query op */
-			is_switch = 0;
-		else if (port_op != 4)	/* other than speed op */
-			IBERROR("smp query nodeinfo: Node type not switch");
-	}
+	is_switch = get_node_info(&portid, data);
+	devid = (uint16_t) mad_get_field(data, 0, IB_NODE_DEVID_F);
 
-	if (argc-1 > 0)
-		portnum = strtol(argv[1], 0, 0);
+	if ((port_args[MKEY].set || port_args[MKEYLEASE].set ||
+	     port_args[MKEYPROT].set) && is_switch && portnum != 0)
+		IBERROR("Can't set M_Key fields on switch port != 0");
 
-	if (port_op)
-		printf("Initial PortInfo:\n");
+	if (port_op != QUERY || changed)
+		printf("Initial %s PortInfo:\n", is_switch ? "Switch" : "CA");
 	else
-		printf("PortInfo:\n");
-	err = get_port_info(&portid, data, portnum, port_op);
-	if (err < 0)
-		IBERROR("smp query portinfo failed");
+		printf("%s PortInfo:\n", is_switch ? "Switch" : "CA");
+	espeed_cap = get_port_info(&portid, data, portnum, is_switch);
+	show_port_info(&portid, data, portnum, espeed_cap, is_switch);
+	if (is_mlnx_ext_port_info_supported(devid)) {
+		get_ext_port_info(&portid, data2, portnum);
+		show_ext_port_info(&portid, data2, portnum);
+	}
 
-	/* Only if one of the "set" options is chosen */
-	if (port_op) {
-		if (port_op == 1)		/* Enable port */
-			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);	/* Polling */
-		else if ((port_op == 2) || (port_op == 3)) { /* Disable port */
-			mad_set_field(data, 0, IB_PORT_STATE_F, 1);             /* Down */
-			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 3);        /* Disabled */
-		} else if (port_op == 4) {	/* Set speed */
-			mad_set_field(data, 0, IB_PORT_LINK_SPEED_ENABLED_F, speed);
-			mad_set_field(data, 0, IB_PORT_STATE_F, 0);
-			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 0);
+	if (port_op != QUERY || changed) {
+		/*
+		 * If we aren't setting the LID and the LID is the default,
+		 * the SMA command will fail due to an invalid LID.
+		 * Set it to something unlikely but valid.
+		 */
+		val = mad_get_field(data, 0, IB_PORT_LID_F);
+		if (!port_args[LID].set && (!val || val == 0xFFFF))
+			mad_set_field(data, 0, IB_PORT_LID_F, 0x1234);
+		val = mad_get_field(data, 0, IB_PORT_SMLID_F);
+		if (!port_args[SMLID].set && (!val || val == 0xFFFF))
+			mad_set_field(data, 0, IB_PORT_SMLID_F, 0x1234);
+		mad_set_field(data, 0, IB_PORT_STATE_F, 0);	/* NOP */
+		mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 0);	/* NOP */
+
+		switch (port_op) {
+		case ENABLE:
+		case RESET:
+			/* Polling */
+			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);
+			break;
+		case DISABLE:
+			printf("Disable may be irreversible\n");
+			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 3);
+			break;
+		case DOWN:
+			mad_set_field(data, 0, IB_PORT_STATE_F, 1);
+			break;
+		case ARM:
+			mad_set_field(data, 0, IB_PORT_STATE_F, 3);
+			break;
+		case ACTIVE:
+			mad_set_field(data, 0, IB_PORT_STATE_F, 4);
+			break;
 		}
 
-		err = set_port_info(&portid, data, portnum, port_op);
-		if (err < 0)
-			IBERROR("smp set portinfo failed");
-
-		if (port_op == 3) {	/* Reset port - so also enable */
-			mad_set_field(data, 0, IB_PORT_PHYS_STATE_F, 2);	/* Polling */
-			err = set_port_info(&portid, data, portnum, port_op);
-			if (err < 0)
-				IBERROR("smp set portinfo failed");
+		/* always set enabled speeds/width - defaults to NOP */
+		mad_set_field(data, 0, IB_PORT_LINK_SPEED_ENABLED_F, speed);
+		mad_set_field(data, 0, IB_PORT_LINK_SPEED_EXT_ENABLED_F, espeed);
+		mad_set_field(data, 0, IB_PORT_LINK_WIDTH_ENABLED_F, width);
+
+		if (port_args[VLS].set)
+			mad_set_field(data, 0, IB_PORT_OPER_VLS_F, vls);
+		if (port_args[MTU].set)
+			mad_set_field(data, 0, IB_PORT_NEIGHBOR_MTU_F, mtu);
+		if (port_args[LID].set)
+			mad_set_field(data, 0, IB_PORT_LID_F, lid);
+		if (port_args[SMLID].set)
+			mad_set_field(data, 0, IB_PORT_SMLID_F, smlid);
+		if (port_args[LMC].set)
+			mad_set_field(data, 0, IB_PORT_LMC_F, lmc);
+
+		if (port_args[FDR10SPEED].set) {
+			mad_set_field(data2, 0,
+				      IB_MLNX_EXT_PORT_STATE_CHG_ENABLE_F,
+				      FDR10);
+			mad_set_field(data2, 0,
+				      IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+				      fdr10);
+			set_ext_port_info(&portid, data2, portnum);
 		}
-	} else {	/* query op */
-		/* only compare peer port if switch port */
-		if (is_switch) {
-			/* First, exclude SP0 */
-			if (portnum) {
-				/* Now, make sure PortState is Active */
-				/* Or is PortPhysicalState LinkUp sufficient ? */
-				mad_decode_field(data, IB_PORT_STATE_F, &state);
-				mad_decode_field(data, IB_PORT_PHYS_STATE_F, &physstate);
-				if (state == 4) {	/* Active */
-					mad_decode_field(data, IB_PORT_LINK_WIDTH_ENABLED_F, &lwe );
-					mad_decode_field(data, IB_PORT_LINK_WIDTH_SUPPORTED_F, &lws);
-					mad_decode_field(data, IB_PORT_LINK_WIDTH_ACTIVE_F, &lwa);
-					mad_decode_field(data, IB_PORT_LINK_SPEED_SUPPORTED_F, &lss);
-					mad_decode_field(data, IB_PORT_LINK_SPEED_ACTIVE_F, &lsa);
-					mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F, &lse);
-
-					/* Setup portid for peer port */
-					memcpy(&peerportid, &portid, sizeof(peerportid));
-					peerportid.drpath.cnt = 1;
-					peerportid.drpath.p[1] = portnum;
-
-					/* Set DrSLID to local lid */
-					if (ib_resolve_self(&selfportid, &selfport, 0) < 0)
-						IBERROR("could not resolve self");
-					peerportid.drpath.drslid = selfportid.lid;
-					peerportid.drpath.drdlid = 0xffff;
-
-					/* Get peer port NodeInfo to obtain peer port number */
-					err = get_node_info(&peerportid, data);
-					if (err < 0)
-						IBERROR("smp query nodeinfo failed");
-
-					mad_decode_field(data, IB_NODE_LOCAL_PORT_F, &peerlocalportnum);
-
-					printf("Peer PortInfo:\n");
-					/* Get peer port characteristics */
-					err = get_port_info(&peerportid, data, peerlocalportnum, port_op);
-					if (err < 0)
-						IBERROR("smp query peer portinfofailed");
-
-					mad_decode_field(data, IB_PORT_LINK_WIDTH_ENABLED_F, &peerlwe );
-					mad_decode_field(data, IB_PORT_LINK_WIDTH_SUPPORTED_F, &peerlws);
-					mad_decode_field(data, IB_PORT_LINK_WIDTH_ACTIVE_F, &peerlwa);
-					mad_decode_field(data, IB_PORT_LINK_SPEED_SUPPORTED_F, &peerlss);
-					mad_decode_field(data, IB_PORT_LINK_SPEED_ACTIVE_F, &peerlsa);
-					mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F, &peerlse);
-
-					/* Now validate peer port characteristics */
-					/* Examine Link Width */
-					width = get_link_width(lwe, lws);
-					peerwidth = get_link_width(peerlwe, peerlws);
-					validate_width(width, peerwidth, lwa);
-
-					/* Examine Link Speed */
-					speed = get_link_speed(lse, lss);
-					peerspeed = get_link_speed(peerlse, peerlss);
-					validate_speed(speed, peerspeed, lsa);
+
+		if (port_args[MKEY].set)
+			mad_set_field64(data, 0, IB_PORT_MKEY_F, mkey);
+		if (port_args[MKEYLEASE].set)
+			mad_set_field(data, 0, IB_PORT_MKEY_LEASE_F,
+				      mkeylease);
+		if (port_args[MKEYPROT].set)
+			mad_set_field(data, 0, IB_PORT_MKEY_PROT_BITS_F,
+				      mkeyprot);
+
+		set_port_info(&portid, data, portnum, espeed_cap, is_switch);
+
+	} else if (is_switch && portnum) {
+		/* Now, make sure PortState is Active */
+		/* Or is PortPhysicalState LinkUp sufficient ? */
+		mad_decode_field(data, IB_PORT_STATE_F, &state);
+		mad_decode_field(data, IB_PORT_PHYS_STATE_F, &physstate);
+		if (state == 4) {	/* Active */
+			mad_decode_field(data, IB_PORT_LINK_WIDTH_ENABLED_F,
+					 &lwe);
+			mad_decode_field(data, IB_PORT_LINK_WIDTH_SUPPORTED_F,
+					 &lws);
+			mad_decode_field(data, IB_PORT_LINK_WIDTH_ACTIVE_F,
+					 &lwa);
+			mad_decode_field(data, IB_PORT_LINK_SPEED_SUPPORTED_F,
+					 &lss);
+			mad_decode_field(data, IB_PORT_LINK_SPEED_ACTIVE_F,
+					 &lsa);
+			mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F,
+					 &lse);
+			mad_decode_field(data2,
+					 IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+					 &fdr10s);
+			mad_decode_field(data2,
+					 IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+					 &fdr10e);
+			mad_decode_field(data2,
+					 IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+					 &fdr10a);
+			if (espeed_cap) {
+				mad_decode_field(data,
+						 IB_PORT_LINK_SPEED_EXT_SUPPORTED_F,
+						 &lses);
+				mad_decode_field(data,
+						 IB_PORT_LINK_SPEED_EXT_ACTIVE_F,
+						 &lsea);
+				mad_decode_field(data,
+						 IB_PORT_LINK_SPEED_EXT_ENABLED_F,
+						 &lsee);
+			}
+
+			/* Setup portid for peer port */
+			memcpy(&peerportid, &portid, sizeof(peerportid));
+			peerportid.drpath.cnt = 1;
+			peerportid.drpath.p[1] = (uint8_t) portnum;
+
+			/* Set DrSLID to local lid */
+			if (resolve_self(ibd_ca, ibd_ca_port, &selfportid,
+						&selfport, 0) < 0)
+				IBERROR("could not resolve self");
+			peerportid.drpath.drslid = (uint16_t) selfportid.lid;
+			peerportid.drpath.drdlid = 0xffff;
+
+			/* Get peer port NodeInfo to obtain peer port number */
+			is_peer_switch = get_node_info(&peerportid, data);
+			rem_devid = (uint16_t) mad_get_field(data, 0, IB_NODE_DEVID_F);
+
+			mad_decode_field(data, IB_NODE_LOCAL_PORT_F,
+					 &peerlocalportnum);
+
+			printf("Peer PortInfo:\n");
+			/* Get peer port characteristics */
+			peer_espeed_cap = get_port_info(&peerportid, data,
+							peerlocalportnum,
+							is_peer_switch);
+			if (is_mlnx_ext_port_info_supported(rem_devid))
+				get_ext_port_info(&peerportid, data2,
+						  peerlocalportnum);
+			show_port_info(&peerportid, data, peerlocalportnum,
+				       peer_espeed_cap, is_peer_switch);
+			if (is_mlnx_ext_port_info_supported(rem_devid))
+				show_ext_port_info(&peerportid, data2,
+						   peerlocalportnum);
+
+			mad_decode_field(data, IB_PORT_LINK_WIDTH_ENABLED_F,
+					 &peerlwe);
+			mad_decode_field(data, IB_PORT_LINK_WIDTH_SUPPORTED_F,
+					 &peerlws);
+			mad_decode_field(data, IB_PORT_LINK_WIDTH_ACTIVE_F,
+					 &peerlwa);
+			mad_decode_field(data, IB_PORT_LINK_SPEED_SUPPORTED_F,
+					 &peerlss);
+			mad_decode_field(data, IB_PORT_LINK_SPEED_ACTIVE_F,
+					 &peerlsa);
+			mad_decode_field(data, IB_PORT_LINK_SPEED_ENABLED_F,
+					 &peerlse);
+			mad_decode_field(data2,
+					 IB_MLNX_EXT_PORT_LINK_SPEED_SUPPORTED_F,
+					 &peerfdr10s);
+			mad_decode_field(data2,
+					 IB_MLNX_EXT_PORT_LINK_SPEED_ENABLED_F,
+					 &peerfdr10e);
+			mad_decode_field(data2,
+					 IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F,
+					 &peerfdr10a);
+			if (peer_espeed_cap) {
+				mad_decode_field(data,
+						 IB_PORT_LINK_SPEED_EXT_SUPPORTED_F,
+						 &peerlses);
+				mad_decode_field(data,
+						 IB_PORT_LINK_SPEED_EXT_ACTIVE_F,
+						 &peerlsea);
+				mad_decode_field(data,
+						 IB_PORT_LINK_SPEED_EXT_ENABLED_F,
+						 &peerlsee);
+			}
+
+			/* Now validate peer port characteristics */
+			/* Examine Link Width */
+			width = get_link_width(lwe, lws);
+			peerwidth = get_link_width(peerlwe, peerlws);
+			validate_width(width, peerwidth, lwa);
+
+			/* Examine Link Speeds */
+			speed = get_link_speed(lse, lss);
+			peerspeed = get_link_speed(peerlse, peerlss);
+			validate_speed(speed, peerspeed, lsa);
+
+			if (espeed_cap && peer_espeed_cap) {
+				espeed = get_link_speed_ext(lsee, lses);
+				peerespeed = get_link_speed_ext(peerlsee,
+								peerlses);
+				validate_extended_speed(espeed, peerespeed,
+							lsea);
+			} else {
+				if (fdr10e & FDR10 && peerfdr10e & FDR10) {
+					if (!(fdr10a & FDR10))
+						IBWARN("Peer ports operating at active speed %d rather than FDR10", lsa);
 				}
 			}
 		}
 	}
 
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
new file mode 100644
index 0000000..076327c
--- /dev/null
+++ b/src/ibqueryerrors.c
@@ -0,0 +1,1014 @@
+/*
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2009 HNR Consulting.  All rights reserved.
+ * Copyright (c) 2010,2011 Mellanox Technologies LTD.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <time.h>
+#include <string.h>
+#include <getopt.h>
+#include <errno.h>
+#include <inttypes.h>
+
+#include <complib/cl_nodenamemap.h>
+#include <infiniband/ibnetdisc.h>
+#include <infiniband/mad.h>
+
+#include "ibdiag_common.h"
+
+struct ibmad_port *ibmad_port;
+static char *node_name_map_file = NULL;
+static nn_map_t *node_name_map = NULL;
+static char *load_cache_file = NULL;
+
+int data_counters = 0;
+int data_counters_only = 0;
+int port_config = 0;
+uint64_t port_guid = 0;
+char *port_guid_str = NULL;
+#define SUP_MAX 64
+int sup_total = 0;
+enum MAD_FIELDS suppressed_fields[SUP_MAX];
+char *dr_path = NULL;
+uint8_t node_type_to_print = 0;
+unsigned clear_errors = 0, clear_counts = 0, details = 0;
+
+#define PRINT_SWITCH 0x1
+#define PRINT_CA     0x2
+#define PRINT_ROUTER 0x4
+#define PRINT_ALL 0xFF		/* all nodes default flag */
+
+struct {
+	int nodes_checked;
+	int bad_nodes;
+	int ports_checked;
+	int bad_ports;
+	int pma_query_failures;
+} summary = { 0 };
+
+#define DEF_THRES_FILE IBDIAG_CONFIG_PATH"/error_thresholds"
+static char *threshold_file = DEF_THRES_FILE;
+
+/* define a "packet" with threshold values in it */
+uint8_t thresholds[1204] = { 0 };
+char * threshold_str = "";
+
+static void set_thres(char *name, uint32_t val)
+{
+	int f;
+	int n;
+	char tmp[256];
+	for (f = IB_PC_FIRST_F; f <= IB_PC_LAST_F; f++) {
+		if (strcmp(name, mad_field_name(f)) == 0) {
+			mad_encode_field(thresholds, f, &val);
+			snprintf(tmp, 255, "[%s = %u]", name, val);
+			threshold_str = realloc(threshold_str,
+					strlen(threshold_str)+strlen(tmp)+1);
+			if (!threshold_str) {
+				fprintf(stderr, "Failed to allocate memory: "
+					"%s\n", strerror(errno));
+				exit(1);
+			}
+			n = strlen(threshold_str);
+			strcpy(threshold_str+n, tmp);
+		}
+	}
+}
+
+static void set_thresholds(char *threshold_file)
+{
+	char buf[1024];
+	int val = 0;
+	FILE *thresf = fopen(threshold_file, "r");
+	char *p_prefix, *p_last;
+	char *name;
+	char *val_str;
+	char str[64];
+
+	if (!thresf)
+		return;
+
+	snprintf(str, 63, "Thresholds: ");
+	threshold_str = malloc(strlen(str)+1);
+	if (!threshold_str) {
+		fprintf(stderr, "Failed to allocate memory: %s\n",
+			strerror(errno));
+		exit(1);
+	}
+	strcpy(threshold_str, str);
+	while (fgets(buf, sizeof buf, thresf) != NULL) {
+		p_prefix = strtok_r(buf, "\n", &p_last);
+		if (!p_prefix)
+			continue; /* ignore blank lines */
+
+		if (*p_prefix == '#')
+			continue; /* ignore comment lines */
+
+		name = strtok_r(p_prefix, "=", &p_last);
+		val_str = strtok_r(NULL, "\n", &p_last);
+
+		val = strtoul(val_str, NULL, 0);
+		set_thres(name, val);
+	}
+
+	fclose(thresf);
+}
+
+static int exceeds_threshold(int field, unsigned val)
+{
+	uint32_t thres = 0;
+	mad_decode_field(thresholds, field, &thres);
+	return (val > thres);
+}
+
+static void print_port_config(char *node_name, ibnd_node_t * node, int portnum)
+{
+	char width[64], speed[64], state[64], physstate[64];
+	char remote_str[256];
+	char link_str[256];
+	char width_msg[256];
+	char speed_msg[256];
+	char ext_port_str[256];
+	int iwidth, ispeed, fdr10, espeed, istate, iphystate, cap_mask;
+	uint8_t *info;
+
+	ibnd_port_t *port = node->ports[portnum];
+
+	if (!port)
+		return;
+
+	iwidth = mad_get_field(port->info, 0, IB_PORT_LINK_WIDTH_ACTIVE_F);
+	ispeed = mad_get_field(port->info, 0, IB_PORT_LINK_SPEED_ACTIVE_F);
+	fdr10 = mad_get_field(port->ext_info, 0,
+			      IB_MLNX_EXT_PORT_LINK_SPEED_ACTIVE_F) & FDR10;
+
+	if (port->node->type == IB_NODE_SWITCH)
+		info = (uint8_t *)&port->node->ports[0]->info;
+	else
+		info = (uint8_t *)&port->info;
+	cap_mask = mad_get_field(info, 0, IB_PORT_CAPMASK_F);
+	if (cap_mask & CL_NTOH32(IB_PORT_CAP_HAS_EXT_SPEEDS))
+		espeed = mad_get_field(port->info, 0,
+				       IB_PORT_LINK_SPEED_EXT_ACTIVE_F);
+	else
+		espeed = 0;
+	istate = mad_get_field(port->info, 0, IB_PORT_STATE_F);
+	iphystate = mad_get_field(port->info, 0, IB_PORT_PHYS_STATE_F);
+
+	remote_str[0] = '\0';
+	link_str[0] = '\0';
+	width_msg[0] = '\0';
+	speed_msg[0] = '\0';
+
+	/* C14-24.2.1 states that a down port allows for invalid data to be
+	 * returned for all PortInfo components except PortState and
+	 * PortPhysicalState */
+	if (istate != IB_LINK_DOWN) {
+		if (!espeed) {
+			if (fdr10)
+				sprintf(speed, "10.0 Gbps (FDR10)");
+			else
+				mad_dump_val(IB_PORT_LINK_SPEED_ACTIVE_F, speed,
+					     64, &ispeed);
+		} else
+			mad_dump_val(IB_PORT_LINK_SPEED_EXT_ACTIVE_F, speed,
+			     64, &espeed);
+
+		snprintf(link_str, 256, "(%3s %18s %6s/%8s)",
+			 mad_dump_val(IB_PORT_LINK_WIDTH_ACTIVE_F, width, 64, &iwidth),
+			 speed,
+			 mad_dump_val(IB_PORT_STATE_F, state, 64, &istate),
+			 mad_dump_val(IB_PORT_PHYS_STATE_F, physstate, 64, &iphystate));
+	} else {
+		snprintf(link_str, 256, "(              %6s/%8s)",
+			 mad_dump_val(IB_PORT_STATE_F, state, 64, &istate),
+			 mad_dump_val(IB_PORT_PHYS_STATE_F, physstate, 64, &iphystate));
+	}
+
+	if (port->remoteport) {
+		char *rem_node_name = NULL;
+
+		if (port->remoteport->ext_portnum)
+			snprintf(ext_port_str, 256, "%d",
+				 port->remoteport->ext_portnum);
+		else
+			ext_port_str[0] = '\0';
+
+		get_max_msg(width_msg, speed_msg, 256, port);
+
+		rem_node_name = remap_node_name(node_name_map,
+						port->remoteport->node->guid,
+						port->remoteport->node->
+						nodedesc);
+
+		snprintf(remote_str, 256,
+			 "0x%016" PRIx64 " %6d %4d[%2s] \"%s\" (%s %s)\n",
+			 port->remoteport->guid,
+			 port->remoteport->base_lid ? port->remoteport->
+			 base_lid : port->remoteport->node->smalid,
+			 port->remoteport->portnum, ext_port_str, rem_node_name,
+			 width_msg, speed_msg);
+
+		free(rem_node_name);
+	} else
+		snprintf(remote_str, 256, "           [  ] \"\" ( )\n");
+
+	if (port->ext_portnum)
+		snprintf(ext_port_str, 256, "%d", port->ext_portnum);
+	else
+		ext_port_str[0] = '\0';
+
+	if (node->type == IB_NODE_SWITCH)
+		printf("       Link info: %6d", node->smalid);
+	else
+		printf("       Link info: %6d", port->base_lid);
+
+	printf("%4d[%2s] ==%s==>  %s",
+	       port->portnum, ext_port_str, link_str, remote_str);
+}
+
+static int suppress(enum MAD_FIELDS field)
+{
+	int i = 0;
+	for (i = 0; i < sup_total; i++)
+		if (field == suppressed_fields[i])
+			return 1;
+	return 0;
+}
+
+static void report_suppressed(void)
+{
+	int i = 0;
+	printf("## Suppressed:");
+	for (i = 0; i < sup_total; i++)
+		printf(" %s", mad_field_name(suppressed_fields[i]));
+	printf("\n");
+}
+
+static int print_summary(void)
+{
+	printf("\n## Summary: %d nodes checked, %d bad nodes found\n",
+		summary.nodes_checked, summary.bad_nodes);
+	printf("##          %d ports checked, %d ports have errors beyond threshold\n",
+		summary.ports_checked, summary.bad_ports);
+	printf("## %s\n", threshold_str);
+	if (summary.pma_query_failures)
+		printf("##          %d PMA query failures\n", summary.pma_query_failures);
+	report_suppressed();
+	return (summary.bad_ports);
+}
+
+static int query_and_dump(char *buf, size_t size, ib_portid_t * portid,
+			  ibnd_node_t * node, char *node_name, int portnum,
+			  const char *attr_name, uint16_t attr_id,
+			  int start_field, int end_field)
+{
+	uint8_t pc[1024];
+	uint32_t val = 0;
+	int i, n;
+
+	memset(pc, 0, sizeof(pc));
+
+	if (!pma_query_via(pc, portid, portnum, ibd_timeout, attr_id,
+			   ibmad_port)) {
+		IBWARN("%s query failed on %s, %s port %d", attr_name,
+		       node_name, portid2str(portid), portnum);
+		summary.pma_query_failures++;
+		return 0;
+	}
+
+	for (n = 0, i = start_field; i < end_field; i++) {
+		mad_decode_field(pc, i, (void *)&val);
+		if (val)
+			n += snprintf(buf + n, size - n, " [%s == %u]",
+				      mad_field_name(i), val);
+	}
+
+	return n;
+}
+
+
+static int print_results(ib_portid_t * portid, char *node_name,
+			 ibnd_node_t * node, uint8_t * pc, int portnum,
+			 int *header_printed, uint8_t *pce, uint16_t cap_mask)
+{
+	char buf[1024];
+	char *str = buf;
+	uint32_t val = 0;
+	int i, n;
+
+	for (n = 0, i = IB_PC_ERR_SYM_F; i <= IB_PC_VL15_DROPPED_F; i++) {
+		if (suppress(i))
+			continue;
+
+		/* this is not a counter, skip it */
+		if (i == IB_PC_COUNTER_SELECT2_F)
+			continue;
+
+		mad_decode_field(pc, i, (void *)&val);
+		if (exceeds_threshold(i, val)) {
+			n += snprintf(str + n, 1024 - n, " [%s == %u]",
+				      mad_field_name(i), val);
+
+			/* If there are PortXmitDiscards, get details (if supported) */
+			if (i == IB_PC_XMT_DISCARDS_F && details) {
+				n += query_and_dump(str + n, sizeof(buf) - n, portid,
+						    node, node_name, portnum,
+						    "PortXmitDiscardDetails",
+						    IB_GSI_PORT_XMIT_DISCARD_DETAILS,
+						    IB_PC_RCV_LOCAL_PHY_ERR_F,
+						    IB_PC_RCV_ERR_LAST_F);
+				/* If there are PortRcvErrors, get details (if supported) */
+			} else if (i == IB_PC_ERR_RCV_F && details) {
+				n += query_and_dump(str + n, sizeof(buf) - n, portid,
+						    node, node_name, portnum,
+						    "PortRcvErrorDetails",
+						    IB_GSI_PORT_RCV_ERROR_DETAILS,
+						    IB_PC_XMT_INACT_DISC_F,
+						    IB_PC_XMT_DISC_LAST_F);
+			}
+		}
+	}
+
+	if (!suppress(IB_PC_XMT_WAIT_F)) {
+		mad_decode_field(pc, IB_PC_XMT_WAIT_F, (void *)&val);
+		if (exceeds_threshold(IB_PC_XMT_WAIT_F, val))
+			n += snprintf(str + n, 1024 - n, " [%s == %u]",
+				      mad_field_name(IB_PC_XMT_WAIT_F), val);
+	}
+
+	/* if we found errors. */
+	if (n != 0) {
+		if (data_counters) {
+			uint8_t *pkt = pc;
+			int start_field = IB_PC_XMT_BYTES_F;
+			int end_field = IB_PC_RCV_PKTS_F;
+
+			if (pce) {
+				pkt = pce;
+				start_field = IB_PC_EXT_XMT_BYTES_F;
+				if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED)
+					end_field = IB_PC_EXT_RCV_MPKTS_F;
+				else
+					end_field = IB_PC_EXT_RCV_PKTS_F;
+			}
+
+			for (i = start_field; i <= end_field; i++) {
+				uint64_t val64 = 0;
+				float val = 0;
+				char *unit = "";
+				mad_decode_field(pkt, i, (void *)&val64);
+				if (val64) {
+					int data = 0;
+					if (i == IB_PC_EXT_XMT_BYTES_F ||
+					    i == IB_PC_EXT_RCV_BYTES_F ||
+					    i == IB_PC_XMT_BYTES_F ||
+					    i == IB_PC_RCV_BYTES_F)
+						data = 1;
+					unit = conv_cnt_human_readable(val64,
+								&val, data);
+					n += snprintf(str + n, 1024 - n,
+						" [%s == %" PRIu64
+						" (%5.3f%s)]",
+						mad_field_name(i), val64, val,
+						unit);
+				}
+			}
+		}
+
+		if (!*header_printed) {
+			if (node->type == IB_NODE_SWITCH)
+				printf("Errors for 0x%" PRIx64 " \"%s\"\n",
+					node->ports[0]->guid, node_name);
+			else
+				printf("Errors for \"%s\"\n", node_name);
+			*header_printed = 1;
+			summary.bad_nodes++;
+		}
+
+		if (portnum == 0xFF) {
+			if (node->type == IB_NODE_SWITCH)
+				printf("   GUID 0x%" PRIx64 " port ALL:%s\n",
+				       node->ports[0]->guid, str);
+		} else {
+			printf("   GUID 0x%" PRIx64 " port %d:%s\n",
+			       node->ports[portnum]->guid, portnum, str);
+			if (port_config)
+				print_port_config(node_name, node, portnum);
+			summary.bad_ports++;
+		}
+	}
+	return (n);
+}
+
+static int query_cap_mask(ib_portid_t * portid, char *node_name, int portnum,
+			  uint16_t * cap_mask)
+{
+	uint8_t pc[1024] = { 0 };
+	uint16_t rc_cap_mask;
+
+	/* PerfMgt ClassPortInfo is a required attribute */
+	if (!pma_query_via(pc, portid, portnum, ibd_timeout, CLASS_PORT_INFO,
+			   ibmad_port)) {
+		IBWARN("classportinfo query failed on %s, %s port %d",
+		       node_name, portid2str(portid), portnum);
+		summary.pma_query_failures++;
+		return -1;
+	}
+
+	/* ClassPortInfo should be supported as part of libibmad */
+	memcpy(&rc_cap_mask, pc + 2, sizeof(rc_cap_mask));	/* CapabilityMask */
+
+	*cap_mask = rc_cap_mask;
+	return 0;
+}
+
+static int print_data_cnts(ib_portid_t * portid, uint16_t cap_mask,
+			   char *node_name, ibnd_node_t * node, int portnum,
+			   int *header_printed)
+{
+	uint8_t pc[1024];
+	int i;
+	int start_field = IB_PC_XMT_BYTES_F;
+	int end_field = IB_PC_RCV_PKTS_F;
+
+	memset(pc, 0, 1024);
+
+	if (cap_mask & (IB_PM_EXT_WIDTH_SUPPORTED | IB_PM_EXT_WIDTH_NOIETF_SUP)) {
+		if (!pma_query_via(pc, portid, portnum, ibd_timeout,
+				   IB_GSI_PORT_COUNTERS_EXT, ibmad_port)) {
+			IBWARN("IB_GSI_PORT_COUNTERS_EXT query failed on %s, %s port %d",
+			       node_name, portid2str(portid), portnum);
+			summary.pma_query_failures++;
+			return (1);
+		}
+		start_field = IB_PC_EXT_XMT_BYTES_F;
+		if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED)
+			end_field = IB_PC_EXT_RCV_MPKTS_F;
+		else
+			end_field = IB_PC_EXT_RCV_PKTS_F;
+	} else {
+		if (!pma_query_via(pc, portid, portnum, ibd_timeout,
+				   IB_GSI_PORT_COUNTERS, ibmad_port)) {
+			IBWARN("IB_GSI_PORT_COUNTERS query failed on %s, %s port %d",
+			       node_name, portid2str(portid), portnum);
+			summary.pma_query_failures++;
+			return (1);
+		}
+		start_field = IB_PC_XMT_BYTES_F;
+		end_field = IB_PC_RCV_PKTS_F;
+	}
+
+	if (!*header_printed) {
+		printf("Data Counters for 0x%" PRIx64 " \"%s\"\n", node->guid,
+		       node_name);
+		*header_printed = 1;
+	}
+
+	if (portnum == 0xFF)
+		printf("   GUID 0x%" PRIx64 " port ALL:", node->guid);
+	else
+		printf("   GUID 0x%" PRIx64 " port %d:",
+		       node->guid, portnum);
+
+	for (i = start_field; i <= end_field; i++) {
+		uint64_t val64 = 0;
+		float val = 0;
+		char *unit = "";
+		int data = 0;
+		mad_decode_field(pc, i, (void *)&val64);
+		if (i == IB_PC_EXT_XMT_BYTES_F || i == IB_PC_EXT_RCV_BYTES_F ||
+		    i == IB_PC_XMT_BYTES_F || i == IB_PC_RCV_BYTES_F)
+			data = 1;
+		unit = conv_cnt_human_readable(val64, &val, data);
+		printf(" [%s == %" PRIu64 " (%5.3f%s)]", mad_field_name(i),
+			val64, val, unit);
+	}
+	printf("\n");
+
+	if (portnum != 0xFF && port_config)
+		print_port_config(node_name, node, portnum);
+
+	return (0);
+}
+
+static int print_errors(ib_portid_t * portid, uint16_t cap_mask,
+			char *node_name, ibnd_node_t * node, int portnum,
+			int *header_printed)
+{
+	uint8_t pc[1024];
+	uint8_t pce[1024];
+	uint8_t *pc_ext = NULL;
+
+	memset(pc, 0, 1024);
+	memset(pce, 0, 1024);
+
+	if (!pma_query_via(pc, portid, portnum, ibd_timeout,
+			   IB_GSI_PORT_COUNTERS, ibmad_port)) {
+		IBWARN("IB_GSI_PORT_COUNTERS query failed on %s, %s port %d",
+		       node_name, portid2str(portid), portnum);
+		summary.pma_query_failures++;
+		return (0);
+	}
+
+	if (cap_mask & (IB_PM_EXT_WIDTH_SUPPORTED | IB_PM_EXT_WIDTH_NOIETF_SUP)) {
+		if (!pma_query_via(pce, portid, portnum, ibd_timeout,
+		    IB_GSI_PORT_COUNTERS_EXT, ibmad_port)) {
+			IBWARN("IB_GSI_PORT_COUNTERS_EXT query failed on %s, %s port %d",
+			       node_name, portid2str(portid), portnum);
+			summary.pma_query_failures++;
+			return (0);
+		}
+		pc_ext = pce;
+	}
+
+	if (!(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)) {
+		/* if PortCounters:PortXmitWait not supported clear this counter */
+		uint32_t foo = 0;
+		mad_encode_field(pc, IB_PC_XMT_WAIT_F, &foo);
+	}
+	return (print_results(portid, node_name, node, pc, portnum,
+			      header_printed, pc_ext, cap_mask));
+}
+
+uint8_t *reset_pc_ext(void *rcvbuf, ib_portid_t * dest,
+		      int port, unsigned mask, unsigned timeout,
+		      const struct ibmad_port * srcport)
+{
+	ib_rpc_t rpc = { 0 };
+	int lid = dest->lid;
+
+	DEBUG("lid %u port %d mask 0x%x", lid, port, mask);
+
+	if (lid == -1) {
+		IBWARN("only lid routed is supported");
+		return NULL;
+	}
+
+	if (!mask)
+		mask = ~0;
+
+	rpc.mgtclass = IB_PERFORMANCE_CLASS;
+	rpc.method = IB_MAD_METHOD_SET;
+	rpc.attr.id = IB_GSI_PORT_COUNTERS_EXT;
+
+	memset(rcvbuf, 0, IB_MAD_SIZE);
+
+	/* Same for attribute IDs */
+	mad_set_field(rcvbuf, 0, IB_PC_EXT_PORT_SELECT_F, port);
+	mad_set_field(rcvbuf, 0, IB_PC_EXT_COUNTER_SELECT_F, mask);
+	rpc.attr.mod = 0;
+	rpc.timeout = timeout;
+	rpc.datasz = IB_PC_DATA_SZ;
+	rpc.dataoffs = IB_PC_DATA_OFFS;
+	if (!dest->qp)
+		dest->qp = 1;
+	if (!dest->qkey)
+		dest->qkey = IB_DEFAULT_QP1_QKEY;
+
+	return mad_rpc(srcport, &rpc, dest, rcvbuf, rcvbuf);
+}
+
+static void clear_port(ib_portid_t * portid, uint16_t cap_mask,
+		       char *node_name, int port)
+{
+	uint8_t pc[1024] = { 0 };
+	/* bits defined in Table 228 PortCounters CounterSelect and
+	 * CounterSelect2
+	 */
+	uint32_t mask = 0;
+
+	if (clear_errors) {
+		mask |= 0xFFF;
+		if (cap_mask & IB_PM_PC_XMIT_WAIT_SUP)
+			mask |= 0x10000;
+	}
+	if (clear_counts)
+		mask |= 0xF000;
+
+	if (mask)
+		if (!performance_reset_via(pc, portid, port, mask, ibd_timeout,
+					   IB_GSI_PORT_COUNTERS, ibmad_port))
+			fprintf(stderr, "Failed to reset errors %s port %d\n", node_name,
+				port);
+
+	if (clear_errors && details) {
+		memset(pc, 0, 1024);
+		performance_reset_via(pc, portid, port, 0xf, ibd_timeout,
+				      IB_GSI_PORT_XMIT_DISCARD_DETAILS,
+				      ibmad_port);
+		memset(pc, 0, 1024);
+		performance_reset_via(pc, portid, port, 0x3f, ibd_timeout,
+				      IB_GSI_PORT_RCV_ERROR_DETAILS,
+				      ibmad_port);
+	}
+
+	if (clear_counts &&
+	    (cap_mask &
+	     (IB_PM_EXT_WIDTH_SUPPORTED | IB_PM_EXT_WIDTH_NOIETF_SUP))) {
+		if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED)
+			mask = 0xFF;
+		else
+			mask = 0x0F;
+
+		if (!reset_pc_ext(pc, portid, port, mask, ibd_timeout,
+		    ibmad_port))
+			fprintf(stderr, "Failed to reset extended data counters %s, "
+				"%s port %d\n", node_name, portid2str(portid),
+				port);
+	}
+}
+
+void print_node(ibnd_node_t * node, void *user_data)
+{
+	int header_printed = 0;
+	int p = 0;
+	int startport = 1;
+	int type = 0;
+	int all_port_sup = 0;
+	ib_portid_t portid = { 0 };
+	uint16_t cap_mask = 0;
+	char *node_name = NULL;
+
+	switch (node->type) {
+	case IB_NODE_SWITCH:
+		type = PRINT_SWITCH;
+		break;
+	case IB_NODE_CA:
+		type = PRINT_CA;
+		break;
+	case IB_NODE_ROUTER:
+		type = PRINT_ROUTER;
+		break;
+	}
+
+	if ((type & node_type_to_print) == 0)
+		return;
+
+	if (node->type == IB_NODE_SWITCH && node->smaenhsp0)
+		startport = 0;
+
+	node_name = remap_node_name(node_name_map, node->guid, node->nodedesc);
+
+	if (node->type == IB_NODE_SWITCH) {
+		ib_portid_set(&portid, node->smalid, 0, 0);
+		p = 0;
+	} else {
+		for (p = 1; p <= node->numports; p++) {
+			if (node->ports[p]) {
+				ib_portid_set(&portid,
+					      node->ports[p]->base_lid,
+					      0, 0);
+				break;
+			}
+		}
+	}
+
+	if ((query_cap_mask(&portid, node_name, p, &cap_mask) == 0) &&
+	    (cap_mask & IB_PM_ALL_PORT_SELECT))
+		all_port_sup = 1;
+
+	if (data_counters_only) {
+		for (p = startport; p <= node->numports; p++) {
+			if (node->ports[p]) {
+				if (node->type == IB_NODE_SWITCH)
+					ib_portid_set(&portid, node->smalid, 0, 0);
+				else
+					ib_portid_set(&portid, node->ports[p]->base_lid,
+						      0, 0);
+
+				print_data_cnts(&portid, cap_mask, node_name, node, p,
+						&header_printed);
+				summary.ports_checked++;
+				if (!all_port_sup)
+					clear_port(&portid, cap_mask, node_name, p);
+			}
+		}
+	} else {
+		if (all_port_sup)
+			if (!print_errors(&portid, cap_mask, node_name, node,
+					  0xFF, &header_printed)) {
+				summary.ports_checked += node->numports;
+				goto clear;
+			}
+
+		for (p = startport; p <= node->numports; p++) {
+			if (node->ports[p]) {
+				if (node->type == IB_NODE_SWITCH)
+					ib_portid_set(&portid, node->smalid, 0, 0);
+				else
+					ib_portid_set(&portid, node->ports[p]->base_lid,
+						      0, 0);
+
+				print_errors(&portid, cap_mask, node_name, node, p,
+					     &header_printed);
+				summary.ports_checked++;
+				if (!all_port_sup)
+					clear_port(&portid, cap_mask, node_name, p);
+			}
+		}
+	}
+
+clear:
+	summary.nodes_checked++;
+	if (all_port_sup)
+		clear_port(&portid, cap_mask, node_name, 0xFF);
+
+	free(node_name);
+}
+
+static void add_suppressed(enum MAD_FIELDS field)
+{
+	if (sup_total >= SUP_MAX) {
+		IBWARN("Maximum (%d) fields have been suppressed; skipping %s",
+		       sup_total, mad_field_name(field));
+		return;
+	}
+	suppressed_fields[sup_total++] = field;
+}
+
+static void calculate_suppressed_fields(char *str)
+{
+	enum MAD_FIELDS f;
+	char *val, *lasts = NULL;
+	char *tmp = strdup(str);
+
+	val = strtok_r(tmp, ",", &lasts);
+	while (val) {
+		for (f = IB_PC_FIRST_F; f <= IB_PC_LAST_F; f++)
+			if (strcmp(val, mad_field_name(f)) == 0)
+				add_suppressed(f);
+		val = strtok_r(NULL, ",", &lasts);
+	}
+
+	free(tmp);
+}
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	struct ibnd_config *cfg = context;
+	switch (ch) {
+	case 's':
+		calculate_suppressed_fields(optarg);
+		break;
+	case 'c':
+		/* Right now this is the only "common" error */
+		add_suppressed(IB_PC_ERR_SWITCH_REL_F);
+		break;
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
+	case 2:
+		data_counters++;
+		break;
+	case 3:
+		node_type_to_print |= PRINT_SWITCH;
+		break;
+	case 4:
+		node_type_to_print |= PRINT_CA;
+		break;
+	case 5:
+		node_type_to_print |= PRINT_ROUTER;
+		break;
+	case 6:
+		details = 1;
+		break;
+	case 7:
+		load_cache_file = strdup(optarg);
+		break;
+	case 8:
+		threshold_file = strdup(optarg);
+		break;
+	case 9:
+		data_counters_only = 1;
+		break;
+	case 'G':
+	case 'S':
+		port_guid_str = optarg;
+		port_guid = strtoull(optarg, 0, 0);
+		break;
+	case 'D':
+		dr_path = strdup(optarg);
+		break;
+	case 'r':
+		port_config++;
+		break;
+	case 'R':		/* nop */
+		break;
+	case 'k':
+		clear_errors = 1;
+		break;
+	case 'K':
+		clear_counts = 1;
+		break;
+	case 'o':
+		cfg->max_smps = strtoul(optarg, NULL, 0);
+		break;
+	default:
+		return -1;
+	}
+
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	struct ibnd_config config = { 0 };
+	int resolved = -1;
+	ib_portid_t portid = { 0 };
+	int rc = 0;
+	ibnd_fabric_t *fabric = NULL;
+
+	int mgmt_classes[4] = { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS,
+		IB_PERFORMANCE_CLASS
+	};
+
+	const struct ibdiag_opt opts[] = {
+		{"suppress", 's', 1, "<err1,err2,...>",
+		 "suppress errors listed"},
+		{"suppress-common", 'c', 0, NULL,
+		 "suppress some of the common counters"},
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
+		{"port-guid", 'G', 1, "<port_guid>",
+		 "report the node containing the port specified by <port_guid>"},
+		{"", 'S', 1, "<port_guid>",
+		 "Same as \"-G\" for backward compatibility"},
+		{"Direct", 'D', 1, "<dr_path>",
+		 "report the node containing the port specified by <dr_path>"},
+		{"report-port", 'r', 0, NULL,
+		 "report port link information"},
+		{"threshold-file", 8, 1, NULL,
+		 "specify an alternate threshold file, default: " DEF_THRES_FILE},
+		{"GNDN", 'R', 0, NULL,
+		 "(This option is obsolete and does nothing)"},
+		{"data", 2, 0, NULL, "include data counters for ports with errors"},
+		{"switch", 3, 0, NULL, "print data for switches only"},
+		{"ca", 4, 0, NULL, "print data for CA's only"},
+		{"router", 5, 0, NULL, "print data for routers only"},
+		{"details", 6, 0, NULL, "include transmit discard details"},
+		{"counters", 9, 0, NULL, "print data counters only"},
+		{"clear-errors", 'k', 0, NULL,
+		 "Clear error counters after read"},
+		{"clear-counts", 'K', 0, NULL,
+		 "Clear data counters after read"},
+		{"load-cache", 7, 1, "<file>",
+		 "filename of ibnetdiscover cache to load"},
+		{"outstanding_smps", 'o', 1, NULL,
+		 "specify the number of outstanding SMP's which should be "
+		 "issued during the scan"},
+		{0}
+	};
+	char usage_args[] = "";
+
+	memset(suppressed_fields, 0, sizeof suppressed_fields);
+	ibdiag_process_opts(argc, argv, &config, "cDGKLnRrSs", opts, process_opt,
+			    usage_args, NULL);
+
+	argc -= optind;
+	argv += optind;
+
+	if (!node_type_to_print)
+		node_type_to_print = PRINT_ALL;
+
+	ibmad_port = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 4);
+	if (!ibmad_port)
+		IBERROR("Failed to open port; %s:%d\n", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(ibmad_port, ibd_mkey);
+
+	if (ibd_timeout) {
+		mad_rpc_set_timeout(ibmad_port, ibd_timeout);
+		config.timeout_ms = ibd_timeout;
+	}
+
+	config.flags = ibd_ibnetdisc_flags;
+	config.mkey = ibd_mkey;
+
+	node_name_map = open_node_name_map(node_name_map_file);
+
+	if (dr_path && load_cache_file) {
+		fprintf(stderr, "Cannot specify cache and direct route path\n");
+		exit(-1);
+	}
+
+	/* limit the scan the fabric around the target */
+	if (dr_path) {
+		if ((resolved =
+		     resolve_portid_str(ibd_ca, ibd_ca_port, &portid, dr_path,
+					IB_DEST_DRPATH, NULL, ibmad_port)) < 0)
+			IBWARN("Failed to resolve %s; attempting full scan",
+			       dr_path);
+	} else if (port_guid_str) {
+		if ((resolved =
+		     resolve_portid_str(ibd_ca, ibd_ca_port, &portid,
+					port_guid_str, IB_DEST_GUID, ibd_sm_id,
+					       ibmad_port)) < 0)
+			IBWARN("Failed to resolve %s; attempting full scan",
+			       port_guid_str);
+	}
+
+	if (load_cache_file) {
+		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL) {
+			fprintf(stderr, "loading cached fabric failed\n");
+			exit(-1);
+		}
+	} else {
+		if (resolved >= 0) {
+			if (!config.max_hops)
+				config.max_hops = 1;
+			if (!(fabric = ibnd_discover_fabric(ibd_ca, ibd_ca_port,
+						    &portid, &config)))
+				IBWARN("Single node discover failed;"
+				       " attempting full scan");
+		}
+
+		if (!fabric && !(fabric = ibnd_discover_fabric(ibd_ca,
+							       ibd_ca_port,
+							       NULL,
+							       &config))) {
+			fprintf(stderr, "discover failed\n");
+			rc = -1;
+			goto close_port;
+		}
+	}
+
+	set_thresholds(threshold_file);
+
+	if (port_guid_str) {
+		ibnd_port_t *port = ibnd_find_port_guid(fabric, port_guid);
+		if (port)
+			print_node(port->node, NULL);
+		else
+			fprintf(stderr, "Failed to find node: %s\n",
+				port_guid_str);
+	} else if (dr_path) {
+		ibnd_port_t *port = ibnd_find_port_dr(fabric, dr_path);
+		uint8_t ni[IB_SMP_DATA_SIZE] = { 0 };
+
+		if (!smp_query_via(ni, &portid, IB_ATTR_NODE_INFO, 0,
+				   ibd_timeout, ibmad_port)) {
+			rc = -1;
+			goto destroy_fabric;
+		}
+		mad_decode_field(ni, IB_NODE_PORT_GUID_F, &(port_guid));
+
+		port = ibnd_find_port_guid(fabric, port_guid);
+		if (port) {
+			print_node(port->node, NULL);
+		} else
+			fprintf(stderr, "Failed to find node: %s\n", dr_path);
+	} else
+		ibnd_iter_nodes(fabric, print_node, NULL);
+
+	rc = print_summary();
+	if (rc)
+		rc = 1;
+
+destroy_fabric:
+	ibnd_destroy_fabric(fabric);
+
+close_port:
+	mad_rpc_close_port(ibmad_port);
+	close_node_name_map(node_name_map);
+	exit(rc);
+}
diff --git a/src/ibroute.c b/src/ibroute.c
index f2ee170..06549f5 100644
--- a/src/ibroute.c
+++ b/src/ibroute.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2009-2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,49 +34,41 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
-#include <time.h>
 #include <string.h>
 #include <inttypes.h>
 #include <getopt.h>
 #include <netinet/in.h>
-#include <ctype.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <complib/cl_nodenamemap.h>
 
 #include "ibdiag_common.h"
 
-static int dest_type = IB_DEST_LID;
-static int brief;
-static int verbose;
-static int dump_all;
+struct ibmad_port *srcport;
 
-char *argv0 = "ibroute";
+static int brief, dump_all, multicast;
 
 /*******************************************/
 
-char *
-check_switch(ib_portid_t *portid, int *nports, uint64_t *guid,
-	     uint8_t *sw, char *nd)
+char *check_switch(ib_portid_t * portid, unsigned int *nports, uint64_t * guid,
+		   uint8_t * sw, char *nd)
 {
-	uint8_t ni[IB_SMP_DATA_SIZE] = {0};
+	uint8_t ni[IB_SMP_DATA_SIZE] = { 0 };
 	int type;
 
 	DEBUG("checking node type");
-	if (!smp_query(ni, portid, IB_ATTR_NODE_INFO, 0, 0)) {
+	if (!smp_query_via(ni, portid, IB_ATTR_NODE_INFO, 0, 0, srcport)) {
 		xdump(stderr, "nodeinfo\n", ni, sizeof ni);
 		return "node info failed: valid addr?";
 	}
 
-	if (!smp_query(nd, portid, IB_ATTR_NODE_DESC, 0, 0))
+	if (!smp_query_via(nd, portid, IB_ATTR_NODE_DESC, 0, 0, srcport))
 		return "node desc failed";
 
 	mad_decode_field(ni, IB_NODE_TYPE_F, &type);
@@ -86,7 +79,7 @@ check_switch(ib_portid_t *portid, int *nports, uint64_t *guid,
 	mad_decode_field(ni, IB_NODE_NPORTS_F, nports);
 	mad_decode_field(ni, IB_NODE_GUID_F, guid);
 
-	if (!smp_query(sw, portid, IB_ATTR_SWITCH_INFO, 0, 0))
+	if (!smp_query_via(sw, portid, IB_ATTR_SWITCH_INFO, 0, 0, srcport))
 		return "switch info failed: is a switch node?";
 
 	return 0;
@@ -94,18 +87,17 @@ check_switch(ib_portid_t *portid, int *nports, uint64_t *guid,
 
 #define IB_MLIDS_IN_BLOCK	(IB_SMP_DATA_SIZE/2)
 
-int
-dump_mlid(char *str, int strlen, int mlid, int nports,
-	  uint16_t mft[16][IB_MLIDS_IN_BLOCK])
+int dump_mlid(char *str, int strlen, unsigned mlid, unsigned nports,
+	      uint16_t mft[16][IB_MLIDS_IN_BLOCK])
 {
 	uint16_t mask;
-	int i, chunk, bit;
-	int nonzero = 0;
+	unsigned i, chunk, bit, nonzero = 0;
 
 	if (brief) {
-		int n = 0, chunks = ALIGN(nports + 1, 16) / 16;
+		int n = 0;
+		unsigned chunks = ALIGN(nports + 1, 16) / 16;
 		for (i = 0; i < chunks; i++) {
-			mask = ntohs(mft[i][mlid%IB_MLIDS_IN_BLOCK]);
+			mask = ntohs(mft[i][mlid % IB_MLIDS_IN_BLOCK]);
 			if (mask)
 				nonzero++;
 			n += snprintf(str + n, strlen - n, "%04hx", mask);
@@ -124,76 +116,87 @@ dump_mlid(char *str, int strlen, int mlid, int nports,
 		chunk = i / 16;
 		bit = i % 16;
 
-		mask = ntohs(mft[chunk][mlid%IB_MLIDS_IN_BLOCK]);
+		mask = ntohs(mft[chunk][mlid % IB_MLIDS_IN_BLOCK]);
 		if (mask)
 			nonzero++;
-		str[i*2] = (mask & (1 << bit)) ? 'x' : ' ';
-		str[i*2+1] = ' ';
+		str[i * 2] = (mask & (1 << bit)) ? 'x' : ' ';
+		str[i * 2 + 1] = ' ';
 	}
 	if (!nonzero && !dump_all) {
 		str[0] = 0;
 		return 0;
 	}
-	str[i*2] = 0;
+	str[i * 2] = 0;
 	return i * 2;
 }
 
-uint16_t mft[16][IB_MLIDS_IN_BLOCK];
+uint16_t mft[16][IB_MLIDS_IN_BLOCK] = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0}, { 0 }, { 0 } };
 
-char *
-dump_multicast_tables(ib_portid_t *portid, int startlid, int endlid)
+char *dump_multicast_tables(ib_portid_t * portid, unsigned startlid,
+			    unsigned endlid)
 {
-	char nd[IB_SMP_DATA_SIZE] = {0};
-	uint8_t sw[IB_SMP_DATA_SIZE] = {0};
+	char nd[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t sw[IB_SMP_DATA_SIZE] = { 0 };
 	char str[512];
 	char *s;
 	uint64_t nodeguid;
 	uint32_t mod;
-	int block, i, j, e, nports, cap, chunks;
-	int n = 0, startblock, lastblock;
+	unsigned block, i, j, e, nports, cap, chunks, startblock, lastblock,
+	    top;
+	int n = 0;
 
 	if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
 		return s;
 
 	mad_decode_field(sw, IB_SW_MCAST_FDB_CAP_F, &cap);
+	mad_decode_field(sw, IB_SW_MCAST_FDB_TOP_F, &top);
 
 	if (!endlid || endlid > IB_MIN_MCAST_LID + cap - 1)
 		endlid = IB_MIN_MCAST_LID + cap - 1;
+	if (!dump_all && top && top < endlid) {
+		if (top < IB_MIN_MCAST_LID - 1)
+			IBWARN("illegal top mlid %x", top);
+		else
+			endlid = top;
+	}
 
 	if (!startlid)
 		startlid = IB_MIN_MCAST_LID;
-
-	if (startlid < IB_MIN_MCAST_LID) {
-		IBWARN("illegal start mlid %x, set to %x", startlid, IB_MIN_MCAST_LID);
+	else if (startlid < IB_MIN_MCAST_LID) {
+		IBWARN("illegal start mlid %x, set to %x", startlid,
+		       IB_MIN_MCAST_LID);
 		startlid = IB_MIN_MCAST_LID;
 	}
 
 	if (endlid > IB_MAX_MCAST_LID) {
-		IBWARN("illegal end mlid %x, truncate to %x", endlid, IB_MAX_MCAST_LID);
+		IBWARN("illegal end mlid %x, truncate to %x", endlid,
+		       IB_MAX_MCAST_LID);
 		endlid = IB_MAX_MCAST_LID;
 	}
 
-	printf("Multicast mlids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64 " (%s):\n",
-		startlid, endlid, portid2str(portid), nodeguid, clean_nodedesc(nd));
+	printf("Multicast mlids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64
+	       " (%s):\n", startlid, endlid, portid2str(portid), nodeguid,
+	       clean_nodedesc(nd));
 
 	if (brief)
 		printf(" MLid       Port Mask\n");
 	else {
 		if (nports > 9) {
 			for (i = 0, s = str; i <= nports; i++) {
-				*s++ = (i%10) ? ' ' : '0' + i/10;
+				*s++ = (i % 10) ? ' ' : '0' + i / 10;
 				*s++ = ' ';
 			}
 			*s = 0;
 			printf("            %s\n", str);
 		}
 		for (i = 0, s = str; i <= nports; i++)
-			s += sprintf(s, "%d ", i%10);
+			s += sprintf(s, "%d ", i % 10);
 		printf("     Ports: %s\n", str);
 		printf(" MLid\n");
 	}
-	if (verbose)
-		printf("Switch muticast mlids capability is 0x%d\n", cap);
+	if (ibverbose)
+		printf("Switch multicast mlid capability is %d top is 0x%x\n",
+		       cap, top);
 
 	chunks = ALIGN(nports + 1, 16) / 16;
 
@@ -201,10 +204,14 @@ dump_multicast_tables(ib_portid_t *portid, int startlid, int endlid)
 	lastblock = endlid / IB_MLIDS_IN_BLOCK;
 	for (block = startblock; block <= lastblock; block++) {
 		for (j = 0; j < chunks; j++) {
-			mod = (block - IB_MIN_MCAST_LID/IB_MLIDS_IN_BLOCK) | (j << 28);
-
-			DEBUG("reading block %x chunk %d mod %x", block, j, mod);
-			if (!smp_query(mft + j, portid, IB_ATTR_MULTICASTFORWTBL, mod, 0))
+			mod = (block - IB_MIN_MCAST_LID / IB_MLIDS_IN_BLOCK)
+			    | (j << 28);
+
+			DEBUG("reading block %x chunk %d mod %x", block, j,
+			      mod);
+			if (!smp_query_via
+			    (mft + j, portid, IB_ATTR_MULTICASTFORWTBL, mod, 0,
+			     srcport))
 				return "multicast forwarding table get failed";
 		}
 
@@ -227,13 +234,12 @@ dump_multicast_tables(ib_portid_t *portid, int startlid, int endlid)
 	return 0;
 }
 
-int
-dump_lid(char *str, int strlen, int lid, int valid)
+int dump_lid(char *str, int strlen, int lid, int valid)
 {
-	char nd[IB_SMP_DATA_SIZE] = {0};
-	uint8_t ni[IB_SMP_DATA_SIZE] = {0};
-	uint8_t pi[IB_SMP_DATA_SIZE] = {0};
-	ib_portid_t lidport = {0};
+	char nd[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t ni[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t pi[IB_SMP_DATA_SIZE] = { 0 };
+	ib_portid_t lidport = { 0 };
 	static int last_port_lid, base_port_lid;
 	char ntype[50], sguid[30], desc[64];
 	static uint64_t portguid;
@@ -246,7 +252,8 @@ dump_lid(char *str, int strlen, int lid, int valid)
 
 	if (lid <= last_port_lid) {
 		if (!valid)
-			return snprintf(str, strlen, ": (path #%d - illegal port)",
+			return snprintf(str, strlen,
+					": (path #%d - illegal port)",
 					lid - base_port_lid);
 		else if (!portguid)
 			return snprintf(str, strlen,
@@ -258,7 +265,8 @@ dump_lid(char *str, int strlen, int lid, int valid)
 					": (path #%d out of %d: portguid %s)",
 					lid - base_port_lid + 1,
 					last_port_lid - base_port_lid + 1,
-					mad_dump_val(IB_NODE_PORT_GUID_F, sguid, sizeof sguid, &portguid));
+					mad_dump_val(IB_NODE_PORT_GUID_F, sguid,
+						     sizeof sguid, &portguid));
 		}
 	}
 
@@ -268,9 +276,9 @@ dump_lid(char *str, int strlen, int lid, int valid)
 	portguid = 0;
 	lidport.lid = lid;
 
-	if (!smp_query(nd, &lidport, IB_ATTR_NODE_DESC, 0, 100) ||
-	    !smp_query(pi, &lidport, IB_ATTR_PORT_INFO, 0, 100) ||
-	    !smp_query(ni, &lidport, IB_ATTR_NODE_INFO, 0, 100))
+	if (!smp_query_via(nd, &lidport, IB_ATTR_NODE_DESC, 0, 100, srcport) ||
+	    !smp_query_via(pi, &lidport, IB_ATTR_PORT_INFO, 0, 100, srcport) ||
+	    !smp_query_via(ni, &lidport, IB_ATTR_NODE_INFO, 0, 100, srcport))
 		return snprintf(str, strlen, ": (unknown node and type)");
 
 	mad_decode_field(ni, IB_NODE_PORT_GUID_F, &portguid);
@@ -285,20 +293,23 @@ dump_lid(char *str, int strlen, int lid, int valid)
 	}
 
 	return snprintf(str, strlen, ": (%s portguid %s: %s)",
-		mad_dump_val(IB_NODE_TYPE_F, ntype, sizeof ntype, &type),
-		mad_dump_val(IB_NODE_PORT_GUID_F, sguid, sizeof sguid, &portguid),
-		mad_dump_val(IB_NODE_DESC_F, desc, sizeof desc, clean_nodedesc(nd)));
+			mad_dump_val(IB_NODE_TYPE_F, ntype, sizeof ntype,
+				     &type), mad_dump_val(IB_NODE_PORT_GUID_F,
+							  sguid, sizeof sguid,
+							  &portguid),
+			mad_dump_val(IB_NODE_DESC_F, desc, sizeof desc,
+				     clean_nodedesc(nd)));
 }
 
-char *
-dump_unicast_tables(ib_portid_t *portid, int startlid, int endlid)
+char *dump_unicast_tables(ib_portid_t * portid, int startlid, int endlid)
 {
-	char lft[IB_SMP_DATA_SIZE];
-	char nd[IB_SMP_DATA_SIZE];
-	uint8_t sw[IB_SMP_DATA_SIZE];
+	char lft[IB_SMP_DATA_SIZE] = { 0 };
+	char nd[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t sw[IB_SMP_DATA_SIZE] = { 0 };
 	char str[200], *s;
 	uint64_t nodeguid;
-	int block, i, e, nports, top;
+	int block, i, e, top;
+	unsigned nports;
 	int n = 0, startblock, endblock;
 
 	if ((s = check_switch(portid, &nports, &nodeguid, sw, nd)))
@@ -310,12 +321,14 @@ dump_unicast_tables(ib_portid_t *portid, int startlid, int endlid)
 		endlid = top;
 
 	if (endlid > IB_MAX_UCAST_LID) {
-		IBWARN("ilegal lft top %d, truncate to %d", endlid, IB_MAX_UCAST_LID);
+		IBWARN("illegal lft top %d, truncate to %d", endlid,
+		       IB_MAX_UCAST_LID);
 		endlid = IB_MAX_UCAST_LID;
 	}
 
-	printf("Unicast lids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64 " (%s):\n",
-		startlid, endlid, portid2str(portid), nodeguid, clean_nodedesc(nd));
+	printf("Unicast lids [0x%x-0x%x] of switch %s guid 0x%016" PRIx64
+	       " (%s):\n", startlid, endlid, portid2str(portid), nodeguid,
+	       clean_nodedesc(nd));
 
 	DEBUG("Switch top is 0x%x\n", top);
 
@@ -325,7 +338,8 @@ dump_unicast_tables(ib_portid_t *portid, int startlid, int endlid)
 	endblock = ALIGN(endlid, IB_SMP_DATA_SIZE) / IB_SMP_DATA_SIZE;
 	for (block = startblock; block <= endblock; block++) {
 		DEBUG("reading block %d", block);
-		if (!smp_query(lft, portid, IB_ATTR_LINEARFORWTBL, block, 0))
+		if (!smp_query_via(lft, portid, IB_ATTR_LINEARFORWTBL, block,
+				   0, srcport))
 			return "linear forwarding table get failed";
 		i = block * IB_SMP_DATA_SIZE;
 		e = i + IB_SMP_DATA_SIZE;
@@ -334,7 +348,7 @@ dump_unicast_tables(ib_portid_t *portid, int startlid, int endlid)
 		if (e > endlid + 1)
 			e = endlid + 1;
 
-		for (;i < e; i++) {
+		for (; i < e; i++) {
 			unsigned outport = lft[i % IB_SMP_DATA_SIZE];
 			unsigned valid = (outport <= nports);
 
@@ -350,138 +364,79 @@ dump_unicast_tables(ib_portid_t *portid, int startlid, int endlid)
 	return 0;
 }
 
-void
-usage(void)
+static int process_opt(void *context, int ch, char *optarg)
 {
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug)] -a(ll) -n(o_dests) -v(erbose) -D(irect) -G(uid) -M(ulticast) -s smlid -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms] [<dest dr_path|lid|guid> [<startlid> [<endlid>]]]\n",
-			basename);
-	fprintf(stderr, "\n\tUnicast examples:\n");
-	fprintf(stderr, "\t\t%s 4\t# dump all lids with valid out ports of switch with lid 4\n", basename);
-	fprintf(stderr, "\t\t%s -a 4\t# same, but dump all lids, even with invalid out ports\n", basename);
-	fprintf(stderr, "\t\t%s -n 4\t# simple dump format - no destination resolving\n", basename);
-	fprintf(stderr, "\t\t%s 4 10\t# dump lids starting from 10\n", basename);
-	fprintf(stderr, "\t\t%s 4 0x10 0x20\t# dump lid range\n", basename);
-	fprintf(stderr, "\t\t%s -G 0x08f1040023\t# resolve switch by GUID\n", basename);
-	fprintf(stderr, "\t\t%s -D 0,1\t# resolve switch by direct path\n", basename);
-
-	fprintf(stderr, "\n\tMulticast examples:\n");
-	fprintf(stderr, "\t\t%s -M 4\t# dump all non empty mlids of switch with lid 4\n", basename);
-	fprintf(stderr, "\t\t%s -M 4 0xc010 0xc020\t# same, but with range\n", basename);
-	fprintf(stderr, "\t\t%s -M -n 4\t# simple dump format\n", basename);
-	exit(-1);
+	switch (ch) {
+	case 'a':
+		dump_all++;
+		break;
+	case 'M':
+		multicast++;
+		break;
+	case 'n':
+		brief++;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
-	ib_portid_t portid = {0};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	int timeout;
-	int multicast = 0, startlid = 0, endlid = 0;
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
+	ib_portid_t portid = { 0 };
+	unsigned startlid = 0, endlid = 0;
 	char *err;
-	char *ca = 0;
-	int ca_port = 0;
-
-	static char const str_opts[] = "C:P:t:s:danvDGMVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "all", 0, 0, 'a'},
-		{ "no_dests", 0, 0, 'n'},
-		{ "verbose", 0, 0, 'v'},
-		{ "Direct", 0, 0, 'D'},
-		{ "Guid", 0, 0, 'G'},
-		{ "Multicast", 0, 0, 'M'},
-		{ "timeout", 1, 0, 't'},
-		{ "s", 1, 0, 's'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+
+	const struct ibdiag_opt opts[] = {
+		{"all", 'a', 0, NULL, "show all lids, even invalid entries"},
+		{"no_dests", 'n', 0, NULL,
+		 "do not try to resolve destinations"},
+		{"Multicast", 'M', 0, NULL, "show multicast forwarding tables"},
+		{0}
+	};
+	char usage_args[] = "[<dest dr_path|lid|guid> [<startlid> [<endlid>]]]";
+	const char *usage_examples[] = {
+		" -- Unicast examples:",
+		"4\t# dump all lids with valid out ports of switch with lid 4",
+		"-a 4\t# same, but dump all lids, even with invalid out ports",
+		"-n 4\t# simple dump format - no destination resolving",
+		"4 10\t# dump lids starting from 10",
+		"4 0x10 0x20\t# dump lid range",
+		"-G 0x08f1040023\t# resolve switch by GUID",
+		"-D 0,1\t# resolve switch by direct path",
+		" -- Multicast examples:",
+		"-M 4\t# dump all non empty mlids of switch with lid 4",
+		"-M 4 0xc010 0xc020\t# same, but with range",
+		"-M -n 4\t# simple dump format",
+		NULL,
 	};
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'a':
-			dump_all++;
-			break;
-		case 'd':
-			ibdebug++;
-			break;
-		case 'D':
-			dest_type = IB_DEST_DRPATH;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'M':
-			multicast++;
-			break;
-		case 'n':
-			brief++;
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'v':
-			madrpc_show_errors(1);
-			verbose++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
+	ibdiag_process_opts(argc, argv, NULL, "K", opts, process_opt,
+			    usage_args, usage_examples);
+
 	argc -= optind;
 	argv += optind;
 
 	if (!argc)
-		usage();
+		ibdiag_show_usage();
 
 	if (argc > 1)
 		startlid = strtoul(argv[1], 0, 0);
 	if (argc > 2)
 		endlid = strtoul(argv[2], 0, 0);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
-	if (!argc) {
-		if (ib_resolve_self(&portid, 0, 0) < 0)
-			IBERROR("can't resolve self addr");
-	} else {
-		if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
-			IBERROR("can't resolve destination port %s", argv[1]);
-	}
+	smp_mkey_set(srcport, ibd_mkey);
+
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
+		IBERROR("can't resolve destination port %s", argv[1]);
 
 	if (multicast)
 		err = dump_multicast_tables(&portid, startlid, endlid);
@@ -491,5 +446,6 @@ main(int argc, char **argv)
 	if (err)
 		IBERROR("dump tables: %s", err);
 
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index 66620de..39b75c2 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -1,5 +1,8 @@
 /*
  * Copyright (c) 2008 Lawrence Livermore National Security
+ * Copyright (c) 2008-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2009 HNR Consulting.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * Produced at Lawrence Livermore National Laboratory.
  * Written by Ira Weiny <weiny2 at llnl.gov>.
@@ -43,13 +46,83 @@
 #include <getopt.h>
 
 #include <infiniband/mad.h>
-#include <infiniband/iba/ib_types.h>
+#include <iba/ib_types.h>
 
 #include "ibdiag_common.h"
 
-char *argv0 = "";
+struct ibmad_port *srcport;
+/* for local link integrity */
+int error_port = 1;
 
-static int send_144_node_desc_update(void)
+static uint16_t get_node_type(ib_portid_t * port)
+{
+	uint16_t node_type = IB_NODE_TYPE_CA;
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
+
+	if (smp_query_via(data, port, IB_ATTR_NODE_INFO, 0, 0, srcport))
+		node_type = (uint16_t) mad_get_field(data, 0, IB_NODE_TYPE_F);
+	return node_type;
+}
+
+static uint32_t get_cap_mask(ib_portid_t * port)
+{
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
+	uint32_t cap_mask = 0;
+
+	if (smp_query_via(data, port, IB_ATTR_PORT_INFO, 0, 0, srcport))
+		cap_mask = (uint32_t) mad_get_field(data, 0, IB_PORT_CAPMASK_F);
+	return cap_mask;
+}
+
+static void build_trap145(ib_mad_notice_attr_t * n, ib_portid_t * port)
+{
+	n->generic_type = 0x80 | IB_NOTICE_TYPE_INFO;
+	n->g_or_v.generic.prod_type_lsb = cl_hton16(get_node_type(port));
+	n->g_or_v.generic.trap_num = cl_hton16(145);
+	n->issuer_lid = cl_hton16((uint16_t) port->lid);
+	n->data_details.ntc_145.new_sys_guid = cl_hton64(0x1234567812345678);
+}
+
+static void build_trap144_local(ib_mad_notice_attr_t * n, ib_portid_t * port)
+{
+	n->generic_type = 0x80 | IB_NOTICE_TYPE_INFO;
+	n->g_or_v.generic.prod_type_lsb = cl_hton16(get_node_type(port));
+	n->g_or_v.generic.trap_num = cl_hton16(144);
+	n->issuer_lid = cl_hton16((uint16_t) port->lid);
+	n->data_details.ntc_144.lid = n->issuer_lid;
+	n->data_details.ntc_144.new_cap_mask = cl_hton32(get_cap_mask(port));
+	n->data_details.ntc_144.local_changes =
+	    TRAP_144_MASK_OTHER_LOCAL_CHANGES;
+}
+
+static void build_trap144_nodedesc(ib_mad_notice_attr_t * n, ib_portid_t * port)
+{
+	build_trap144_local(n, port);
+	n->data_details.ntc_144.change_flgs =
+	    TRAP_144_MASK_NODE_DESCRIPTION_CHANGE;
+}
+
+static void build_trap144_linkspeed(ib_mad_notice_attr_t * n,
+				    ib_portid_t * port)
+{
+	build_trap144_local(n, port);
+	n->data_details.ntc_144.change_flgs =
+	    TRAP_144_MASK_LINK_SPEED_ENABLE_CHANGE;
+}
+
+static void build_trap129(ib_mad_notice_attr_t * n, ib_portid_t * port)
+{
+	n->generic_type = 0x80 | IB_NOTICE_TYPE_URGENT;
+	n->g_or_v.generic.prod_type_lsb = cl_hton16(get_node_type(port));
+	n->g_or_v.generic.trap_num = cl_hton16(129);
+	n->issuer_lid = cl_hton16((uint16_t) port->lid);
+	n->data_details.ntc_129_131.lid = n->issuer_lid;
+	n->data_details.ntc_129_131.pad = 0;
+	n->data_details.ntc_129_131.port_num = (uint8_t) error_port;
+}
+
+static int send_trap(const char *name,
+		     void (*build) (ib_mad_notice_attr_t *, ib_portid_t *))
 {
 	ib_portid_t sm_port;
 	ib_portid_t selfportid;
@@ -57,10 +130,10 @@ static int send_144_node_desc_update(void)
 	ib_rpc_t trap_rpc;
 	ib_mad_notice_attr_t notice;
 
-	if (ib_resolve_self(&selfportid, &selfport, NULL))
+	if (resolve_self(ibd_ca, ibd_ca_port, &selfportid, &selfport, NULL))
 		IBERROR("can't resolve self");
 
-	if (ib_resolve_smlid(&sm_port, 0))
+	if (resolve_sm_portid(ibd_ca, ibd_ca_port, &sm_port))
 		IBERROR("can't resolve SM destination port");
 
 	memset(&trap_rpc, 0, sizeof(trap_rpc));
@@ -72,105 +145,73 @@ static int send_144_node_desc_update(void)
 	trap_rpc.dataoffs = IB_SMP_DATA_OFFS;
 
 	memset(&notice, 0, sizeof(notice));
-	notice.generic_type = 0x80 | IB_NOTICE_TYPE_INFO;
-	notice.g_or_v.generic.prod_type_lsb = cl_hton16(IB_NODE_TYPE_CA);
-	notice.g_or_v.generic.trap_num = cl_hton16(144);
-	notice.issuer_lid = cl_hton16(selfportid.lid);
-	notice.data_details.ntc_144.lid = cl_hton16(selfportid.lid);
-	notice.data_details.ntc_144.local_changes =
-	    TRAP_144_MASK_OTHER_LOCAL_CHANGES;
-	notice.data_details.ntc_144.change_flgs =
-	    TRAP_144_MASK_NODE_DESCRIPTION_CHANGE;
+	build(&notice, &selfportid);
 
-	return (mad_send(&trap_rpc, &sm_port, NULL, &notice));
+	return mad_send_via(&trap_rpc, &sm_port, NULL, &notice, srcport);
 }
 
 typedef struct _trap_def {
 	char *trap_name;
-	int (*send_func) (void);
+	void (*build_func) (ib_mad_notice_attr_t *, ib_portid_t *);
 } trap_def_t;
 
-trap_def_t traps[2] = {
-	{"node_desc_change", send_144_node_desc_update},
+static const trap_def_t traps[] = {
+	{"node_desc_change", build_trap144_nodedesc},
+	{"link_speed_enabled_change", build_trap144_linkspeed},
+	{"local_link_integrity", build_trap129},
+	{"sys_image_guid_change", build_trap145},
 	{NULL, NULL}
 };
 
-static void usage(void)
-{
-	int i;
-
-	fprintf(stderr, "Usage: %s [-hV]"
-		" [-C <ca_name>] [-P <ca_port>] [<trap_name>]\n", argv0);
-	fprintf(stderr, "   -V print version\n");
-	fprintf(stderr, "   <trap_name> can be one of the following\n");
-	for (i = 0; traps[i].trap_name; i++) {
-		fprintf(stderr, "      %s\n", traps[i].trap_name);
-	}
-	fprintf(stderr, "   default behavior is to send \"%s\"\n",
-		traps[0].trap_name);
-
-	exit(-1);
-}
-
-int send_trap(char *trap_name)
+int process_send_trap(char *trap_name)
 {
 	int i;
 
-	for (i = 0; traps[i].trap_name; i++) {
-		if (strcmp(traps[i].trap_name, trap_name) == 0) {
-			return (traps[i].send_func());
-		}
-	}
-	usage();
-	exit(1);
+	for (i = 0; traps[i].trap_name; i++)
+		if (strcmp(traps[i].trap_name, trap_name) == 0)
+			return send_trap(trap_name, traps[i].build_func);
+	ibdiag_show_usage();
+	return 1;
 }
 
 int main(int argc, char **argv)
 {
+	char usage_args[1024];
 	int mgmt_classes[2] = { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS };
-	int ch = 0;
 	char *trap_name = NULL;
-	char *ca = NULL;
-	int ca_port = 0;
-
-	static char const str_opts[] = "hVP:C:";
-	static const struct option long_opts[] = {
-		{"Version", 0, 0, 'V'},
-		{"P", 1, 0, 'P'},
-		{"C", 1, 0, 'C'},
-		{"help", 0, 0, 'h'},
-		{}
-	};
-
-	argv0 = argv[0];
-
-	while ((ch = getopt_long(argc, argv, str_opts, long_opts, NULL)) != -1) {
-		switch (ch) {
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version());
+	int i, n, rc;
+
+	n = sprintf(usage_args, "[<trap_name>] [<error_port>]\n"
+		    "\nArgument <trap_name> can be one of the following:\n");
+	for (i = 0; traps[i].trap_name; i++) {
+		n += snprintf(usage_args + n, sizeof(usage_args) - n,
+			      "  %s\n", traps[i].trap_name);
+		if (n >= sizeof(usage_args))
 			exit(-1);
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, NULL, 0);
-			break;
-		case 'h':
-		default:
-			usage();
-		}
 	}
+	snprintf(usage_args + n, sizeof(usage_args) - n,
+		 "\n  default behavior is to send \"%s\"", traps[0].trap_name);
+
+	ibdiag_process_opts(argc, argv, NULL, "DGKL", NULL, NULL,
+			    usage_args, NULL);
+
 	argc -= optind;
 	argv += optind;
 
-	if (!argv[0]) {
-		trap_name = traps[0].trap_name;
-	} else {
-		trap_name = argv[0];
-	}
+	trap_name = argv[0] ? argv[0] : traps[0].trap_name;
+
+	if (argc > 1)
+		error_port = atoi(argv[1]);
 
 	madrpc_show_errors(1);
-	madrpc_init(ca, ca_port, mgmt_classes, 2);
 
-	return (send_trap(trap_name));
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 2);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
+
+	rc = process_send_trap(trap_name);
+	mad_rpc_close_port(srcport);
+	return rc;
 }
diff --git a/src/ibstat.c b/src/ibstat.c
index 600a657..665bb0a 100644
--- a/src/ibstat.c
+++ b/src/ibstat.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -35,38 +36,23 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <inttypes.h>
 #include <string.h>
-#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
+#include <getopt.h>
+#include <netinet/in.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <string.h>
-#include <getopt.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <sys/poll.h>
-#include <syslog.h>
-#include <netinet/in.h>
+#include <errno.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
-#include <infiniband/mad.h>
 
 #include <ibdiag_common.h>
 
-static int debug;
-
-char *argv0 = "ibstat";
-
 static char *node_type_str[] = {
 	"???",
 	"CA",
@@ -75,18 +61,24 @@ static char *node_type_str[] = {
 	"iWARP RNIC"
 };
 
-static void
-ca_dump(umad_ca_t *ca)
+static void ca_dump(umad_ca_t * ca)
 {
 	if (!ca->node_type)
 		return;
-	printf("%s '%s'\n", ((uint)ca->node_type <= IB_NODE_MAX ? node_type_str[ca->node_type] : "???"), ca->ca_name);
-	printf("\t%s type: %s\n", ((uint)ca->node_type <= IB_NODE_MAX ? node_type_str[ca->node_type] : "???"),ca->ca_type);
+	printf("%s '%s'\n",
+	       ((unsigned)ca->node_type <=
+		IB_NODE_MAX ? node_type_str[ca->node_type] : "???"),
+	       ca->ca_name);
+	printf("\t%s type: %s\n",
+	       ((unsigned)ca->node_type <=
+		IB_NODE_MAX ? node_type_str[ca->node_type] : "???"),
+	       ca->ca_type);
 	printf("\tNumber of ports: %d\n", ca->numports);
 	printf("\tFirmware version: %s\n", ca->fw_ver);
 	printf("\tHardware version: %s\n", ca->hw_ver);
-	printf("\tNode GUID: 0x%016llx\n", (long long unsigned)ntohll(ca->node_guid));
-	printf("\tSystem image GUID: 0x%016llx\n", (long long unsigned)ntohll(ca->system_guid));
+	printf("\tNode GUID: 0x%016" PRIx64 "\n", ntohll(ca->node_guid));
+	printf("\tSystem image GUID: 0x%016" PRIx64 "\n",
+	       ntohll(ca->system_guid));
 }
 
 static char *port_state_str[] = {
@@ -108,8 +100,67 @@ static char *port_phy_state_str[] = {
 	"PhyTest"
 };
 
-static int
-port_dump(umad_port_t *port, int alone)
+static int ret_code(void)
+{
+	int e = errno;
+
+	if (e > 0)
+		return -e;
+	return e;
+}
+
+static int sys_read_string(char *dir_name, char *file_name, char *str,
+			   int max_len)
+{
+	char path[256], *s;
+	int fd, r;
+
+	snprintf(path, sizeof(path), "%s/%s", dir_name, file_name);
+
+	if ((fd = open(path, O_RDONLY)) < 0)
+		return ret_code();
+
+	if ((r = read(fd, str, max_len)) < 0) {
+		int e = errno;
+		close(fd);
+		errno = e;
+		return ret_code();
+	}
+
+	str[(r < max_len) ? r : max_len - 1] = 0;
+
+	if ((s = strrchr(str, '\n')))
+		*s = 0;
+
+	close(fd);
+	return 0;
+}
+
+static int is_fdr10(umad_port_t *port)
+{
+	char port_dir[256];
+	char rate[32];
+	int len, fdr10 = 0;
+	char *p;
+
+	len = snprintf(port_dir, sizeof(port_dir), "%s/%s/%s/%d",
+		       SYS_INFINIBAND, port->ca_name, SYS_CA_PORTS_DIR,
+		       port->portnum);
+	if (len < 0 || len > sizeof(port_dir))
+		goto done;
+
+	if (sys_read_string(port_dir, SYS_PORT_RATE, rate, sizeof(rate)) == 0) {
+		if ((p = strchr(rate, ')'))) {
+			if (!strncasecmp(p - 5, "fdr10", 5))
+				fdr10 = 1;
+		}
+	}
+
+done:
+	return fdr10;
+}
+
+static int port_dump(umad_port_t * port, int alone)
 {
 	char *pre = "";
 	char *hdrpre = "";
@@ -123,19 +174,28 @@ port_dump(umad_port_t *port, int alone)
 	}
 
 	printf("%sPort %d:\n", hdrpre, port->portnum);
-	printf("%sState: %s\n", pre, (uint)port->state <= 4 ? port_state_str[port->state] : "???");
-	printf("%sPhysical state: %s\n", pre, (uint)port->state <= 7 ? port_phy_state_str[port->phys_state] : "???");
-	printf("%sRate: %d\n", pre, port->rate);
+	printf("%sState: %s\n", pre,
+	       (unsigned)port->state <=
+	       4 ? port_state_str[port->state] : "???");
+	printf("%sPhysical state: %s\n", pre,
+	       (unsigned)port->phys_state <=
+	       7 ? port_phy_state_str[port->phys_state] : "???");
+	if (is_fdr10(port))
+		printf("%sRate: %d (FDR10)\n", pre, port->rate);
+	else
+		printf("%sRate: %d\n", pre, port->rate);
 	printf("%sBase lid: %d\n", pre, port->base_lid);
 	printf("%sLMC: %d\n", pre, port->lmc);
 	printf("%sSM lid: %d\n", pre, port->sm_lid);
-	printf("%sCapability mask: 0x%08x\n", pre, (unsigned)ntohl(port->capmask));
-	printf("%sPort GUID: 0x%016llx\n", pre, (long long unsigned)ntohll(port->port_guid));
+	printf("%sCapability mask: 0x%08x\n", pre, ntohl(port->capmask));
+	printf("%sPort GUID: 0x%016" PRIx64 "\n", pre, ntohll(port->port_guid));
+#ifdef HAVE_UMAD_PORT_LINK_LAYER
+	printf("%sLink layer: %s\n", pre, port->link_layer);
+#endif
 	return 0;
 }
 
-static int
-ca_stat(char *ca_name, int portnum, int no_ports)
+static int ca_stat(char *ca_name, int portnum, int no_ports)
 {
 	umad_ca_t ca;
 	int r;
@@ -149,11 +209,15 @@ ca_stat(char *ca_name, int portnum, int no_ports)
 	if (!no_ports && portnum >= 0) {
 		if (portnum > ca.numports || !ca.ports[portnum]) {
 			IBWARN("%s: '%s' has no port number %d - max (%d)",
-				((uint)ca.node_type <= IB_NODE_MAX ? node_type_str[ca.node_type] : "???"),
-				ca_name, portnum, ca.numports);
+			       ((unsigned)ca.node_type <=
+				IB_NODE_MAX ? node_type_str[ca.node_type] :
+				"???"), ca_name, portnum, ca.numports);
 			return -1;
 		}
-		printf("%s: '%s'\n", ((uint)ca.node_type <= IB_NODE_MAX ? node_type_str[ca.node_type] : "???"), ca.ca_name);
+		printf("%s: '%s'\n",
+		       ((unsigned)ca.node_type <=
+			IB_NODE_MAX ? node_type_str[ca.node_type] : "???"),
+		       ca.ca_name);
 		port_dump(ca.ports[portnum], 1);
 		return 0;
 	}
@@ -170,81 +234,67 @@ ca_stat(char *ca_name, int portnum, int no_ports)
 	return 0;
 }
 
-static int
-ports_list(char names[][UMAD_CA_NAME_LEN], int n)
+static int ports_list(char names[][UMAD_CA_NAME_LEN], int n)
 {
 	uint64_t guids[64];
 	int found, ports, i;
 
 	for (i = 0, found = 0; i < n && found < 64; i++) {
-		if ((ports = umad_get_ca_portguids(names[i], guids + found, 64 - found)) < 0)
+		if ((ports =
+		     umad_get_ca_portguids(names[i], guids + found,
+					   64 - found)) < 0)
 			return -1;
 		found += ports;
 	}
 
 	for (i = 0; i < found; i++)
 		if (guids[i])
-			printf("0x%016llx\n", (long long unsigned)ntohll(guids[i]));
+			printf("0x%016" PRIx64 "\n", ntohll(guids[i]));
 	return found;
 }
 
-void
-usage(void)
+static int list_only, short_format, list_ports;
+
+static int process_opt(void *context, int ch, char *optarg)
 {
-	fprintf(stderr, "Usage: %s [-d(ebug) -l(ist_of_cas) -s(hort) -p(ort_list) -V(ersion)] <ca_name> [portnum]\n", argv0);
-	fprintf(stderr, "\tExamples:\n");
-	fprintf(stderr, "\t\t%s -l	  # list all IB devices\n", argv0);
-	fprintf(stderr, "\t\t%s mthca0 2 # stat port 2 of 'mthca0'\n", argv0);
-	exit(-1);
+	switch (ch) {
+	case 'l':
+		list_only++;
+		break;
+	case 's':
+		short_format++;
+		break;
+	case 'p':
+		list_ports++;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
 }
 
-int
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
 	char names[UMAD_MAX_DEVICES][UMAD_CA_NAME_LEN];
 	int dev_port = -1;
-	int list_only = 0, short_format = 0, list_ports = 0;
 	int n, i;
 
-	static char const str_opts[] = "dlspVhu";
-	static const struct option long_opts[] = {
-		{ "debug", 0, 0, 'd'},
-		{ "list_of_cas", 0, 0, 'l'},
-		{ "short", 0, 0, 's'},
-		{ "port_list", 0, 0, 'p'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+	const struct ibdiag_opt opts[] = {
+		{"list_of_cas", 'l', 0, NULL, "list all IB devices"},
+		{"short", 's', 0, NULL, "short output"},
+		{"port_list", 'p', 0, NULL, "show port list"},
+		{0}
+	};
+	char usage_args[] = "<ca_name> [portnum]";
+	const char *usage_examples[] = {
+		"-l       # list all IB devices",
+		"mthca0 2 # stat port 2 of 'mthca0'",
+		NULL
 	};
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'd':
-			debug++;
-			break;
-		case 'l':
-			list_only++;
-			break;
-		case 's':
-			short_format++;
-			break;
-		case 'p':
-			list_ports++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
+	ibdiag_process_opts(argc, argv, NULL, "CDeGKLPsty", opts, process_opt,
+			    usage_args, usage_examples);
+
 	argc -= optind;
 	argv += optind;
 
@@ -283,9 +333,8 @@ main(int argc, char *argv[])
 	for (i = 0; i < n; i++) {
 		if (list_only)
 			printf("%s\n", names[i]);
-		else
-			if (ca_stat(names[i], -1, short_format) < 0)
-				IBPANIC("stat of IB device '%s' failed", names[i]);
+		else if (ca_stat(names[i], -1, short_format) < 0)
+			IBPANIC("stat of IB device '%s' failed", names[i]);
 	}
 
 	return 0;
diff --git a/src/ibsysstat.c b/src/ibsysstat.c
index e3d0b9f..d798fe2 100644
--- a/src/ibsysstat.c
+++ b/src/ibsysstat.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,30 +33,23 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
-#include <time.h>
 #include <string.h>
 #include <getopt.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 
 #include "ibdiag_common.h"
 
-#undef DEBUG
-#define	DEBUG	if (verbose) IBWARN
-
-static int dest_type = IB_DEST_LID;
-static int verbose;
-
 #define MAX_CPUS 8
 
+struct ibmad_port *srcport;
+
 enum ib_sysstat_attr_t {
 	IB_PING_ATTR = 0x10,
 	IB_HOSTINFO_ATTR = 0x11,
@@ -71,13 +64,59 @@ typedef struct cpu_info {
 static cpu_info cpus[MAX_CPUS];
 static int host_ncpu;
 
-char *argv0 = "ibsysstat";
+static int server_respond(void *umad, int size)
+{
+	ib_rpc_t rpc = { 0 };
+	ib_rmpp_hdr_t rmpp = { 0 };
+	ib_portid_t rport;
+	uint8_t *mad = umad_get_mad(umad);
+	ib_mad_addr_t *mad_addr;
+
+	if (!(mad_addr = umad_get_mad_addr(umad)))
+		return -1;
+
+	memset(&rport, 0, sizeof(rport));
+
+	rport.lid = ntohs(mad_addr->lid);
+	rport.qp = ntohl(mad_addr->qpn);
+	rport.qkey = ntohl(mad_addr->qkey);
+	rport.sl = mad_addr->sl;
+	if (!rport.qkey && rport.qp == 1)
+		rport.qkey = IB_DEFAULT_QP1_QKEY;
+
+	rpc.mgtclass = mad_get_field(mad, 0, IB_MAD_MGMTCLASS_F);
+	rpc.method = IB_MAD_METHOD_GET | IB_MAD_RESPONSE;
+	rpc.attr.id = mad_get_field(mad, 0, IB_MAD_ATTRID_F);
+	rpc.attr.mod = mad_get_field(mad, 0, IB_MAD_ATTRMOD_F);
+	rpc.oui = mad_get_field(mad, 0, IB_VEND2_OUI_F);
+	rpc.trid = mad_get_field64(mad, 0, IB_MAD_TRID_F);
+
+	if (size > IB_MAD_SIZE)
+		rmpp.flags = IB_RMPP_FLAG_ACTIVE;
+
+	DEBUG("responding %d bytes to %s, attr 0x%x mod 0x%x qkey %x",
+	      size, portid2str(&rport), rpc.attr.id, rpc.attr.mod, rport.qkey);
+
+	if (mad_build_pkt(umad, &rpc, &rport, &rmpp, 0) < 0)
+		return -1;
+
+	if (ibdebug > 1)
+		xdump(stderr, "mad respond pkt\n", mad, IB_MAD_SIZE);
+
+	if (umad_send(mad_rpc_portid(srcport),
+		      mad_rpc_class_agent(srcport, rpc.mgtclass), umad, size,
+		      rpc.timeout, 0) < 0) {
+		DEBUG("send failed; %m");
+		return -1;
+	}
 
-static void
-mk_reply(int attr, void *data, int sz)
+	return 0;
+}
+
+static int mk_reply(int attr, void *data, int sz)
 {
 	char *s = data;
-	int n, i;
+	int n, i, ret = 0;
 
 	switch (attr) {
 	case IB_PING_ATTR:
@@ -85,44 +124,60 @@ mk_reply(int attr, void *data, int sz)
 	case IB_HOSTINFO_ATTR:
 		if (gethostname(s, sz) < 0)
 			snprintf(s, sz, "?hostname?");
-		s[sz-1] = 0;
-		if ((n = strlen(s)) >= sz)
+		s[sz - 1] = 0;
+		if ((n = strlen(s)) >= sz - 1) {
+			ret = sz;
 			break;
+		}
 		s[n] = '.';
-		s += n+1;
-		sz -= n+1;
+		s += n + 1;
+		sz -= n + 1;
+		ret += n + 1;
 		if (getdomainname(s, sz) < 0)
 			snprintf(s, sz, "?domainname?");
-		if (strlen(s) == 0)
+		if ((n = strlen(s)) == 0)
 			s[-1] = 0;	/* no domain */
+		else
+			ret += n;
 		break;
 	case IB_CPUINFO_ATTR:
+		s[0] = '\0';
 		for (i = 0; i < host_ncpu && sz > 0; i++) {
 			n = snprintf(s, sz, "cpu %d: model %s MHZ %s\n",
 				     i, cpus[i].model, cpus[i].mhz);
 			if (n >= sz) {
 				IBWARN("cpuinfo truncated");
+				ret = sz;
 				break;
 			}
 			sz -= n;
 			s += n;
+			ret += n;
 		}
+		ret++;
 		break;
 	default:
 		DEBUG("unknown attr %d", attr);
 	}
+	return ret;
 }
 
-static char *
-ibsystat_serv(void)
+static uint8_t buf[2048];
+
+static char *ibsystat_serv(void)
 {
 	void *umad;
 	void *mad;
-	int attr, mod;
+	int attr, mod, size;
 
 	DEBUG("starting to serve...");
 
-	while ((umad = mad_receive(0, -1))) {
+	while ((umad = mad_receive_via(buf, -1, srcport))) {
+		if (umad_status(buf)) {
+			DEBUG("drop mad with status %x: %s", umad_status(buf),
+			      strerror(umad_status(buf)));
+			continue;
+		}
 
 		mad = umad_get_mad(umad);
 
@@ -131,20 +186,20 @@ ibsystat_serv(void)
 
 		DEBUG("got packet: attr 0x%x mod 0x%x", attr, mod);
 
-		mk_reply(attr, (char *)mad + IB_VENDOR_RANGE2_DATA_OFFS, IB_VENDOR_RANGE2_DATA_SIZE);
+		size =
+		    mk_reply(attr, (uint8_t *) mad + IB_VENDOR_RANGE2_DATA_OFFS,
+			     sizeof(buf) - umad_size() -
+			     IB_VENDOR_RANGE2_DATA_OFFS);
 
-		if (mad_respond(umad, 0, 0) < 0)
+		if (server_respond(umad, IB_VENDOR_RANGE2_DATA_OFFS + size) < 0)
 			DEBUG("respond failed");
-
-		mad_free(umad);
 	}
 
 	DEBUG("server out");
 	return 0;
 }
 
-static int
-match_attr(char *str)
+static int match_attr(char *str)
 {
 	if (!strcmp(str, "ping"))
 		return IB_PING_ATTR;
@@ -155,24 +210,43 @@ match_attr(char *str)
 	return -1;
 }
 
-static char *
-ibsystat(ib_portid_t *portid, int attr)
+static char *ibsystat(ib_portid_t * portid, int attr)
 {
-	char data[IB_VENDOR_RANGE2_DATA_SIZE] = {0};
-	ib_vendor_call_t call;
+	ib_rpc_t rpc = { 0 };
+	int fd, agent, timeout, len;
+	void *data = (uint8_t *) umad_get_mad(buf) + IB_VENDOR_RANGE2_DATA_OFFS;
 
 	DEBUG("Sysstat ping..");
 
-	call.method = IB_MAD_METHOD_GET;
-	call.mgmt_class = IB_VENDOR_OPENIB_SYSSTAT_CLASS;
-	call.attrid = attr;
-	call.mod = 0;
-	call.oui = IB_OPENIB_OUI;
-	call.timeout = 0;
-	memset(&call.rmpp, 0, sizeof call.rmpp);
+	rpc.mgtclass = IB_VENDOR_OPENIB_SYSSTAT_CLASS;
+	rpc.method = IB_MAD_METHOD_GET;
+	rpc.attr.id = attr;
+	rpc.attr.mod = 0;
+	rpc.oui = IB_OPENIB_OUI;
+	rpc.timeout = 0;
+	rpc.datasz = IB_VENDOR_RANGE2_DATA_SIZE;
+	rpc.dataoffs = IB_VENDOR_RANGE2_DATA_OFFS;
+
+	portid->qp = 1;
+	if (!portid->qkey)
+		portid->qkey = IB_DEFAULT_QP1_QKEY;
+
+	if ((len = mad_build_pkt(buf, &rpc, portid, NULL, NULL)) < 0)
+		IBPANIC("cannot build packet.");
+
+	fd = mad_rpc_portid(srcport);
+	agent = mad_rpc_class_agent(srcport, rpc.mgtclass);
+	timeout = ibd_timeout ? ibd_timeout : MAD_DEF_TIMEOUT_MS;
 
-	if (!ib_vendor_call(data, portid, &call))
-		return "vendor call failed";
+	if (umad_send(fd, agent, buf, len, timeout, 0) < 0)
+		IBPANIC("umad_send failed.");
+
+	len = sizeof(buf) - umad_size();
+	if (umad_recv(fd, buf, &len, timeout) < 0)
+		IBPANIC("umad_recv failed.");
+
+	if (umad_status(buf))
+		return strerror(umad_status(buf));
 
 	DEBUG("Got sysstat pong..");
 	if (attr != IB_PING_ATTR)
@@ -182,10 +256,9 @@ ibsystat(ib_portid_t *portid, int attr)
 	return 0;
 }
 
-int
-build_cpuinfo(void)
+int build_cpuinfo(void)
 {
-	char line[1024] = {0}, *s, *e;
+	char line[1024] = { 0 }, *s, *e;
 	FILE *f;
 	int ncpu = 0;
 
@@ -208,9 +281,9 @@ build_cpuinfo(void)
 		if ((e = strchr(s, '\n')))
 			*e = 0;
 		if (!strncmp(line, "model name\t", 11))
-			cpus[ncpu-1].model = strdup(s+1);
+			cpus[ncpu - 1].model = strdup(s + 1);
 		else if (!strncmp(line, "cpu MHz\t", 8))
-			cpus[ncpu-1].mhz = strdup(s+1);
+			cpus[ncpu - 1].mhz = strdup(s + 1);
 	}
 
 	fclose(f);
@@ -220,135 +293,78 @@ build_cpuinfo(void)
 	return ncpu;
 }
 
-static void
-usage(void)
-{
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
+static int server = 0, oui = IB_OPENIB_OUI;
 
-	fprintf(stderr, "Usage: %s [-d(ebug) -e(rr_show) -v(erbose) -G(uid) -s smlid -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms -o oui -S(erver)] <dest lid|guid> [<op>]\n",
-			basename);
-	exit(-1);
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 'o':
+		oui = strtoul(optarg, 0, 0);
+		break;
+	case 'S':
+		server++;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
 	int sysstat_class = IB_VENDOR_OPENIB_SYSSTAT_CLASS;
-	ib_portid_t portid = {0};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	int timeout = 0, udebug = 0, server = 0;
-	int oui = IB_OPENIB_OUI, attr = IB_PING_ATTR;
-	extern int ibdebug;
+	ib_portid_t portid = { 0 };
+	int attr = IB_PING_ATTR;
 	char *err;
-	char *ca = 0;
-	int ca_port = 0;
-
-	static char const str_opts[] = "C:P:t:s:o:devGSVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "err_show", 0, 0, 'e'},
-		{ "verbose", 0, 0, 'v'},
-		{ "Guid", 0, 0, 'G'},
-		{ "timeout", 1, 0, 't'},
-		{ "s", 1, 0, 's'},
-		{ "o", 1, 0, 'o'},
-		{ "Server", 0, 0, 'S'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+
+	const struct ibdiag_opt opts[] = {
+		{"oui", 'o', 1, NULL, "use specified OUI number"},
+		{"Server", 'S', 0, NULL, "start in server mode"},
+		{0}
 	};
+	char usage_args[] = "<dest lid|guid> [<op>]";
 
-	argv0 = argv[0];
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
+			    usage_args, NULL);
 
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'e':
-			madrpc_show_errors(1);
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'o':
-			oui = strtoul(optarg, 0, 0);
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 'S':
-			server++;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'v':
-			verbose++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
 	if (!argc && !server)
-		usage();
+		ibdiag_show_usage();
 
 	if (argc > 1 && (attr = match_attr(argv[1])) < 0)
-		usage();
+		ibdiag_show_usage();
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	if (server) {
-		if (mad_register_server(sysstat_class, 0, 0, oui) < 0)
+		if (mad_register_server_via(sysstat_class, 1, 0, oui, srcport) <
+		    0)
 			IBERROR("can't serve class %d", sysstat_class);
 
 		host_ncpu = build_cpuinfo();
 
 		if ((err = ibsystat_serv()))
-			IBERROR("ibssystat to %s: %s", portid2str(&portid), err);
+			IBERROR("ibssystat to %s: %s", portid2str(&portid),
+				err);
 		exit(0);
 	}
 
-	if (mad_register_client(sysstat_class, 0) < 0)
+	if (mad_register_client_via(sysstat_class, 1, srcport) < 0)
 		IBERROR("can't register to sysstat class %d", sysstat_class);
 
-	if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[0]);
 
 	if ((err = ibsystat(&portid, attr)))
 		IBERROR("ibsystat to %s: %s", portid2str(&portid), err);
 
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/ibtracert.c b/src/ibtracert.c
index bde0ea7..5800e40 100644
--- a/src/ibtracert.c
+++ b/src/ibtracert.c
@@ -1,5 +1,7 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2009 HNR Consulting.  All rights reserved.
+ * Copyright (c) 2010,2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,26 +35,25 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <ctype.h>
 #include <getopt.h>
 #include <netinet/in.h>
 #include <inttypes.h>
-#include <errno.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <complib/cl_nodenamemap.h>
 
 #include "ibdiag_common.h"
 
+struct ibmad_port *srcport;
+
 #define MAXHOPS	63
 
 static char *node_type_str[] = {
@@ -64,12 +65,9 @@ static char *node_type_str[] = {
 };
 
 static int timeout = 0;		/* ms */
-static int verbose;
 static int force;
 static FILE *f;
 
-char *argv0 = "ibtracert";
-
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
 
@@ -116,16 +114,17 @@ struct Node {
 Node *nodesdist[MAXHOPS];
 uint64_t target_portguid;
 
-static int
-get_node(Node *node, Port *port, ib_portid_t *portid)
+static int get_node(Node * node, Port * port, ib_portid_t * portid)
 {
 	void *pi = port->portinfo, *ni = node->nodeinfo, *nd = node->nodedesc;
 	char *s, *e;
 
-	if (!smp_query(ni, portid, IB_ATTR_NODE_INFO, 0, timeout))
+	memset(ni, 0, sizeof(node->nodeinfo));
+	if (!smp_query_via(ni, portid, IB_ATTR_NODE_INFO, 0, timeout, srcport))
 		return -1;
 
-	if (!smp_query(nd, portid, IB_ATTR_NODE_DESC, 0, timeout))
+	memset(nd, 0, sizeof(node->nodedesc));
+	if (!smp_query_via(nd, portid, IB_ATTR_NODE_DESC, 0, timeout, srcport))
 		return -1;
 
 	for (s = nd, e = s + 64; s < e; s++) {
@@ -135,7 +134,8 @@ get_node(Node *node, Port *port, ib_portid_t *portid)
 			*s = ' ';
 	}
 
-	if (!smp_query(pi, portid, IB_ATTR_PORT_INFO, 0, timeout))
+	memset(pi, 0, sizeof(port->portinfo));
+	if (!smp_query_via(pi, portid, IB_ATTR_PORT_INFO, 0, timeout, srcport))
 		return -1;
 
 	mad_decode_field(ni, IB_NODE_GUID_F, &node->nodeguid);
@@ -148,50 +148,51 @@ get_node(Node *node, Port *port, ib_portid_t *portid)
 	mad_decode_field(pi, IB_PORT_LMC_F, &port->lmc);
 	mad_decode_field(pi, IB_PORT_STATE_F, &port->state);
 
-	DEBUG("portid %s: got node %" PRIx64 " '%s'", portid2str(portid), node->nodeguid, node->nodedesc);
+	DEBUG("portid %s: got node %" PRIx64 " '%s'", portid2str(portid),
+	      node->nodeguid, node->nodedesc);
 	return 0;
 }
 
-static int
-switch_lookup(Switch *sw, ib_portid_t *portid, int lid)
+static int switch_lookup(Switch * sw, ib_portid_t * portid, int lid)
 {
 	void *si = sw->switchinfo, *fdb = sw->fdb;
 
-	if (!smp_query(si, portid, IB_ATTR_SWITCH_INFO, 0, timeout))
+	memset(si, 0, sizeof(sw->switchinfo));
+	if (!smp_query_via(si, portid, IB_ATTR_SWITCH_INFO, 0, timeout,
+			   srcport))
 		return -1;
 
 	mad_decode_field(si, IB_SW_LINEAR_FDB_CAP_F, &sw->linearcap);
 	mad_decode_field(si, IB_SW_LINEAR_FDB_TOP_F, &sw->linearFDBtop);
 
-	if (lid > sw->linearcap && lid > sw->linearFDBtop)
+	if (lid >= sw->linearcap && lid > sw->linearFDBtop)
 		return -1;
 
-	if (!smp_query(fdb, portid, IB_ATTR_LINEARFORWTBL, lid / 64, timeout))
+	memset(fdb, 0, sizeof(sw->fdb));
+	if (!smp_query_via(fdb, portid, IB_ATTR_LINEARFORWTBL, lid / 64,
+			   timeout, srcport))
 		return -1;
 
 	DEBUG("portid %s: forward lid %d to port %d",
-		portid2str(portid), lid, sw->fdb[lid % 64]);
+	      portid2str(portid), lid, sw->fdb[lid % 64]);
 	return sw->fdb[lid % 64];
 }
 
-static int
-sameport(Port *a, Port *b)
+static int sameport(Port * a, Port * b)
 {
 	return a->portguid == b->portguid || (force && a->lid == b->lid);
 }
 
-static int
-extend_dpath(ib_dr_path_t *path, int nextport)
+static int extend_dpath(ib_dr_path_t * path, int nextport)
 {
-	if (path->cnt+2 >= sizeof(path->p))
+	if (path->cnt + 2 >= sizeof(path->p))
 		return -1;
 	++path->cnt;
-	path->p[path->cnt] = nextport;
+	path->p[path->cnt] = (uint8_t) nextport;
 	return path->cnt;
 }
 
-static void
-dump_endnode(int dump, char *prompt, Node *node, Port *port)
+static void dump_endnode(int dump, char *prompt, Node * node, Port * port)
 {
 	char *nodename = NULL;
 
@@ -204,44 +205,44 @@ dump_endnode(int dump, char *prompt, Node *node, Port *port)
 		return;
 	}
 
-	nodename = remap_node_name(node_name_map, node->nodeguid, node->nodedesc);
+	nodename =
+	    remap_node_name(node_name_map, node->nodeguid, node->nodedesc);
 
 	fprintf(f, "%s %s {0x%016" PRIx64 "} portnum %d lid %u-%u \"%s\"\n",
 		prompt,
 		(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-		node->nodeguid, node->type == IB_NODE_SWITCH ? 0 : port->portnum,
-		port->lid, port->lid + (1 << port->lmc) - 1,
-		nodename);
+		node->nodeguid,
+		node->type == IB_NODE_SWITCH ? 0 : port->portnum, port->lid,
+		port->lid + (1 << port->lmc) - 1, nodename);
 
 	free(nodename);
 }
 
-static void
-dump_route(int dump, Node *node, int outport, Port *port)
+static void dump_route(int dump, Node * node, int outport, Port * port)
 {
 	char *nodename = NULL;
 
-	if (!dump && !verbose)
+	if (!dump && !ibverbose)
 		return;
 
-	nodename = remap_node_name(node_name_map, node->nodeguid, node->nodedesc);
+	nodename =
+	    remap_node_name(node_name_map, node->nodeguid, node->nodedesc);
 
 	if (dump == 1)
 		fprintf(f, "[%d] -> {0x%016" PRIx64 "}[%d]\n",
 			outport, port->portguid, port->portnum);
 	else
-		fprintf(f, "[%d] -> %s port {0x%016" PRIx64 "}[%d] lid %u-%u \"%s\"\n",
-			outport,
-			(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-			port->portguid, port->portnum,
-			port->lid, port->lid + (1 << port->lmc) - 1,
-			nodename);
+		fprintf(f, "[%d] -> %s port {0x%016" PRIx64
+			"}[%d] lid %u-%u \"%s\"\n", outport,
+			(node->type <=
+			 IB_NODE_MAX ? node_type_str[node->type] : "???"),
+			port->portguid, port->portnum, port->lid,
+			port->lid + (1 << port->lmc) - 1, nodename);
 
 	free(nodename);
 }
 
-static int
-find_route(ib_portid_t *from, ib_portid_t *to, int dump)
+static int find_route(ib_portid_t * from, ib_portid_t * to, int dump)
 {
 	Node *node, fromnode, tonode, nextnode;
 	Port *port, fromport, toport, nextport;
@@ -285,7 +286,8 @@ find_route(ib_portid_t *from, ib_portid_t *to, int dump)
 				goto badpath;
 
 			if (get_node(&nextnode, &nextport, from) < 0) {
-				IBWARN("can't reach port at %s", portid2str(from));
+				IBWARN("can't reach port at %s",
+				       portid2str(from));
 				return -1;
 			}
 			if (outport == 0) {
@@ -300,8 +302,10 @@ find_route(ib_portid_t *from, ib_portid_t *to, int dump)
 
 			DEBUG("ca or router node");
 			if (!sameport(port, &fromport)) {
-				IBWARN("can't continue: reached CA or router port %" PRIx64 ", lid %d",
-					port->portguid, port->lid);
+				IBWARN
+				    ("can't continue: reached CA or router port %"
+				     PRIx64 ", lid %d", port->portguid,
+				     port->lid);
 				return -1;
 			}
 			/* we are at CA or router "from" - go one hop back to (hopefully) a switch */
@@ -310,16 +314,19 @@ find_route(ib_portid_t *from, ib_portid_t *to, int dump)
 				from->drpath.cnt--;
 			} else {
 				ca_src = 1;
-				if (portnum && extend_dpath(&from->drpath, portnum) < 0)
+				if (portnum
+				    && extend_dpath(&from->drpath, portnum) < 0)
 					goto badpath;
 			}
 			if (get_node(&nextnode, &nextport, from) < 0) {
-				IBWARN("can't reach port at %s", portid2str(from));
+				IBWARN("can't reach port at %s",
+				       portid2str(from));
 				return -1;
 			}
 			/* fix port num to be seen from the CA or router side */
 			if (!ca_src)
-				nextport.portnum = from->drpath.p[from->drpath.cnt+1];
+				nextport.portnum =
+				    from->drpath.p[from->drpath.cnt + 1];
 		}
 		port = &nextport;
 		if (port->state != 4)
@@ -338,22 +345,22 @@ find_route(ib_portid_t *from, ib_portid_t *to, int dump)
 
 badport:
 	IBWARN("Bad port state found: node \"%s\" port %d state %d",
-		clean_nodedesc(node->nodedesc), portnum, port->state);
+	       clean_nodedesc(node->nodedesc), portnum, port->state);
 	return -1;
 badoutport:
 	IBWARN("Bad out port state found: node \"%s\" outport %d state %d",
-		clean_nodedesc(node->nodedesc), outport, port->state);
+	       clean_nodedesc(node->nodedesc), outport, port->state);
 	return -1;
 badtbl:
-	IBWARN("Bad forwarding table entry found at: node \"%s\" lid entry %d is %d (top %d)",
-		clean_nodedesc(node->nodedesc), to->lid, outport, sw.linearFDBtop);
+	IBWARN
+	    ("Bad forwarding table entry found at: node \"%s\" lid entry %d is %d (top %d)",
+	     clean_nodedesc(node->nodedesc), to->lid, outport, sw.linearFDBtop);
 	return -1;
 badpath:
 	IBWARN("Direct path too long!");
 	return -1;
 }
 
-
 /**************************
  * MC span part
  */
@@ -361,12 +368,11 @@ badpath:
 #define HASHGUID(guid)		((uint32_t)(((uint32_t)(guid) * 101) ^ ((uint32_t)((guid) >> 32) * 103)))
 #define HTSZ 137
 
-static int
-insert_node(Node *new)
+static int insert_node(Node * new)
 {
 	static Node *nodestbl[HTSZ];
 	int hash = HASHGUID(new->nodeguid) % HTSZ;
-	Node *node ;
+	Node *node;
 
 	for (node = nodestbl[hash]; node; node = node->htnext)
 		if (node->nodeguid == new->nodeguid) {
@@ -380,15 +386,15 @@ insert_node(Node *new)
 	return 0;
 }
 
-static int
-get_port(Port *port, int portnum, ib_portid_t *portid)
+static int get_port(Port * port, int portnum, ib_portid_t * portid)
 {
-	char portinfo[64];
+	char portinfo[64] = { 0 };
 	void *pi = portinfo;
 
 	port->portnum = portnum;
 
-	if (!smp_query(pi, portid, IB_ATTR_PORT_INFO, portnum, timeout))
+	if (!smp_query_via(pi, portid, IB_ATTR_PORT_INFO, portnum, timeout,
+			   srcport))
 		return -1;
 
 	mad_decode_field(pi, IB_PORT_LID_F, &port->lid);
@@ -397,24 +403,23 @@ get_port(Port *port, int portnum, ib_portid_t *portid)
 	mad_decode_field(pi, IB_PORT_PHYS_STATE_F, &port->physstate);
 
 	VERBOSE("portid %s portnum %d: lid %d state %d physstate %d",
-		portid2str(portid), portnum, port->lid, port->state, port->physstate);
+		portid2str(portid), portnum, port->lid, port->state,
+		port->physstate);
 	return 1;
 }
 
-static void
-link_port(Port *port, Node *node)
+static void link_port(Port * port, Node * node)
 {
 	port->next = node->ports;
 	node->ports = port;
 }
 
-static int
-new_node(Node *node, Port *port, ib_portid_t *path, int dist)
+static int new_node(Node * node, Port * port, ib_portid_t * path, int dist)
 {
 	if (port->portguid == target_portguid) {
-		node->dist = -1;		/* tag as target */
+		node->dist = -1;	/* tag as target */
 		link_port(port, node);
-		dump_endnode(verbose, "found target", node, port);
+		dump_endnode(ibverbose, "found target", node, port);
 		return 1;	/* found; */
 	}
 
@@ -422,7 +427,8 @@ new_node(Node *node, Port *port, ib_portid_t *path, int dist)
 	if (insert_node(node) < 0)
 		return -1;	/* known switch */
 
-	VERBOSE("insert dist %d node %p port %d lid %d", dist, node, port->portnum, port->lid);
+	VERBOSE("insert dist %d node %p port %d lid %d", dist, node,
+		port->portnum, port->lid);
 
 	link_port(port, node);
 
@@ -434,33 +440,36 @@ new_node(Node *node, Port *port, ib_portid_t *path, int dist)
 	return 0;
 }
 
-static int
-switch_mclookup(Node *node, ib_portid_t *portid, int mlid, char *map)
+static int switch_mclookup(Node * node, ib_portid_t * portid, int mlid,
+			   char *map)
 {
 	Switch sw;
 	char mdb[64];
 	void *si = sw.switchinfo;
-	uint16_t *msets = (uint16_t *)mdb;
+	uint16_t *msets = (uint16_t *) mdb;
 	int maxsets, block, i, set;
 
 	memset(map, 0, 256);
 
-	if (!smp_query(si, portid, IB_ATTR_SWITCH_INFO, 0, timeout))
+	memset(si, 0, sizeof(sw.switchinfo));
+	if (!smp_query_via(si, portid, IB_ATTR_SWITCH_INFO, 0, timeout,
+			   srcport))
 		return -1;
 
 	mlid -= 0xc000;
 
 	mad_decode_field(si, IB_SW_MCAST_FDB_CAP_F, &sw.mccap);
 
-	if (mlid > sw.mccap)
+	if (mlid >= sw.mccap)
 		return -1;
 
 	block = mlid / 32;
-	maxsets = (node->numports + 15) / 16;		/* round up */
+	maxsets = (node->numports + 15) / 16;	/* round up */
 
 	for (set = 0; set < maxsets; set++) {
-		if (!smp_query(mdb, portid, IB_ATTR_MULTICASTFORWTBL,
-		    block | (set << 28), timeout))
+		memset(mdb, 0, sizeof(mdb));
+		if (!smp_query_via(mdb, portid, IB_ATTR_MULTICASTFORWTBL,
+				   block | (set << 28), timeout, srcport))
 			return -1;
 
 		for (i = 0; i < 16; i++, map++) {
@@ -469,7 +478,8 @@ switch_mclookup(Node *node, ib_portid_t *portid, int mlid, char *map)
 				*map = 1;
 			else
 				continue;
-			VERBOSE("Switch guid 0x%" PRIx64 ": mlid 0x%x is forwarded to port %d",
+			VERBOSE("Switch guid 0x%" PRIx64
+				": mlid 0x%x is forwarded to port %d",
 				node->nodeguid, mlid + 0xc000, i + set * 16);
 		}
 	}
@@ -480,8 +490,7 @@ switch_mclookup(Node *node, ib_portid_t *portid, int mlid, char *map)
 /*
  * Return 1 if found, 0 if not, -1 on errors.
  */
-static Node *
-find_mcpath(ib_portid_t *from, int mlid)
+static Node *find_mcpath(ib_portid_t * from, int mlid)
 {
 	Node *node, *remotenode;
 	Port *port, *remoteport;
@@ -503,15 +512,14 @@ find_mcpath(ib_portid_t *from, int mlid)
 		return 0;
 	}
 
-	node->upnode = 0;		/* root */
+	node->upnode = 0;	/* root */
 	if ((r = new_node(node, port, from, 0)) > 0) {
 		if (node->type != IB_NODE_SWITCH) {
 			IBWARN("ibtracert from CA to CA is unsupported");
 			return 0;	/* ibtracert from host to itself is unsupported */
 		}
 
-		if (switch_mclookup(node, from, mlid, map) < 0 ||
-		    !map[0])
+		if (switch_mclookup(node, from, mlid, map) < 0 || !map[0])
 			return 0;
 		return node;
 	}
@@ -523,7 +531,8 @@ find_mcpath(ib_portid_t *from, int mlid)
 			path = &node->path;
 
 			VERBOSE("dist %d node %p", dist, node);
-			dump_endnode(verbose, "processing", node, node->ports);
+			dump_endnode(ibverbose, "processing", node,
+				     node->ports);
 
 			memset(map, 0, sizeof(map));
 
@@ -533,8 +542,10 @@ find_mcpath(ib_portid_t *from, int mlid)
 				leafport = path->drpath.p[path->drpath.cnt];
 				map[port->portnum] = 1;
 				node->upport = 0;	/* starting here */
-				DEBUG("Starting from CA 0x%" PRIx64 " lid %d port %d (leafport %d)",
-					node->nodeguid, port->lid, port->portnum, leafport);
+				DEBUG("Starting from CA 0x%" PRIx64
+				      " lid %d port %d (leafport %d)",
+				      node->nodeguid, port->lid, port->portnum,
+				      leafport);
 			} else {	/* switch */
 
 				/* if starting from a leaf port fix up port (up port) */
@@ -542,8 +553,8 @@ find_mcpath(ib_portid_t *from, int mlid)
 					node->upport = leafport;
 
 				if (switch_mclookup(node, path, mlid, map) < 0) {
-					IBWARN("skipping bad Switch 0x%" PRIx64 "",
-						node->nodeguid);
+					IBWARN("skipping bad Switch 0x%" PRIx64
+					       "", node->nodeguid);
 					continue;
 				}
 			}
@@ -560,7 +571,9 @@ find_mcpath(ib_portid_t *from, int mlid)
 						IBERROR("out of memory");
 
 					if (get_port(port, i, path) < 0) {
-						IBWARN("can't reach node %s port %d", portid2str(path), i);
+						IBWARN
+						    ("can't reach node %s port %d",
+						     portid2str(path), i);
 						return 0;
 					}
 
@@ -568,7 +581,6 @@ find_mcpath(ib_portid_t *from, int mlid)
 						free(port);
 						continue;
 					}
-
 #if 0
 					link_port(port, node);
 #endif
@@ -584,8 +596,9 @@ find_mcpath(ib_portid_t *from, int mlid)
 					IBERROR("out of memory");
 
 				if (get_node(remotenode, remoteport, path) < 0) {
-					IBWARN("NodeInfo on %s port %d failed, skipping port",
-						portid2str(path), i);
+					IBWARN
+					    ("NodeInfo on %s port %d failed, skipping port",
+					     portid2str(path), i);
 					path->drpath.cnt--;	/* restore path */
 					free(remotenode);
 					free(remoteport);
@@ -596,15 +609,17 @@ find_mcpath(ib_portid_t *from, int mlid)
 				remotenode->upport = remoteport->portnum;
 				remoteport->remoteport = port;
 
-				if ((r = new_node(remotenode, remoteport, path, dist+1)) > 0)
+				if ((r = new_node(remotenode, remoteport, path,
+						  dist + 1)) > 0)
 					return remotenode;
 
 				if (r == 0)
-					dump_endnode(verbose, "new remote",
-						remotenode, remoteport);
+					dump_endnode(ibverbose, "new remote",
+						     remotenode, remoteport);
 				else if (remotenode->type == IB_NODE_SWITCH)
-					dump_endnode(2, "ERR: circle discovered at",
-						remotenode, remoteport);
+					dump_endnode(2,
+						     "ERR: circle discovered at",
+						     remotenode, remoteport);
 
 				path->drpath.cnt--;	/* restore path */
 			}
@@ -614,8 +629,7 @@ find_mcpath(ib_portid_t *from, int mlid)
 	return 0;		/* not found */
 }
 
-static uint64_t
-find_target_portguid(ib_portid_t *to)
+static uint64_t find_target_portguid(ib_portid_t * to)
 {
 	Node tonode;
 	Port toport;
@@ -628,54 +642,58 @@ find_target_portguid(ib_portid_t *to)
 	return toport.portguid;
 }
 
-static void
-dump_mcpath(Node *node, int dumplevel)
+static void dump_mcpath(Node * node, int dumplevel)
 {
 	char *nodename = NULL;
 
 	if (node->upnode)
 		dump_mcpath(node->upnode, dumplevel);
 
-	nodename = remap_node_name(node_name_map, node->nodeguid, node->nodedesc);
+	nodename =
+	    remap_node_name(node_name_map, node->nodeguid, node->nodedesc);
 
 	if (!node->dist) {
 		printf("From %s 0x%" PRIx64 " port %d lid %u-%u \"%s\"\n",
-			(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-			node->nodeguid, node->ports->portnum, node->ports->lid,
-			node->ports->lid + (1 << node->ports->lmc) - 1,
-			nodename);
+		       (node->type <=
+			IB_NODE_MAX ? node_type_str[node->type] : "???"),
+		       node->nodeguid, node->ports->portnum, node->ports->lid,
+		       node->ports->lid + (1 << node->ports->lmc) - 1,
+		       nodename);
 		goto free_name;
 	}
 
 	if (node->dist) {
 		if (dumplevel == 1)
 			printf("[%d] -> %s {0x%016" PRIx64 "}[%d]\n",
-				node->ports->remoteport->portnum,
-				(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-				node->nodeguid, node->upport);
+			       node->ports->remoteport->portnum,
+			       (node->type <=
+				IB_NODE_MAX ? node_type_str[node->type] :
+				"???"), node->nodeguid, node->upport);
 		else
 			printf("[%d] -> %s 0x%" PRIx64 "[%d] lid %u \"%s\"\n",
-				node->ports->remoteport->portnum,
-				(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-				node->nodeguid, node->upport,
-				node->ports->lid, nodename);
+			       node->ports->remoteport->portnum,
+			       (node->type <=
+				IB_NODE_MAX ? node_type_str[node->type] :
+				"???"), node->nodeguid, node->upport,
+			       node->ports->lid, nodename);
 	}
 
 	if (node->dist < 0)
-	/* target node */
+		/* target node */
 		printf("To %s 0x%" PRIx64 " port %d lid %u-%u \"%s\"\n",
-			(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
-			node->nodeguid, node->ports->portnum, node->ports->lid,
-			node->ports->lid + (1 << node->ports->lmc) - 1,
-			nodename);
+		       (node->type <=
+			IB_NODE_MAX ? node_type_str[node->type] : "???"),
+		       node->nodeguid, node->ports->portnum, node->ports->lid,
+		       node->ports->lid + (1 << node->ports->lmc) - 1,
+		       nodename);
 
 free_name:
 	free(nodename);
 }
 
-static int resolve_lid(ib_portid_t  *portid, const void *srcport)
+static int resolve_lid(ib_portid_t * portid, const void *srcport)
 {
-	uint8_t portinfo[64];
+	uint8_t portinfo[64] = { 0 };
 	uint16_t lid;
 
 	if (!smp_query_via(portinfo, portid, IB_ATTR_PORT_INFO, 0, 0, srcport))
@@ -687,140 +705,88 @@ static int resolve_lid(ib_portid_t  *portid, const void *srcport)
 	return 0;
 }
 
-static void
-usage(void)
-{
-	char *basename;
+static int dumplevel = 2, multicast, mlid;
 
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -v(erbose) -D(irect) -G(uids) -n(o_info) -C ca_name -P ca_port "
-			"-s smlid -t(imeout) timeout_ms -m mlid --node-name-map node-name-map ] <src-addr> <dest-addr>\n",
-			basename);
-	fprintf(stderr, "\n\tUnicast examples:\n");
-	fprintf(stderr, "\t\t%s 4 16\t\t\t# show path between lids 4 and 16\n", basename);
-	fprintf(stderr, "\t\t%s -n 4 16\t\t# same, but using simple output format\n", basename);
-	fprintf(stderr, "\t\t%s -G 0x8f1040396522d 0x002c9000100d051\t# use guid addresses\n", basename);
-
-	fprintf(stderr, "\n\tMulticast example:\n");
-	fprintf(stderr, "\t\t%s -m 0xc000 4 16\t# show multicast path of mlid 0xc000 between lids 4 and 16\n", basename);
-	exit(-1);
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
+	case 'm':
+		multicast++;
+		mlid = strtoul(optarg, 0, 0);
+		break;
+	case 'f':
+		force++;
+		break;
+	case 'n':
+		dumplevel = 1;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
-	ib_portid_t my_portid = {0};
-	ib_portid_t src_portid = {0};
-	ib_portid_t dest_portid = {0};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	int dumplevel = 2, dest_type = IB_DEST_LID, multicast = 0, mlid = 0;
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
+	ib_portid_t my_portid = { 0 };
+	ib_portid_t src_portid = { 0 };
+	ib_portid_t dest_portid = { 0 };
 	Node *endnode;
-	int udebug = 0;
-	char *ca = 0;
-	int ca_port = 0;
-
-	static char const str_opts[] = "C:P:t:s:m:dvfDGnVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "verbose", 0, 0, 'v'},
-		{ "force", 0, 0, 'f'},
-		{ "Direct", 0, 0, 'D'},
-		{ "Guids", 0, 0, 'G'},
-		{ "no_info", 0, 0, 'n'},
-		{ "timeout", 1, 0, 't'},
-		{ "s", 1, 0, 's'},
-		{ "m", 1, 0, 'm'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ "node-name-map", 1, 0, 1},
-		{ }
+
+	const struct ibdiag_opt opts[] = {
+		{"force", 'f', 0, NULL, "force"},
+		{"no_info", 'n', 0, NULL, "simple format"},
+		{"mlid", 'm', 1, "<mlid>", "multicast trace of the mlid"},
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
+		{0}
+	};
+	char usage_args[] = "<src-addr> <dest-addr>";
+	const char *usage_examples[] = {
+		"- Unicast examples:",
+		"4 16\t\t\t# show path between lids 4 and 16",
+		"-n 4 16\t\t# same, but using simple output format",
+		"-G 0x8f1040396522d 0x002c9000100d051\t# use guid addresses",
+
+		" - Multicast examples:",
+		"-m 0xc000 4 16\t# show multicast path of mlid 0xc000 between lids 4 and 16",
+		NULL,
 	};
 
-	argv0 = argv[0];
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
+			    usage_args, usage_examples);
 
 	f = stdout;
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 1:
-			node_name_map_file = strdup(optarg);
-			break;
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'D':
-			dest_type = IB_DEST_DRPATH;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'm':
-			multicast++;
-			mlid = strtoul(optarg, 0, 0);
-			break;
-		case 'f':
-			force++;
-			break;
-		case 'n':
-			dumplevel = 1;
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'v':
-			madrpc_show_errors(1);
-			verbose++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
 	if (argc < 2)
-		usage();
+		ibdiag_show_usage();
+
+	if (ibd_timeout)
+		timeout = ibd_timeout;
+
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
 	node_name_map = open_node_name_map(node_name_map_file);
 
-	if (ib_resolve_portid_str(&src_portid, argv[0], dest_type, sm_id) < 0)
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &src_portid, argv[0],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve source port %s", argv[0]);
 
-	if (ib_resolve_portid_str(&dest_portid, argv[1], dest_type, sm_id) < 0)
+	if (resolve_portid_str(ibd_ca, ibd_ca_port, &dest_portid, argv[1],
+			       ibd_dest_type, ibd_sm_id, srcport) < 0)
 		IBERROR("can't resolve destination port %s", argv[1]);
 
-	if (dest_type == IB_DEST_DRPATH) {
+	if (ibd_dest_type == IB_DEST_DRPATH) {
 		if (resolve_lid(&src_portid, NULL) < 0)
 			IBERROR("cannot resolve lid for port \'%s\'",
 				portid2str(&src_portid));
@@ -831,10 +797,10 @@ main(int argc, char **argv)
 
 	if (dest_portid.lid == 0 || src_portid.lid == 0) {
 		IBWARN("bad src/dest lid");
-		usage();
+		ibdiag_show_usage();
 	}
 
-	if (dest_type != IB_DEST_DRPATH) {
+	if (ibd_dest_type != IB_DEST_DRPATH) {
 		/* first find a direct path to the src port */
 		if (find_route(&my_portid, &src_portid, 0) < 0)
 			IBERROR("can't find a route to the src port");
@@ -861,5 +827,8 @@ main(int argc, char **argv)
 	dump_mcpath(endnode, dumplevel);
 
 	close_node_name_map(node_name_map);
+
+	mad_rpc_close_port(srcport);
+
 	exit(0);
 }
diff --git a/src/mcm_rereg_test.c b/src/mcm_rereg_test.c
index 9285b95..a8cce8b 100644
--- a/src/mcm_rereg_test.c
+++ b/src/mcm_rereg_test.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2006-2009 Voltaire, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -31,6 +31,10 @@
  *
  */
 
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -38,55 +42,40 @@
 
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
+#include <infiniband/iba/ib_types.h>
+
+#include "ibdiag_common.h"
 
-#define info(fmt, arg...) fprintf(stderr, "INFO: " fmt, ##arg )
-#define err(fmt, arg...) fprintf(stderr, "ERR: " fmt, ##arg )
+#define info(fmt, ...) fprintf(stderr, "INFO: " fmt, ## __VA_ARGS__ )
+#define err(fmt, ...) fprintf(stderr, "ERR: " fmt, ## __VA_ARGS__ )
 #ifdef NOISY_DEBUG
-#define dbg(fmt, arg...) fprintf(stderr, "DBG: " fmt, ##arg )
+#define dbg(fmt, ...) fprintf(stderr, "DBG: " fmt, ## __VA_ARGS__ )
 #else
-#define dbg(fmt, arg...)
+#define dbg(fmt, ...)
 #endif
 
 #define TMO 100
 
-/* Multicast Member Record Component Masks */
-#define IB_MCR_COMPMASK_MGID        (1ULL<<0)
-#define IB_MCR_COMPMASK_PORT_GID    (1ULL<<1)
-#define IB_MCR_COMPMASK_QKEY        (1ULL<<2)
-#define IB_MCR_COMPMASK_MLID        (1ULL<<3)
-#define IB_MCR_COMPMASK_MTU_SEL     (1ULL<<4)
-#define IB_MCR_COMPMASK_MTU         (1ULL<<5)
-#define IB_MCR_COMPMASK_TCLASS      (1ULL<<6)
-#define IB_MCR_COMPMASK_PKEY        (1ULL<<7)
-#define IB_MCR_COMPMASK_RATE_SEL    (1ULL<<8)
-#define IB_MCR_COMPMASK_RATE        (1ULL<<9)
-#define IB_MCR_COMPMASK_LIFE_SEL    (1ULL<<10)
-#define IB_MCR_COMPMASK_LIFE        (1ULL<<11)
-#define IB_MCR_COMPMASK_SL          (1ULL<<12)
-#define IB_MCR_COMPMASK_FLOW        (1ULL<<13)
-#define IB_MCR_COMPMASK_HOP         (1ULL<<14)
-#define IB_MCR_COMPMASK_SCOPE       (1ULL<<15)
-#define IB_MCR_COMPMASK_JOIN_STATE  (1ULL<<16)
-#define IB_MCR_COMPMASK_PROXY       (1ULL<<17)
-
 static ibmad_gid_t mgid_ipoib = {
 	0xff, 0x12, 0x40, 0x1b, 0xff, 0xff, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
 };
 
-uint64_t build_mcm_rec(uint8_t *data, ibmad_gid_t mgid, ibmad_gid_t port_gid)
+struct ibmad_port *srcport;
+
+uint64_t build_mcm_rec(uint8_t * data, ibmad_gid_t mgid, ibmad_gid_t port_gid)
 {
 	memset(data, 0, IB_SA_DATA_SIZE);
 	mad_set_array(data, 0, IB_SA_MCM_MGID_F, mgid);
 	mad_set_array(data, 0, IB_SA_MCM_PORTGID_F, port_gid);
 	mad_set_field(data, 0, IB_SA_MCM_JOIN_STATE_F, 1);
 
-	return IB_MCR_COMPMASK_MGID|IB_MCR_COMPMASK_PORT_GID|
-		IB_MCR_COMPMASK_JOIN_STATE;
+	return IB_MCR_COMPMASK_MGID | IB_MCR_COMPMASK_PORT_GID |
+	    IB_MCR_COMPMASK_JOIN_STATE;
 }
 
-static void build_mcm_rec_umad(void *umad, ib_portid_t *dport, int method,
-			       uint64_t comp_mask, uint8_t *data)
+static void build_mcm_rec_umad(void *umad, ib_portid_t * dport, int method,
+			       uint64_t comp_mask, uint8_t * data)
 {
 	ib_rpc_t rpc;
 
@@ -94,7 +83,7 @@ static void build_mcm_rec_umad(void *umad, ib_portid_t *dport, int method,
 	rpc.mgtclass = IB_SA_CLASS;
 	rpc.method = method;
 	rpc.attr.id = IB_SA_ATTR_MCRECORD;
-	rpc.attr.mod = 0; // ???
+	rpc.attr.mod = 0;	// ???
 	rpc.mask = comp_mask;
 	rpc.datasz = IB_SA_DATA_SIZE;
 	rpc.dataoffs = IB_SA_DATA_OFFS;
@@ -102,8 +91,8 @@ static void build_mcm_rec_umad(void *umad, ib_portid_t *dport, int method,
 	mad_build_pkt(umad, &rpc, dport, NULL, data);
 }
 
-static int rereg_send(int port, int agent, ib_portid_t *dport,
-		      uint8_t *umad, int len, int method, ibmad_gid_t port_gid)
+static int rereg_send(int port, int agent, ib_portid_t * dport,
+		      uint8_t * umad, int len, int method, ibmad_gid_t port_gid)
 {
 	uint8_t data[IB_SA_DATA_SIZE];
 	uint64_t comp_mask;
@@ -111,8 +100,10 @@ static int rereg_send(int port, int agent, ib_portid_t *dport,
 	comp_mask = build_mcm_rec(data, mgid_ipoib, port_gid);
 
 	build_mcm_rec_umad(umad, dport, method, comp_mask, data);
-	if(umad_send(port, agent, umad, len, TMO, 0) < 0) {
-		err("umad_send leave failed: %s\n", strerror(errno));
+	if (umad_send(port, agent, umad, len, TMO, 0) < 0) {
+		err("umad_send %s failed: %s\n",
+		    (method == IB_MAD_METHOD_GET) ? "query" : "non query",
+		    strerror(errno));
 		return -1;
 	}
 	dbg("umad_send %d: tid = 0x%016" PRIx64 "\n", method,
@@ -121,26 +112,24 @@ static int rereg_send(int port, int agent, ib_portid_t *dport,
 	return 0;
 }
 
-static int rereg_port_gid(int port, int agent, ib_portid_t *dport,
-			  uint8_t *umad, int len, ibmad_gid_t port_gid)
+static int rereg_port_gid(int port, int agent, ib_portid_t * dport,
+			  uint8_t * umad, int len, ibmad_gid_t port_gid)
 {
 	uint8_t data[IB_SA_DATA_SIZE];
 	uint64_t comp_mask;
 
 	comp_mask = build_mcm_rec(data, mgid_ipoib, port_gid);
 
-	build_mcm_rec_umad(umad, dport, IB_MAD_METHOD_DELETE,
-			   comp_mask, data);
-	if(umad_send(port, agent, umad, len, TMO, 0) < 0) {
+	build_mcm_rec_umad(umad, dport, IB_MAD_METHOD_DELETE, comp_mask, data);
+	if (umad_send(port, agent, umad, len, TMO, 0) < 0) {
 		err("umad_send leave failed: %s\n", strerror(errno));
 		return -1;
 	}
 	dbg("umad_send leave: tid = 0x%016" PRIx64 "\n",
 	    mad_get_field64(umad_get_mad(umad), 0, IB_MAD_TRID_F));
 
-	build_mcm_rec_umad(umad, dport, IB_MAD_METHOD_SET,
-			   comp_mask, data);
-	if(umad_send(port, agent, umad, len, TMO, 0) < 0) {
+	build_mcm_rec_umad(umad, dport, IB_MAD_METHOD_SET, comp_mask, data);
+	if (umad_send(port, agent, umad, len, TMO, 0) < 0) {
 		err("umad_send join failed: %s\n", strerror(errno));
 		return -1;
 	}
@@ -156,12 +145,13 @@ struct guid_trid {
 	uint64_t trid;
 };
 
-static int rereg_send_all(int port, int agent, ib_portid_t *dport,
+static int rereg_send_all(int port, int agent, ib_portid_t * dport,
 			  struct guid_trid *list, unsigned cnt)
 {
 	uint8_t *umad;
 	int len = umad_size() + 256;
-	int i, ret;
+	unsigned i;
+	int ret;
 
 	info("rereg_send_all... cnt = %u\n", cnt);
 
@@ -172,59 +162,32 @@ static int rereg_send_all(int port, int agent, ib_portid_t *dport,
 	}
 
 	for (i = 0; i < cnt; i++) {
-		ret = rereg_port_gid(port, agent, dport, umad, len, list[i].gid);
+		ret =
+		    rereg_port_gid(port, agent, dport, umad, len, list[i].gid);
 		if (ret < 0) {
 			err("rereg_send_all: rereg_port_gid 0x%016" PRIx64
-			    " failed\n", list[i].guid);
+			    " failed\n", ntohll(list[i].guid));
 			continue;
 		}
 		list[i].trid = mad_get_field64(umad_get_mad(umad), 0,
 					       IB_MAD_TRID_F);
 	}
 
-	info("rereg_send_all: sent %u requests\n", cnt*2);
+	info("rereg_send_all: sent %u requests\n", cnt * 2);
 
 	free(umad);
 
 	return 0;
 }
 
-#if 0
-static int rereg_mcm_rec_send(int port, int agent, ib_portid_t *dport, int cnt)
-{
-	ib_portid_t portid;
-	ibmad_gid_t port_gid;
-	uint8_t *umad;
-	int len, ret = 0;
-
-	ib_resolve_self(&portid, NULL, &port_gid);
-
-	len = umad_size() + 256;
-	umad = calloc(1, len);
-	if (!umad) {
-		err("cannot alloc mem for umad: %s\n", strerror(errno));
-		return -1;
-	}
-
-	while(cnt--) {
-		if (!rereg_port_gid(port, agent, dport, umad, len, port_gid))
-			ret += 2;
-	}
-
-	free(umad);
-
-	return ret;
-}
-#endif
-
-static int rereg_recv(int port, int agent, ib_portid_t *dport,
-		      uint8_t *umad, int length, int tmo)
+static int rereg_recv(int port, int agent, ib_portid_t * dport,
+		      uint8_t * umad, int length, int tmo)
 {
 	int ret, retry = 0;
 	int len = length;
 
-	while((ret = umad_recv(port, umad, &len, tmo)) < 0 &&
-	      errno == ETIMEDOUT) {
+	while ((ret = umad_recv(port, umad, &len, tmo)) < 0 &&
+	       errno == ETIMEDOUT) {
 		if (retry++ > 3)
 			return 0;
 	}
@@ -232,22 +195,22 @@ static int rereg_recv(int port, int agent, ib_portid_t *dport,
 		err("umad_recv %d failed: %s\n", ret, strerror(errno));
 		return -1;
 	}
-	dbg("umad_recv (retries %d), tid = 0x%016" PRIx64 ": len = %d, status = %d\n",
-	    retry,
-	    mad_get_field64(umad_get_mad(umad), 0, IB_MAD_TRID_F),
-	    len, umad_status(umad));
+	dbg("umad_recv (retries %d), tid = 0x%016" PRIx64
+	    ": len = %d, status = %d\n", retry,
+	    mad_get_field64(umad_get_mad(umad), 0, IB_MAD_TRID_F), len,
+	    umad_status(umad));
 
 	return 1;
 }
 
-static int rereg_recv_all(int port, int agent, ib_portid_t *dport,
+static int rereg_recv_all(int port, int agent, ib_portid_t * dport,
 			  struct guid_trid *list, unsigned cnt)
 {
 	uint8_t *umad, *mad;
 	int len = umad_size() + 256;
 	uint64_t trid;
 	unsigned n, method, status;
-	int i;
+	unsigned i;
 
 	info("rereg_recv_all...\n");
 
@@ -270,7 +233,7 @@ static int rereg_recv_all(int port, int agent, ib_portid_t *dport,
 			dbg("MAD status %x, method %x\n", status, method);
 
 		if (status &&
-		    (method&0x7f) == (IB_MAD_METHOD_GET_RESPONSE&0x7f)) {
+		    (method & 0x7f) == (IB_MAD_METHOD_GET_RESPONSE & 0x7f)) {
 			trid = mad_get_field64(mad, 0, IB_MAD_TRID_F);
 			for (i = 0; i < cnt; i++)
 				if (trid == list[i].trid)
@@ -280,12 +243,14 @@ static int rereg_recv_all(int port, int agent, ib_portid_t *dport,
 				    trid);
 				continue;
 			}
-			info("guid 0x%016" PRIx64 ": method = %x status = %x. Resending\n",
+			info("guid 0x%016" PRIx64
+			     ": method = %x status = %x. Resending\n",
 			     ntohll(list[i].guid), method, status);
 			rereg_port_gid(port, agent, dport, umad, len,
 				       list[i].gid);
-			list[i].trid = mad_get_field64(umad_get_mad(umad), 0,
-						       IB_MAD_TRID_F);
+			list[i].trid =
+			    mad_get_field64(umad_get_mad(umad), 0,
+					    IB_MAD_TRID_F);
 		}
 	}
 
@@ -295,13 +260,14 @@ static int rereg_recv_all(int port, int agent, ib_portid_t *dport,
 	return 0;
 }
 
-static int rereg_query_all(int port, int agent, ib_portid_t *dport,
+static int rereg_query_all(int port, int agent, ib_portid_t * dport,
 			   struct guid_trid *list, unsigned cnt)
 {
 	uint8_t *umad, *mad;
 	int len = umad_size() + 256;
 	unsigned method, status;
-	int i, ret;
+	unsigned i;
+	int ret;
 
 	info("rereg_query_all...\n");
 
@@ -311,7 +277,7 @@ static int rereg_query_all(int port, int agent, ib_portid_t *dport,
 		return -1;
 	}
 
-	for ( i = 0; i < cnt; i++ ) {
+	for (i = 0; i < cnt; i++) {
 		ret = rereg_send(port, agent, dport, umad, len,
 				 IB_MAD_METHOD_GET, list[i].gid);
 		if (ret < 0) {
@@ -341,57 +307,23 @@ static int rereg_query_all(int port, int agent, ib_portid_t *dport,
 	return 0;
 }
 
-#if 0
-static int rereg_mcm_rec_recv(int port, int agent, int cnt)
-{
-	uint8_t *umad, *mad;
-	int len = umad_size() + 256;
-	int i;
-
-	umad = calloc(1, len);
-	if (!umad) {
-		err("cannot alloc mem for umad: %s\n", strerror(errno));
-		return -1;
-	}
-
-	for ( i = 0; i < cnt; i++ ) {
-		int retry;
-		retry = 0;
-		while (umad_recv(port, umad, &len, TMO) < 0 &&
-		       errno == ETIMEDOUT)
-			if (retry++ > 3) {
-				err("umad_recv %d failed: %s\n",
-				    i, strerror(errno));
-				free(umad);
-				return -1;
-			}
-		dbg("umad_recv %d (retries %d), tid = 0x%016" PRIx64 ": len = %d, status = %d\n",
-		    i, retry,
-		    mad_get_field64(umad_get_mad(umad), 0, IB_MAD_TRID_F),
-		    len, umad_status(umad));
-		mad = umad_get_mad(umad);
-	}
-
-	free(umad);
-	return 0;
-}
-#endif
-
 #define MAX_CLIENTS 50
 
-static int rereg_and_test_port(char *guid_file, int port, int agent, ib_portid_t *dport, int timeout)
+static int rereg_and_test_port(char *guid_file, int port, int agent,
+			       ib_portid_t * dport, int timeout)
 {
 	char line[256];
 	FILE *f;
 	ibmad_gid_t port_gid;
-	uint64_t prefix = htonll(0xfe80000000000000llu);
-	uint64_t guid = htonll(0x0002c90200223825llu);
+	uint64_t prefix = htonll(0xfe80000000000000ull);
+	uint64_t guid = htonll(0x0002c90200223825ull);
 	struct guid_trid *list;
 	int i = 0;
 
 	list = calloc(MAX_CLIENTS, sizeof(*list));
 	if (!list) {
-		err("cannot alloc mem for guid/trid list: %s\n", strerror(errno));
+		err("cannot alloc mem for guid/trid list: %s\n",
+		    strerror(errno));
 		return -1;
 	}
 
@@ -427,7 +359,7 @@ static int rereg_and_test_port(char *guid_file, int port, int agent, ib_portid_t
 int main(int argc, char **argv)
 {
 	char *guid_file = "port_guids.list";
-	int mgmt_classes[2] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS};
+	int mgmt_classes[2] = { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS };
 	ib_portid_t dport_id;
 	int port, agent;
 	uint8_t *umad, *mad;
@@ -436,48 +368,26 @@ int main(int argc, char **argv)
 	if (argc > 1)
 		guid_file = argv[1];
 
-	madrpc_init(NULL, 0, mgmt_classes, 2);
+	srcport = mad_rpc_open_port(NULL, 0, mgmt_classes, 2);
+	if (!srcport)
+		err("Failed to open port");
 
-#if 1
-	ib_resolve_smlid(&dport_id, TMO);
-#else
-	memset(&dport_id, 0, sizeof(dport_id));
-	dport_id.lid = 1;
-#endif
+	resolve_sm_portid(NULL, 0, &dport_id);
 	dport_id.qp = 1;
 	if (!dport_id.qkey)
 		dport_id.qkey = IB_DEFAULT_QP1_QKEY;
 
-
 	len = umad_size() + 256;
 	umad = calloc(1, len);
 	if (!umad) {
 		err("cannot alloc mem for umad: %s\n", strerror(errno));
 		return -1;
 	}
-
-#if 1
-	port = madrpc_portid();
-#else
-	ret = umad_init();
-
-	port = umad_open_port(NULL, 0);
-	if (port < 0) {
-		err("umad_open_port failed: %s\n", strerror(errno));
-		return port;
-	}
-#endif
+	port = mad_rpc_portid(srcport);
 
 	agent = umad_register(port, IB_SA_CLASS, 2, 0, NULL);
 
-#if 0
-	int cnt;
-	cnt = rereg_mcm_rec_send(port, agent, &dport_id, cnt);
-
-	rereg_recv_all(port, agent, &dport_id);
-#else
 	rereg_and_test_port(guid_file, port, agent, &dport_id, TMO);
-#endif
 	mad = umad_get_mad(umad);
 
 	free(umad);
diff --git a/src/perfquery.c b/src/perfquery.c
index 7a53e92..32dd98f 100644
--- a/src/perfquery.c
+++ b/src/perfquery.c
@@ -1,6 +1,8 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
+ * Copyright (c) 2009 HNR Consulting.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -34,21 +36,22 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <getopt.h>
 #include <netinet/in.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
+#include <infiniband/iba/ib_types.h>
 
 #include "ibdiag_common.h"
 
+struct ibmad_port *srcport;
+
 struct perf_count {
 	uint32_t portselect;
 	uint32_t counterselect;
@@ -68,6 +71,7 @@ struct perf_count {
 	uint32_t rcvdata;
 	uint32_t xmtpkts;
 	uint32_t rcvpkts;
+	uint32_t xmtwait;
 };
 
 struct perf_count_ext {
@@ -85,41 +89,12 @@ struct perf_count_ext {
 
 static uint8_t pc[1024];
 
-struct perf_count perf_count = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-struct perf_count_ext perf_count_ext = {0,0,0,0,0,0,0,0,0,0};
-
-char *argv0 = "perfquery";
+struct perf_count perf_count =
+    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+struct perf_count_ext perf_count_ext = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 #define ALL_PORTS 0xFF
 
-static void
-usage(void)
-{
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -G(uid) -a(ll_ports) -l(oop_ports) -r(eset_after_read) -C ca_name -P ca_port "
-			"-R(eset_only) -t(imeout) timeout_ms -V(ersion) -h(elp)] [<lid|guid> [[port] [reset_mask]]]\n",
-			basename);
-	fprintf(stderr, "\tExamples:\n");
-	fprintf(stderr, "\t\t%s\t\t# read local port's performance counters\n", basename);
-	fprintf(stderr, "\t\t%s 32 1\t\t# read performance counters from lid 32, port 1\n", basename);
-	fprintf(stderr, "\t\t%s -e 32 1\t# read extended performance counters from lid 32, port 1\n", basename);
-	fprintf(stderr, "\t\t%s -a 32\t\t# read performance counters from lid 32, all ports\n", basename);
-	fprintf(stderr, "\t\t%s -r 32 1\t# read performance counters and reset\n", basename);
-	fprintf(stderr, "\t\t%s -e -r 32 1\t# read extended performance counters and reset\n", basename);
-	fprintf(stderr, "\t\t%s -R 0x20 1\t# reset performance counters of port 1 only\n", basename);
-	fprintf(stderr, "\t\t%s -e -R 0x20 1\t# reset extended performance counters of port 1 only\n", basename);
-	fprintf(stderr, "\t\t%s -R -a 32\t# reset performance counters of all ports\n", basename);
-	fprintf(stderr, "\t\t%s -R 32 2 0x0fff\t# reset only error counters of port 2\n", basename);
-	fprintf(stderr, "\t\t%s -R 32 2 0xf000\t# reset only non-error counters of port 2\n", basename);
-	exit(-1);
-}
-
 /* Notes: IB semantics is to cap counters if count has exceeded limits.
  * Therefore we must check for overflows and cap the counters if necessary.
  *
@@ -127,16 +102,15 @@ usage(void)
  * for fields < 32 bits in length.
  */
 
-static void aggregate_4bit(uint32_t *dest, uint32_t val)
+static void aggregate_4bit(uint32_t * dest, uint32_t val)
 {
-	if ((((*dest) + val) < (*dest))
-	    || ((*dest) + val) > 0xf)
+	if ((((*dest) + val) < (*dest)) || ((*dest) + val) > 0xf)
 		(*dest) = 0xf;
 	else
 		(*dest) = (*dest) + val;
 }
 
-static void aggregate_8bit(uint32_t *dest, uint32_t val)
+static void aggregate_8bit(uint32_t * dest, uint32_t val)
 {
 	if ((((*dest) + val) < (*dest))
 	    || ((*dest) + val) > 0xff)
@@ -145,7 +119,7 @@ static void aggregate_8bit(uint32_t *dest, uint32_t val)
 		(*dest) = (*dest) + val;
 }
 
-static void aggregate_16bit(uint32_t *dest, uint32_t val)
+static void aggregate_16bit(uint32_t * dest, uint32_t val)
 {
 	if ((((*dest) + val) < (*dest))
 	    || ((*dest) + val) > 0xffff)
@@ -154,7 +128,7 @@ static void aggregate_16bit(uint32_t *dest, uint32_t val)
 		(*dest) = (*dest) + val;
 }
 
-static void aggregate_32bit(uint32_t *dest, uint32_t val)
+static void aggregate_32bit(uint32_t * dest, uint32_t val)
 {
 	if (((*dest) + val) < (*dest))
 		(*dest) = 0xffffffff;
@@ -162,7 +136,7 @@ static void aggregate_32bit(uint32_t *dest, uint32_t val)
 		(*dest) = (*dest) + val;
 }
 
-static void aggregate_64bit(uint64_t *dest, uint64_t val)
+static void aggregate_64bit(uint64_t * dest, uint64_t val)
 {
 	if (((*dest) + val) < (*dest))
 		(*dest) = 0xffffffffffffffffULL;
@@ -176,43 +150,46 @@ static void aggregate_perfcounters(void)
 
 	mad_decode_field(pc, IB_PC_PORT_SELECT_F, &val);
 	perf_count.portselect = val;
-        mad_decode_field(pc, IB_PC_COUNTER_SELECT_F, &val);
+	mad_decode_field(pc, IB_PC_COUNTER_SELECT_F, &val);
 	perf_count.counterselect = val;
-        mad_decode_field(pc, IB_PC_ERR_SYM_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_SYM_F, &val);
 	aggregate_16bit(&perf_count.symbolerrors, val);
-        mad_decode_field(pc, IB_PC_LINK_RECOVERS_F, &val);
+	mad_decode_field(pc, IB_PC_LINK_RECOVERS_F, &val);
 	aggregate_8bit(&perf_count.linkrecovers, val);
-        mad_decode_field(pc, IB_PC_LINK_DOWNED_F, &val);
+	mad_decode_field(pc, IB_PC_LINK_DOWNED_F, &val);
 	aggregate_8bit(&perf_count.linkdowned, val);
-        mad_decode_field(pc, IB_PC_ERR_RCV_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_RCV_F, &val);
 	aggregate_16bit(&perf_count.rcverrors, val);
-        mad_decode_field(pc, IB_PC_ERR_PHYSRCV_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_PHYSRCV_F, &val);
 	aggregate_16bit(&perf_count.rcvremotephyerrors, val);
-        mad_decode_field(pc, IB_PC_ERR_SWITCH_REL_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_SWITCH_REL_F, &val);
 	aggregate_16bit(&perf_count.rcvswrelayerrors, val);
-        mad_decode_field(pc, IB_PC_XMT_DISCARDS_F, &val);
+	mad_decode_field(pc, IB_PC_XMT_DISCARDS_F, &val);
 	aggregate_16bit(&perf_count.xmtdiscards, val);
-        mad_decode_field(pc, IB_PC_ERR_XMTCONSTR_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_XMTCONSTR_F, &val);
 	aggregate_8bit(&perf_count.xmtconstrainterrors, val);
-        mad_decode_field(pc, IB_PC_ERR_RCVCONSTR_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_RCVCONSTR_F, &val);
 	aggregate_8bit(&perf_count.rcvconstrainterrors, val);
-        mad_decode_field(pc, IB_PC_ERR_LOCALINTEG_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_LOCALINTEG_F, &val);
 	aggregate_4bit(&perf_count.linkintegrityerrors, val);
-        mad_decode_field(pc, IB_PC_ERR_EXCESS_OVR_F, &val);
+	mad_decode_field(pc, IB_PC_ERR_EXCESS_OVR_F, &val);
 	aggregate_4bit(&perf_count.excbufoverrunerrors, val);
-        mad_decode_field(pc, IB_PC_VL15_DROPPED_F, &val);
+	mad_decode_field(pc, IB_PC_VL15_DROPPED_F, &val);
 	aggregate_16bit(&perf_count.vl15dropped, val);
-        mad_decode_field(pc, IB_PC_XMT_BYTES_F, &val);
+	mad_decode_field(pc, IB_PC_XMT_BYTES_F, &val);
 	aggregate_32bit(&perf_count.xmtdata, val);
-        mad_decode_field(pc, IB_PC_RCV_BYTES_F, &val);
+	mad_decode_field(pc, IB_PC_RCV_BYTES_F, &val);
 	aggregate_32bit(&perf_count.rcvdata, val);
-        mad_decode_field(pc, IB_PC_XMT_PKTS_F, &val);
+	mad_decode_field(pc, IB_PC_XMT_PKTS_F, &val);
 	aggregate_32bit(&perf_count.xmtpkts, val);
-        mad_decode_field(pc, IB_PC_RCV_PKTS_F, &val);
+	mad_decode_field(pc, IB_PC_RCV_PKTS_F, &val);
 	aggregate_32bit(&perf_count.rcvpkts, val);
+	mad_decode_field(pc, IB_PC_XMT_WAIT_F, &val);
+	aggregate_32bit(&perf_count.xmtwait, val);
 }
 
-static void output_aggregate_perfcounters(ib_portid_t *portid)
+static void output_aggregate_perfcounters(ib_portid_t * portid,
+					  uint16_t cap_mask)
 {
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
@@ -224,25 +201,33 @@ static void output_aggregate_perfcounters(ib_portid_t *portid)
 	mad_encode_field(pc, IB_PC_LINK_RECOVERS_F, &perf_count.linkrecovers);
 	mad_encode_field(pc, IB_PC_LINK_DOWNED_F, &perf_count.linkdowned);
 	mad_encode_field(pc, IB_PC_ERR_RCV_F, &perf_count.rcverrors);
-	mad_encode_field(pc, IB_PC_ERR_PHYSRCV_F, &perf_count.rcvremotephyerrors);
-	mad_encode_field(pc, IB_PC_ERR_SWITCH_REL_F, &perf_count.rcvswrelayerrors);
+	mad_encode_field(pc, IB_PC_ERR_PHYSRCV_F,
+			 &perf_count.rcvremotephyerrors);
+	mad_encode_field(pc, IB_PC_ERR_SWITCH_REL_F,
+			 &perf_count.rcvswrelayerrors);
 	mad_encode_field(pc, IB_PC_XMT_DISCARDS_F, &perf_count.xmtdiscards);
-	mad_encode_field(pc, IB_PC_ERR_XMTCONSTR_F, &perf_count.xmtconstrainterrors);
-	mad_encode_field(pc, IB_PC_ERR_RCVCONSTR_F, &perf_count.rcvconstrainterrors);
-	mad_encode_field(pc, IB_PC_ERR_LOCALINTEG_F, &perf_count.linkintegrityerrors);
-	mad_encode_field(pc, IB_PC_ERR_EXCESS_OVR_F, &perf_count.excbufoverrunerrors);
+	mad_encode_field(pc, IB_PC_ERR_XMTCONSTR_F,
+			 &perf_count.xmtconstrainterrors);
+	mad_encode_field(pc, IB_PC_ERR_RCVCONSTR_F,
+			 &perf_count.rcvconstrainterrors);
+	mad_encode_field(pc, IB_PC_ERR_LOCALINTEG_F,
+			 &perf_count.linkintegrityerrors);
+	mad_encode_field(pc, IB_PC_ERR_EXCESS_OVR_F,
+			 &perf_count.excbufoverrunerrors);
 	mad_encode_field(pc, IB_PC_VL15_DROPPED_F, &perf_count.vl15dropped);
 	mad_encode_field(pc, IB_PC_XMT_BYTES_F, &perf_count.xmtdata);
 	mad_encode_field(pc, IB_PC_RCV_BYTES_F, &perf_count.rcvdata);
 	mad_encode_field(pc, IB_PC_XMT_PKTS_F, &perf_count.xmtpkts);
 	mad_encode_field(pc, IB_PC_RCV_PKTS_F, &perf_count.rcvpkts);
+	mad_encode_field(pc, IB_PC_XMT_WAIT_F, &perf_count.xmtwait);
 
 	mad_dump_perfcounters(buf, sizeof buf, pc, sizeof pc);
 
-	printf("# Port counters: %s port %d\n%s", portid2str(portid), ALL_PORTS, buf);
+	printf("# Port counters: %s port %d (CapMask: 0x%02X)\n%s",
+	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void aggregate_perfcounters_ext(void)
+static void aggregate_perfcounters_ext(uint16_t cap_mask)
 {
 	uint32_t val;
 	uint64_t val64;
@@ -259,209 +244,608 @@ static void aggregate_perfcounters_ext(void)
 	aggregate_64bit(&perf_count_ext.portxmitpkts, val64);
 	mad_decode_field(pc, IB_PC_EXT_RCV_PKTS_F, &val64);
 	aggregate_64bit(&perf_count_ext.portrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
-	mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
-	mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
-	aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_decode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastxmitpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portunicastrcvpkts, val64);
+		mad_decode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastxmitpkits, val64);
+		mad_decode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &val64);
+		aggregate_64bit(&perf_count_ext.portmulticastrcvpkts, val64);
+	}
 }
 
-static void output_aggregate_perfcounters_ext(ib_portid_t *portid)
+static void output_aggregate_perfcounters_ext(ib_portid_t * portid,
+					      uint16_t cap_mask)
 {
 	char buf[1024];
 	uint32_t val = ALL_PORTS;
 
-        /* set port_select to 255 to emulate AllPortSelect */
-        mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
-	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F, &perf_count_ext.counterselect);
-	mad_encode_field(pc, IB_PC_EXT_XMT_BYTES_F, &perf_count_ext.portxmitdata);
-	mad_encode_field(pc, IB_PC_EXT_RCV_BYTES_F, &perf_count_ext.portrcvdata);
-	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F, &perf_count_ext.portxmitpkts);
+	memset(buf, 0, 1024);
+
+	/* set port_select to 255 to emulate AllPortSelect */
+	mad_encode_field(pc, IB_PC_EXT_PORT_SELECT_F, &val);
+	mad_encode_field(pc, IB_PC_EXT_COUNTER_SELECT_F,
+			 &perf_count_ext.counterselect);
+	mad_encode_field(pc, IB_PC_EXT_XMT_BYTES_F,
+			 &perf_count_ext.portxmitdata);
+	mad_encode_field(pc, IB_PC_EXT_RCV_BYTES_F,
+			 &perf_count_ext.portrcvdata);
+	mad_encode_field(pc, IB_PC_EXT_XMT_PKTS_F,
+			 &perf_count_ext.portxmitpkts);
 	mad_encode_field(pc, IB_PC_EXT_RCV_PKTS_F, &perf_count_ext.portrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F, &perf_count_ext.portunicastxmitpkts);
-	mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F, &perf_count_ext.portunicastrcvpkts);
-	mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F, &perf_count_ext.portmulticastxmitpkits);
-	mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F, &perf_count_ext.portmulticastrcvpkts);
+
+	if (cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) {
+		mad_encode_field(pc, IB_PC_EXT_XMT_UPKTS_F,
+				 &perf_count_ext.portunicastxmitpkts);
+		mad_encode_field(pc, IB_PC_EXT_RCV_UPKTS_F,
+				 &perf_count_ext.portunicastrcvpkts);
+		mad_encode_field(pc, IB_PC_EXT_XMT_MPKTS_F,
+				 &perf_count_ext.portmulticastxmitpkits);
+		mad_encode_field(pc, IB_PC_EXT_RCV_MPKTS_F,
+				 &perf_count_ext.portmulticastrcvpkts);
+	}
 
 	mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
 
-	printf("# Port counters: %s port %d\n%s", portid2str(portid), ALL_PORTS, buf);
+	printf("# Port extended counters: %s port %d (CapMask: 0x%02X)\n%s",
+	       portid2str(portid), ALL_PORTS, ntohs(cap_mask), buf);
 }
 
-static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask, ib_portid_t *portid,
-			      int port, int aggregate)
+static void dump_perfcounters(int extended, int timeout, uint16_t cap_mask,
+			      ib_portid_t * portid, int port, int aggregate)
 {
 	char buf[1024];
 
 	if (extended != 1) {
-		if (!port_performance_query(pc, portid, port, timeout))
+		memset(pc, 0, sizeof(pc));
+		if (!pma_query_via(pc, portid, port, timeout,
+				   IB_GSI_PORT_COUNTERS, srcport))
 			IBERROR("perfquery");
+		if (!(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)) {
+			/* if PortCounters:PortXmitWait not supported clear this counter */
+			VERBOSE("PortXmitWait not indicated"
+				" so ignore this counter");
+			perf_count.xmtwait = 0;
+			mad_encode_field(pc, IB_PC_XMT_WAIT_F,
+					 &perf_count.xmtwait);
+		}
 		if (aggregate)
 			aggregate_perfcounters();
 		else
-			mad_dump_perfcounters(buf, sizeof buf, pc, sizeof pc);
-	} else {
-		if (!(cap_mask & 0x200)) /* 1.2 errata: bit 9 is extended counter support */
-			IBWARN("PerfMgt ClassPortInfo 0x%x extended counters not indicated\n", cap_mask);
+			mad_dump_fields(buf, sizeof buf, pc, sizeof pc,
+							IB_PC_FIRST_F,
+							(cap_mask & IB_PM_PC_XMIT_WAIT_SUP)?IB_PC_LAST_F:(IB_PC_RCV_PKTS_F+1));
 
-		if (!port_performance_ext_query(pc, portid, port, timeout))
+	} else {
+		/* 1.2 errata: bit 9 is extended counter support
+		 * bit 10 is extended counter NoIETF
+		 */
+		if (!(cap_mask & IB_PM_EXT_WIDTH_SUPPORTED) &&
+		    !(cap_mask & IB_PM_EXT_WIDTH_NOIETF_SUP))
+			IBWARN
+			    ("PerfMgt ClassPortInfo 0x%x; No extended counter support indicated\n",
+			     ntohs(cap_mask));
+
+		memset(pc, 0, sizeof(pc));
+		if (!pma_query_via(pc, portid, port, timeout,
+				   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perfextquery");
 		if (aggregate)
-			aggregate_perfcounters_ext();
+			aggregate_perfcounters_ext(cap_mask);
 		else
-			mad_dump_perfcounters_ext(buf, sizeof buf, pc, sizeof pc);
+			mad_dump_perfcounters_ext(buf, sizeof buf, pc,
+						  sizeof pc);
 	}
 
-	if (!aggregate)
-		printf("# Port counters: %s port %d\n%s", portid2str(portid), port, buf);
+	if (!aggregate) {
+		if (extended)
+			printf("# Port extended counters: %s port %d "
+			       "(CapMask: 0x%02X)\n%s",
+			       portid2str(portid), port, ntohs(cap_mask), buf);
+		else
+			printf("# Port counters: %s port %d "
+			       "(CapMask: 0x%02X)\n%s",
+			       portid2str(portid), port, ntohs(cap_mask), buf);
+	}
 }
 
-static void reset_counters(int extended, int timeout, int mask, ib_portid_t *portid, int port)
+static void reset_counters(int extended, int timeout, int mask,
+			   ib_portid_t * portid, int port)
 {
+	memset(pc, 0, sizeof(pc));
 	if (extended != 1) {
-		if (!port_performance_reset(pc, portid, port, mask, timeout))
+		if (!performance_reset_via(pc, portid, port, mask, timeout,
+					   IB_GSI_PORT_COUNTERS, srcport))
 			IBERROR("perf reset");
 	} else {
-		if (!port_performance_ext_reset(pc, portid, port, mask, timeout))
+		if (!performance_reset_via(pc, portid, port, mask, timeout,
+					   IB_GSI_PORT_COUNTERS_EXT, srcport))
 			IBERROR("perf ext reset");
 	}
 }
 
-int
-main(int argc, char **argv)
-{
-	int mgmt_classes[4] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS, IB_PERFORMANCE_CLASS};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	ib_portid_t portid = {0};
-	extern int ibdebug;
-	int dest_type = IB_DEST_LID;
-	int timeout = 0;	/* use default */
-	int mask = 0xffff, all_ports = 0;
-	int reset = 0, reset_only = 0;
-	int port = 0;
-	int udebug = 0;
-	char *ca = 0;
-	int ca_port = 0;
-	int extended = 0;
+static int reset, reset_only, all_ports, loop_ports, port, extended, xmt_sl,
+    rcv_sl, xmt_disc, rcv_err, extended_speeds, smpl_ctl, oprcvcounters, flowctlcounters,
+    vloppackets, vlopdata, vlxmitflowctlerrors, vlxmitcounters, swportvlcong,
+    rcvcc, slrcvfecn, slrcvbecn, xmitcc, vlxmittimecc;
+
+static void common_func(ib_portid_t * portid, int port_num, int mask,
+			unsigned query, unsigned reset,
+			const char *name, uint16_t attr,
+			void dump_func(char *, int, void *, int))
+{
+	char buf[1536];
+
+	if (query) {
+		memset(pc, 0, sizeof(pc));
+		if (!pma_query_via(pc, portid, port_num, ibd_timeout, attr,
+				   srcport))
+			IBERROR("cannot query %s", name);
+
+		dump_func(buf, sizeof(buf), pc, sizeof(pc));
+
+		printf("# %s counters: %s port %d\n%s", name,
+		       portid2str(portid), port_num, buf);
+	}
+
+	memset(pc, 0, sizeof(pc));
+	if (reset && !performance_reset_via(pc, portid, port, mask, ibd_timeout,
+					    attr, srcport))
+		IBERROR("cannot reset %s", name);
+}
+
+static void xmt_sl_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortXmitDataSL", IB_GSI_PORT_XMIT_DATA_SL,
+		    mad_dump_perfcounters_xmt_sl);
+}
+
+static void rcv_sl_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortRcvDataSL", IB_GSI_PORT_RCV_DATA_SL,
+		    mad_dump_perfcounters_rcv_sl);
+}
+
+static void xmt_disc_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortXmitDiscardDetails", IB_GSI_PORT_XMIT_DISCARD_DETAILS,
+		    mad_dump_perfcounters_xmt_disc);
+}
+
+static void rcv_err_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortRcvErrorDetails", IB_GSI_PORT_RCV_ERROR_DETAILS,
+		    mad_dump_perfcounters_rcv_err);
+}
+
+static uint8_t *ext_speeds_reset_via(void *rcvbuf, ib_portid_t * dest,
+				     int port, uint64_t mask, unsigned timeout,
+				     const struct ibmad_port * srcport)
+{
+	ib_rpc_t rpc = { 0 };
+	int lid = dest->lid;
+
+	DEBUG("lid %u port %d mask 0x%" PRIx64, lid, port, mask);
+
+	if (lid == -1) {
+		IBWARN("only lid routed is supported");
+		return NULL;
+	}
+
+	if (!mask)
+		mask = ~0;
+
+	rpc.mgtclass = IB_PERFORMANCE_CLASS;
+	rpc.method = IB_MAD_METHOD_SET;
+	rpc.attr.id = IB_GSI_PORT_EXT_SPEEDS_COUNTERS;
+
+	memset(rcvbuf, 0, IB_MAD_SIZE);
+
+	mad_set_field(rcvbuf, 0, IB_PESC_PORT_SELECT_F, port);
+	mad_set_field64(rcvbuf, 0, IB_PESC_COUNTER_SELECT_F, mask);
+	rpc.attr.mod = 0;
+	rpc.timeout = timeout;
+	rpc.datasz = IB_PC_DATA_SZ;
+	rpc.dataoffs = IB_PC_DATA_OFFS;
+	if (!dest->qp)
+		dest->qp = 1;
+	if (!dest->qkey)
+		dest->qkey = IB_DEFAULT_QP1_QKEY;
+
+	return mad_rpc(srcport, &rpc, dest, rcvbuf, rcvbuf);
+}
+
+static void extended_speeds_query(ib_portid_t * portid, int port, uint64_t ext_mask)
+{
+	int mask = ext_mask;
+
+	if (!reset_only)
+		common_func(portid, port, mask, 1, 0,
+			    "PortExtendedSpeedsCounters",
+			    IB_GSI_PORT_EXT_SPEEDS_COUNTERS,
+			    mad_dump_port_ext_speeds_counters);
+
+	if ((reset_only || reset) &&
+	    !ext_speeds_reset_via(pc, portid, port, ext_mask, ibd_timeout, srcport))
+		IBERROR("cannot reset PortExtendedSpeedsCounters");
+}
+
+static void oprcvcounters_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortOpRcvCounters", IB_GSI_PORT_PORT_OP_RCV_COUNTERS,
+		    mad_dump_perfcounters_port_op_rcv_counters);
+}
+
+static void flowctlcounters_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortFlowCtlCounters", IB_GSI_PORT_PORT_FLOW_CTL_COUNTERS,
+		    mad_dump_perfcounters_port_flow_ctl_counters);
+}
+
+static void vloppackets_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortVLOpPackets", IB_GSI_PORT_PORT_VL_OP_PACKETS,
+		    mad_dump_perfcounters_port_vl_op_packet);
+}
+
+static void vlopdata_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortVLOpData", IB_GSI_PORT_PORT_VL_OP_DATA,
+		    mad_dump_perfcounters_port_vl_op_data);
+}
+
+static void vlxmitflowctlerrors_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortVLXmitFlowCtlUpdateErrors", IB_GSI_PORT_PORT_VL_XMIT_FLOW_CTL_UPDATE_ERRORS,
+		    mad_dump_perfcounters_port_vl_xmit_flow_ctl_update_errors);
+}
+
+static void vlxmitcounters_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortVLXmitWaitCounters", IB_GSI_PORT_PORT_VL_XMIT_WAIT_COUNTERS,
+		    mad_dump_perfcounters_port_vl_xmit_wait_counters);
+}
+
+static void swportvlcong_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "SwPortVLCongestion", IB_GSI_SW_PORT_VL_CONGESTION,
+		    mad_dump_perfcounters_sw_port_vl_congestion);
+}
+
+static void rcvcc_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortRcvConCtrl", IB_GSI_PORT_RCV_CON_CTRL,
+		    mad_dump_perfcounters_rcv_con_ctrl);
+}
+
+static void slrcvfecn_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortSLRcvFECN", IB_GSI_PORT_SL_RCV_FECN,
+		    mad_dump_perfcounters_sl_rcv_fecn);
+}
+
+static void slrcvbecn_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortSLRcvBECN", IB_GSI_PORT_SL_RCV_BECN,
+		    mad_dump_perfcounters_sl_rcv_becn);
+}
+
+static void xmitcc_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortXmitConCtrl", IB_GSI_PORT_XMIT_CON_CTRL,
+		    mad_dump_perfcounters_xmit_con_ctrl);
+}
+
+static void vlxmittimecc_query(ib_portid_t * portid, int port, int mask)
+{
+	common_func(portid, port, mask, !reset_only, (reset_only || reset),
+		    "PortVLXmitTimeCong", IB_GSI_PORT_VL_XMIT_TIME_CONG,
+		    mad_dump_perfcounters_vl_xmit_time_cong);
+}
+
+void dump_portsamples_control(ib_portid_t * portid, int port)
+{
+	char buf[1024];
+
+	memset(pc, 0, sizeof(pc));
+	if (!pma_query_via(pc, portid, port, ibd_timeout,
+			   IB_GSI_PORT_SAMPLES_CONTROL, srcport))
+		IBERROR("sampctlquery");
+
+	mad_dump_portsamples_control(buf, sizeof buf, pc, sizeof pc);
+	printf("# PortSamplesControl: %s port %d\n%s", portid2str(portid),
+	       port, buf);
+}
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 'x':
+		extended = 1;
+		break;
+	case 'X':
+		xmt_sl = 1;
+		break;
+	case 'S':
+		rcv_sl = 1;
+		break;
+	case 'D':
+		xmt_disc = 1;
+		break;
+	case 'E':
+		rcv_err = 1;
+		break;
+	case 'T':
+		extended_speeds = 1;
+		break;
+	case 'c':
+		smpl_ctl = 1;
+		break;
+	case 1:
+		oprcvcounters = 1;
+		break;
+	case 2:
+		flowctlcounters = 1;
+		break;
+	case 3:
+		vloppackets = 1;
+		break;
+	case 4:
+		vlopdata = 1;
+		break;
+	case 5:
+		vlxmitflowctlerrors = 1;
+		break;
+	case 6:
+		vlxmitcounters = 1;
+		break;
+	case 7:
+		swportvlcong = 1;
+		break;
+	case 8:
+		rcvcc = 1;
+		break;
+	case 9:
+		slrcvfecn = 1;
+		break;
+	case 10:
+		slrcvbecn = 1;
+		break;
+	case 11:
+		xmitcc = 1;
+		break;
+	case 12:
+		vlxmittimecc = 1;
+		break;
+	case 'a':
+		all_ports++;
+		port = ALL_PORTS;
+		break;
+	case 'l':
+		loop_ports++;
+		break;
+	case 'r':
+		reset++;
+		break;
+	case 'R':
+		reset_only++;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int mgmt_classes[2] = { IB_SA_CLASS, IB_PERFORMANCE_CLASS };
+	ib_portid_t portid = { 0 };
+	int mask = 0xffff;
+	uint64_t ext_mask = 0xffffffffffffffffULL;
 	uint16_t cap_mask;
 	int all_ports_loop = 0;
-	int loop_ports = 0;
 	int node_type, num_ports = 0;
-	uint8_t data[IB_SMP_DATA_SIZE];
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	int start_port = 1;
 	int enhancedport0;
 	int i;
 
-	static char const str_opts[] = "C:P:s:t:dGealrRVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "Guid", 0, 0, 'G'},
-		{ "extended", 0, 0, 'e'},
-		{ "all_ports", 0, 0, 'a'},
-		{ "loop_ports", 0, 0, 'l'},
-		{ "reset_after_read", 0, 0, 'r'},
-		{ "Reset_only", 0, 0, 'R'},
-		{ "sm_portid", 1, 0, 's'},
-		{ "timeout", 1, 0, 't'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+	const struct ibdiag_opt opts[] = {
+		{"extended", 'x', 0, NULL, "show extended port counters"},
+		{"xmtsl", 'X', 0, NULL, "show Xmt SL port counters"},
+		{"rcvsl", 'S', 0, NULL, "show Rcv SL port counters"},
+		{"xmtdisc", 'D', 0, NULL, "show Xmt Discard Details"},
+		{"rcverr", 'E', 0, NULL, "show Rcv Error Details"},
+		{"extended_speeds", 'T', 0, NULL, "show port extended speeds counters"},
+		{"oprcvcounters", 1, 0, NULL, "show Rcv Counters per Op code"},
+		{"flowctlcounters", 2, 0, NULL, "show flow control counters"},
+		{"vloppackets", 3, 0, NULL, "show packets received per Op code per VL"},
+		{"vlopdata", 4, 0, NULL, "show data received per Op code per VL"},
+		{"vlxmitflowctlerrors", 5, 0, NULL, "show flow control update errors per VL"},
+		{"vlxmitcounters", 6, 0, NULL, "show ticks waiting to transmit counters per VL"},
+		{"swportvlcong", 7, 0, NULL, "show sw port VL congestion"},
+		{"rcvcc", 8, 0, NULL, "show Rcv congestion control counters"},
+		{"slrcvfecn", 9, 0, NULL, "show SL Rcv FECN counters"},
+		{"slrcvbecn", 10, 0, NULL, "show SL Rcv BECN counters"},
+		{"xmitcc", 11, 0, NULL, "show Xmit congestion control counters"},
+		{"vlxmittimecc", 12, 0, NULL, "show VL Xmit Time congestion control counters"},
+		{"smplctl", 'c', 0, NULL, "show samples control"},
+		{"all_ports", 'a', 0, NULL, "show aggregated counters"},
+		{"loop_ports", 'l', 0, NULL, "iterate through each port"},
+		{"reset_after_read", 'r', 0, NULL, "reset counters after read"},
+		{"Reset_only", 'R', 0, NULL, "only reset counters"},
+		{0}
+	};
+	char usage_args[] = " [<lid|guid> [[port] [reset_mask]]]";
+	const char *usage_examples[] = {
+		"\t\t# read local port's performance counters",
+		"32 1\t\t# read performance counters from lid 32, port 1",
+		"-x 32 1\t# read extended performance counters from lid 32, port 1",
+		"-a 32\t\t# read performance counters from lid 32, all ports",
+		"-r 32 1\t# read performance counters and reset",
+		"-x -r 32 1\t# read extended performance counters and reset",
+		"-R 0x20 1\t# reset performance counters of port 1 only",
+		"-x -R 0x20 1\t# reset extended performance counters of port 1 only",
+		"-R -a 32\t# reset performance counters of all ports",
+		"-R 32 2 0x0fff\t# reset only error counters of port 2",
+		"-R 32 2 0xf000\t# reset only non-error counters of port 2",
+		NULL,
 	};
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'e':
-			extended = 1;
-			break;
-		case 'a':
-			all_ports++;
-			port = ALL_PORTS;
-			break;
-		case 'l':
-			loop_ports++;
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 'r':
-			reset++;
-			break;
-		case 'R':
-			reset_only++;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
+	ibdiag_process_opts(argc, argv, NULL, "DK", opts, process_opt,
+			    usage_args, usage_examples);
+
 	argc -= optind;
 	argv += optind;
 
 	if (argc > 1)
 		port = strtoul(argv[1], 0, 0);
-	if (argc > 2)
-		mask = strtoul(argv[2], 0, 0);
+	if (argc > 2) {
+		ext_mask = strtoull(argv[2], 0, 0);
+		mask = ext_mask;
+	}
+
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 2);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 4);
+	smp_mkey_set(srcport, ibd_mkey);
 
 	if (argc) {
-		if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+				       ibd_dest_type, ibd_sm_id, srcport) < 0)
 			IBERROR("can't resolve destination port %s", argv[0]);
 	} else {
-		if (ib_resolve_self(&portid, &port, 0) < 0)
+		if (resolve_self(ibd_ca, ibd_ca_port, &portid, &port, 0) < 0)
 			IBERROR("can't resolve self port %s", argv[0]);
 	}
 
 	/* PerfMgt ClassPortInfo is a required attribute */
-	if (!perf_classportinfo_query(pc, &portid, port, timeout))
+	memset(pc, 0, sizeof(pc));
+	if (!pma_query_via(pc, &portid, port, ibd_timeout, CLASS_PORT_INFO,
+			   srcport))
 		IBERROR("classportinfo query");
 	/* ClassPortInfo should be supported as part of libibmad */
-	memcpy(&cap_mask, pc+2, sizeof(cap_mask));	/* CapabilityMask */
-	cap_mask = ntohs(cap_mask);
-	if (!(cap_mask & 0x100)) { /* bit 8 is AllPortSelect */
+	memcpy(&cap_mask, pc + 2, sizeof(cap_mask));	/* CapabilityMask */
+	if (!(cap_mask & IB_PM_ALL_PORT_SELECT)) {	/* bit 8 is AllPortSelect */
 		if (!all_ports && port == ALL_PORTS)
 			IBERROR("AllPortSelect not supported");
 		if (all_ports)
 			all_ports_loop = 1;
 	}
 
+	if (xmt_sl) {
+		xmt_sl_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (rcv_sl) {
+		rcv_sl_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (xmt_disc) {
+		xmt_disc_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (rcv_err) {
+		rcv_err_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (extended_speeds) {
+		extended_speeds_query(&portid, port, ext_mask);
+		goto done;
+	}
+
+	if (oprcvcounters) {
+		oprcvcounters_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (flowctlcounters) {
+		flowctlcounters_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (vloppackets) {
+		vloppackets_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (vlopdata) {
+		vlopdata_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (vlxmitflowctlerrors) {
+		vlxmitflowctlerrors_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (vlxmitcounters) {
+		vlxmitcounters_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (swportvlcong) {
+		swportvlcong_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (rcvcc) {
+		rcvcc_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (slrcvfecn) {
+		slrcvfecn_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (slrcvbecn) {
+		slrcvbecn_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (xmitcc) {
+		xmitcc_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (vlxmittimecc) {
+		vlxmittimecc_query(&portid, port, mask);
+		goto done;
+	}
+
+	if (smpl_ctl) {
+		dump_portsamples_control(&portid, port);
+		goto done;
+	}
+
+
 	if (all_ports_loop || (loop_ports && (all_ports || port == ALL_PORTS))) {
-		if (smp_query(data, &portid, IB_ATTR_NODE_INFO, 0, 0) < 0)
+		if (smp_query_via(data, &portid, IB_ATTR_NODE_INFO, 0, 0,
+				  srcport) < 0)
 			IBERROR("smp query nodeinfo failed");
 		node_type = mad_get_field(data, 0, IB_NODE_TYPE_F);
 		mad_decode_field(data, IB_NODE_NPORTS_F, &num_ports);
@@ -469,14 +853,17 @@ main(int argc, char **argv)
 			IBERROR("smp query nodeinfo: num ports invalid");
 
 		if (node_type == IB_NODE_SWITCH) {
-			if (smp_query(data, &portid, IB_ATTR_SWITCH_INFO, 0, 0) < 0)
+			if (smp_query_via(data, &portid, IB_ATTR_SWITCH_INFO,
+					  0, 0, srcport) < 0)
 				IBERROR("smp query nodeinfo failed");
-			enhancedport0 = mad_get_field(data, 0, IB_SW_ENHANCED_PORT0_F);
+			enhancedport0 =
+			    mad_get_field(data, 0, IB_SW_ENHANCED_PORT0_F);
 			if (enhancedport0)
 				start_port = 0;
 		}
 		if (all_ports_loop && !loop_ports)
-			IBWARN("Emulating AllPortSelect by iterating through all ports");
+			IBWARN
+			    ("Emulating AllPortSelect by iterating through all ports");
 	}
 
 	if (reset_only)
@@ -484,29 +871,35 @@ main(int argc, char **argv)
 
 	if (all_ports_loop || (loop_ports && (all_ports || port == ALL_PORTS))) {
 		for (i = start_port; i <= num_ports; i++)
-			dump_perfcounters(extended, timeout, cap_mask, &portid, i,
-					  (all_ports_loop && !loop_ports));
+			dump_perfcounters(extended, ibd_timeout, cap_mask,
+					  &portid, i, (all_ports_loop
+						       && !loop_ports));
 		if (all_ports_loop && !loop_ports) {
 			if (extended != 1)
-				output_aggregate_perfcounters(&portid);
+				output_aggregate_perfcounters(&portid,
+							      cap_mask);
 			else
-				output_aggregate_perfcounters_ext(&portid);
+				output_aggregate_perfcounters_ext(&portid,
+								  cap_mask);
 		}
-	}
-	else
-		dump_perfcounters(extended, timeout, cap_mask, &portid, port, 0);
+	} else
+		dump_perfcounters(extended, ibd_timeout, cap_mask, &portid,
+				  port, 0);
 
 	if (!reset)
-		exit(0);
+		goto done;
 
 do_reset:
+	if (argc <= 2 && !extended && (cap_mask & IB_PM_PC_XMIT_WAIT_SUP))
+		mask |= (1 << 16);	/* reset portxmitwait */
 
 	if (all_ports_loop || (loop_ports && (all_ports || port == ALL_PORTS))) {
 		for (i = start_port; i <= num_ports; i++)
-			reset_counters(extended, timeout, mask, &portid, i);
-	}
-	else
-		reset_counters(extended, timeout, mask, &portid, port);
+			reset_counters(extended, ibd_timeout, mask, &portid, i);
+	} else
+		reset_counters(extended, ibd_timeout, mask, &portid, port);
 
+done:
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/saquery.c b/src/saquery.c
index 3c44aec..4ff2f65 100644
--- a/src/saquery.c
+++ b/src/saquery.c
@@ -1,8 +1,9 @@
 /*
  * Copyright (c) 2006,2007 The Regents of the University of California.
- * Copyright (c) 2004-2008 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2002-2011 Mellanox Technologies LTD. All rights reserved.
  * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+ * Copyright (c) 2009 HNR Consulting. All rights reserved.
  *
  * Produced at Lawrence Livermore National Laboratory.
  * Written by Ira Weiny <weiny2 at llnl.gov>.
@@ -37,54 +38,59 @@
  *
  */
 
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif				/* HAVE_CONFIG_H */
+
 #include <unistd.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
 #include <arpa/inet.h>
-#include <assert.h>
 #include <ctype.h>
 #include <string.h>
+#include <errno.h>
 
 #define _GNU_SOURCE
 #include <getopt.h>
 
-#include <infiniband/opensm/osm_log.h>
-#include <infiniband/vendor/osm_vendor_api.h>
-#include <infiniband/vendor/osm_vendor_sa_api.h>
-#include <infiniband/opensm/osm_mad_pool.h>
-#include <infiniband/complib/cl_debug.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <infiniband/umad.h>
+#include <infiniband/mad.h>
+#include <iba/ib_types.h>
+#include <complib/cl_nodenamemap.h>
 
 #include "ibdiag_common.h"
 
+struct query_params {
+	ib_gid_t sgid, dgid, gid, mgid;
+	uint16_t slid, dlid, mlid;
+	uint32_t flow_label;
+	int hop_limit;
+	uint8_t tclass;
+	int reversible, numb_path;
+	uint16_t pkey;
+	int qos_class, sl;
+	uint8_t mtu, rate, pkt_life;
+	uint32_t qkey;
+	uint8_t scope;
+	uint8_t join_state;
+	int proxy_join;
+};
+
 struct query_cmd {
 	const char *name, *alias;
-	ib_net16_t query_type;
+	uint16_t query_type;
 	const char *usage;
-	int (*handler)(const struct query_cmd *q, osm_bind_handle_t bind_handle,
-		       int argc, char *argv[]);
+	int (*handler) (const struct query_cmd * q, bind_handle_t h,
+			struct query_params * p, int argc, char *argv[]);
 };
 
-char *argv0 = "saquery";
-
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
-static ib_net64_t smkey = OSM_DEFAULT_SA_KEY;
 
 /**
  * Declare some globals because I don't want this to be too complex.
  */
 #define MAX_PORTS (8)
 #define DEFAULT_SA_TIMEOUT_MS (1000)
-osmv_query_res_t   result;
-osm_log_t          log_osm;
-osm_mad_pool_t     mad_pool;
-osm_vendor_t      *vendor = NULL;
-int                osm_debug = 0;
-uint32_t           sa_timeout_ms = DEFAULT_SA_TIMEOUT_MS;
-char		  *sa_hca_name = NULL;
-uint32_t           sa_port_num = 0;
 
 enum {
 	ALL,
@@ -96,44 +102,76 @@ enum {
 	NAME_OF_GUID,
 } node_print_desc = ALL;
 
-char              *requested_name = NULL;
-ib_net16_t         requested_lid = 0;
-int                requested_lid_flag = 0;
-ib_net64_t         requested_guid = 0;
-int                requested_guid_flag = 0;
+char *requested_name = NULL;
+uint16_t requested_lid = 0;
+int requested_lid_flag = 0;
+uint64_t requested_guid = 0;
+int requested_guid_flag = 0;
 
-/**
- * Call back for the various record requests.
- */
-static void
-query_res_cb(osmv_query_res_t *res)
+static unsigned valid_gid(ib_gid_t * gid)
 {
-	result = *res;
+	ib_gid_t zero_gid;
+	memset(&zero_gid, 0, sizeof zero_gid);
+	return memcmp(&zero_gid, gid, sizeof(*gid));
 }
 
-static void
-print_node_desc(ib_node_record_t *node_record)
+static void print_node_desc(ib_node_record_t * node_record)
 {
 	ib_node_info_t *p_ni = &(node_record->node_info);
 	ib_node_desc_t *p_nd = &(node_record->node_desc);
+	char *name;
 
-	if (p_ni->node_type == IB_NODE_TYPE_CA)
-	{
-		printf("%6d  \"%s\"\n",
-		       cl_ntoh16(node_record->lid),
-		       clean_nodedesc((char *)p_nd->description));
+	if (p_ni->node_type == IB_NODE_TYPE_CA) {
+		name = remap_node_name(node_name_map,
+					node_record->node_info.node_guid,
+					(char *)p_nd->description);
+		printf("%6d  \"%s\"\n", cl_ntoh16(node_record->lid), name);
+		free(name);
 	}
 }
 
-static void
-print_node_record(ib_node_record_t *node_record)
+static void dump_node_record(void *data)
 {
-	ib_node_info_t *p_ni = NULL;
-	ib_node_desc_t *p_nd = NULL;
-	char *name;
+	ib_node_record_t *nr = data;
+	ib_node_info_t *ni = &nr->node_info;
+	char *name = remap_node_name(node_name_map,
+				       cl_ntoh64(ni->node_guid),
+				       (char *)nr->node_desc.description);
 
-	p_ni = &(node_record->node_info);
-        p_nd = &(node_record->node_desc);
+	printf("NodeRecord dump:\n"
+	       "\t\tlid.....................0x%X\n"
+	       "\t\treserved................0x%X\n"
+	       "\t\tbase_version............0x%X\n"
+	       "\t\tclass_version...........0x%X\n"
+	       "\t\tnode_type...............%s\n"
+	       "\t\tnum_ports...............%u\n"
+	       "\t\tsys_guid................0x%016" PRIx64 "\n"
+	       "\t\tnode_guid...............0x%016" PRIx64 "\n"
+	       "\t\tport_guid...............0x%016" PRIx64 "\n"
+	       "\t\tpartition_cap...........0x%X\n"
+	       "\t\tdevice_id...............0x%X\n"
+	       "\t\trevision................0x%X\n"
+	       "\t\tport_num................%u\n"
+	       "\t\tvendor_id...............0x%X\n"
+	       "\t\tNodeDescription.........%s\n",
+	       cl_ntoh16(nr->lid), cl_ntoh16(nr->resv),
+	       ni->base_version, ni->class_version,
+	       ib_get_node_type_str(ni->node_type), ni->num_ports,
+	       cl_ntoh64(ni->sys_guid), cl_ntoh64(ni->node_guid),
+	       cl_ntoh64(ni->port_guid), cl_ntoh16(ni->partition_cap),
+	       cl_ntoh16(ni->device_id), cl_ntoh32(ni->revision),
+	       ib_node_info_get_local_port_num(ni),
+	       cl_ntoh32(ib_node_info_get_vendor_id(ni)),
+	       name);
+
+	free(name);
+}
+
+static void print_node_record(ib_node_record_t * node_record)
+{
+	ib_node_info_t *p_ni = &node_record->node_info;
+	ib_node_desc_t *p_nd = &node_record->node_desc;
+	char *name;
 
 	switch (node_print_desc) {
 	case LID_ONLY:
@@ -146,49 +184,17 @@ print_node_record(ib_node_record_t *node_record)
 	case NAME_OF_LID:
 	case NAME_OF_GUID:
 		name = remap_node_name(node_name_map,
-					  cl_ntoh64(p_ni->node_guid),
-					  (char *)p_nd->description);
+				       cl_ntoh64(p_ni->node_guid),
+				       (char *)p_nd->description);
 		printf("%s\n", name);
 		free(name);
 		return;
 	case ALL:
 	default:
 		break;
-        }
+	}
 
-	printf("NodeRecord dump:\n"
-	       "\t\tlid.....................0x%X\n"
-	       "\t\treserved................0x%X\n"
-	       "\t\tbase_version............0x%X\n"
-	       "\t\tclass_version...........0x%X\n"
-	       "\t\tnode_type...............%s\n"
-	       "\t\tnum_ports...............0x%X\n"
-	       "\t\tsys_guid................0x%016" PRIx64 "\n"
-	       "\t\tnode_guid...............0x%016" PRIx64 "\n"
-	       "\t\tport_guid...............0x%016" PRIx64 "\n"
-	       "\t\tpartition_cap...........0x%X\n"
-	       "\t\tdevice_id...............0x%X\n"
-	       "\t\trevision................0x%X\n"
-	       "\t\tport_num................0x%X\n"
-	       "\t\tvendor_id...............0x%X\n"
-	       "\t\tNodeDescription.........%s\n"
-	       "",
-	       cl_ntoh16(node_record->lid),
-	       cl_ntoh16(node_record->resv),
-	       p_ni->base_version,
-	       p_ni->class_version,
-	       ib_get_node_type_str( p_ni->node_type ),
-	       p_ni->num_ports,
-	       cl_ntoh64( p_ni->sys_guid ),
-	       cl_ntoh64( p_ni->node_guid ),
-	       cl_ntoh64( p_ni->port_guid ),
-	       cl_ntoh16( p_ni->partition_cap ),
-	       cl_ntoh16( p_ni->device_id ),
-	       cl_ntoh32( p_ni->revision ),
-	       ib_node_info_get_local_port_num( p_ni ),
-	       cl_ntoh32( ib_node_info_get_vendor_id( p_ni )),
-	       clean_nodedesc((char *)node_record->node_desc.description)
-	       );
+	dump_node_record(node_record);
 }
 
 static void dump_path_record(void *data)
@@ -200,8 +206,8 @@ static void dump_path_record(void *data)
 	       "\t\tservice_id..............0x%016" PRIx64 "\n"
 	       "\t\tdgid....................%s\n"
 	       "\t\tsgid....................%s\n"
-	       "\t\tdlid....................0x%X\n"
-	       "\t\tslid....................0x%X\n"
+	       "\t\tdlid....................%u\n"
+	       "\t\tslid....................%u\n"
 	       "\t\thop_flow_raw............0x%X\n"
 	       "\t\ttclass..................0x%X\n"
 	       "\t\tnum_path_revers.........0x%X\n"
@@ -212,34 +218,24 @@ static void dump_path_record(void *data)
 	       "\t\trate....................0x%X\n"
 	       "\t\tpkt_life................0x%X\n"
 	       "\t\tpreference..............0x%X\n"
-	       "\t\tresv2...................0x%X\n"
-	       "\t\tresv3...................0x%X\n"
-	       "",
-	       cl_ntoh64( p_pr->service_id ),
+	       "\t\tresv2...................0x%02X%02X%02X%02X%02X%02X\n",
+	       cl_ntoh64(p_pr->service_id),
 	       inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str, sizeof gid_str),
 	       inet_ntop(AF_INET6, p_pr->sgid.raw, gid_str2, sizeof gid_str2),
-	       cl_ntoh16( p_pr->dlid ),
-	       cl_ntoh16( p_pr->slid ),
-	       cl_ntoh32( p_pr->hop_flow_raw ),
-	       p_pr->tclass,
-	       p_pr->num_path,
-	       cl_ntoh16( p_pr->pkey ),
-	       ib_path_rec_qos_class( p_pr ),
-	       ib_path_rec_sl( p_pr ),
-	       p_pr->mtu,
-	       p_pr->rate,
-	       p_pr->pkt_life,
+	       cl_ntoh16(p_pr->dlid), cl_ntoh16(p_pr->slid),
+	       cl_ntoh32(p_pr->hop_flow_raw), p_pr->tclass, p_pr->num_path,
+	       cl_ntoh16(p_pr->pkey), ib_path_rec_qos_class(p_pr),
+	       ib_path_rec_sl(p_pr), p_pr->mtu, p_pr->rate, p_pr->pkt_life,
 	       p_pr->preference,
-	       *(uint32_t*)&p_pr->resv2,
-	       *((uint16_t*)&p_pr->resv2 + 2)
-	       );
+	       p_pr->resv2[0], p_pr->resv2[1], p_pr->resv2[2],
+	       p_pr->resv2[3], p_pr->resv2[4], p_pr->resv2[5]);
 }
 
 static void dump_class_port_info(void *data)
 {
-	char   gid_str[INET6_ADDRSTRLEN];
-	char   gid_str2[INET6_ADDRSTRLEN];
-	ib_class_port_info_t *class_port_info = data;
+	char gid_str[INET6_ADDRSTRLEN];
+	char gid_str2[INET6_ADDRSTRLEN];
+	ib_class_port_info_t *cpi = data;
 
 	printf("SA ClassPortInfo:\n"
 	       "\t\tBase version.............%d\n"
@@ -249,62 +245,93 @@ static void dump_class_port_info(void *data)
 	       "\t\tResponse time value......0x%02X\n"
 	       "\t\tRedirect GID.............%s\n"
 	       "\t\tRedirect TC/SL/FL........0x%08X\n"
-	       "\t\tRedirect LID.............0x%04X\n"
+	       "\t\tRedirect LID.............%u\n"
 	       "\t\tRedirect PKey............0x%04X\n"
 	       "\t\tRedirect QP..............0x%08X\n"
 	       "\t\tRedirect QKey............0x%08X\n"
 	       "\t\tTrap GID.................%s\n"
 	       "\t\tTrap TC/SL/FL............0x%08X\n"
-	       "\t\tTrap LID.................0x%04X\n"
+	       "\t\tTrap LID.................%u\n"
 	       "\t\tTrap PKey................0x%04X\n"
 	       "\t\tTrap HL/QP...............0x%08X\n"
-	       "\t\tTrap QKey................0x%08X\n"
-	       "",
-	       class_port_info->base_ver,
-	       class_port_info->class_ver,
-	       cl_ntoh16(class_port_info->cap_mask),
-	       ib_class_cap_mask2(class_port_info),
-	       ib_class_resp_time_val(class_port_info),
-	       inet_ntop(AF_INET6, &(class_port_info->redir_gid), gid_str,
-			sizeof gid_str),
-	       cl_ntoh32(class_port_info->redir_tc_sl_fl),
-	       cl_ntoh16(class_port_info->redir_lid),
-	       cl_ntoh16(class_port_info->redir_pkey),
-	       cl_ntoh32(class_port_info->redir_qp),
-	       cl_ntoh32(class_port_info->redir_qkey),
-	       inet_ntop(AF_INET6, &(class_port_info->trap_gid), gid_str2,
-			sizeof gid_str2),
-	       cl_ntoh32(class_port_info->trap_tc_sl_fl),
-	       cl_ntoh16(class_port_info->trap_lid),
-	       cl_ntoh16(class_port_info->trap_pkey),
-	       cl_ntoh32(class_port_info->trap_hop_qp),
-	       cl_ntoh32(class_port_info->trap_qkey)
-	      );
+	       "\t\tTrap QKey................0x%08X\n",
+	       cpi->base_ver, cpi->class_ver, cl_ntoh16(cpi->cap_mask),
+	       ib_class_cap_mask2(cpi), ib_class_resp_time_val(cpi),
+	       inet_ntop(AF_INET6, &(cpi->redir_gid), gid_str, sizeof gid_str),
+	       cl_ntoh32(cpi->redir_tc_sl_fl), cl_ntoh16(cpi->redir_lid),
+	       cl_ntoh16(cpi->redir_pkey), cl_ntoh32(cpi->redir_qp),
+	       cl_ntoh32(cpi->redir_qkey),
+	       inet_ntop(AF_INET6, &(cpi->trap_gid), gid_str2, sizeof gid_str2),
+	       cl_ntoh32(cpi->trap_tc_sl_fl), cl_ntoh16(cpi->trap_lid),
+	       cl_ntoh16(cpi->trap_pkey), cl_ntoh32(cpi->trap_hop_qp),
+	       cl_ntoh32(cpi->trap_qkey));
 }
 
 static void dump_portinfo_record(void *data)
 {
 	ib_portinfo_record_t *p_pir = data;
-	const ib_port_info_t * const p_pi = &p_pir->port_info;
-
-        printf("PortInfoRecord dump:\n"
-	       "\t\tEndPortLid..............0x%X\n"
-	       "\t\tPortNum.................0x%X\n"
-	       "\t\tbase_lid................0x%X\n"
-	       "\t\tmaster_sm_base_lid......0x%X\n"
-	       "\t\tcapability_mask.........0x%X\n"
-	       "",
-	       cl_ntoh16(p_pir->lid),
-	       p_pir->port_num,
-	       cl_ntoh16( p_pi->base_lid ),
-	       cl_ntoh16( p_pi->master_sm_base_lid ),
-	       cl_ntoh32( p_pi->capability_mask )
-               );
+	const ib_port_info_t *const p_pi = &p_pir->port_info;
+
+	printf("PortInfoRecord dump:\n"
+	       "\t\tEndPortLid..............%u\n"
+	       "\t\tPortNum.................%u\n"
+	       "\t\tbase_lid................%u\n"
+	       "\t\tmaster_sm_base_lid......%u\n"
+	       "\t\tcapability_mask.........0x%X\n",
+	       cl_ntoh16(p_pir->lid), p_pir->port_num,
+	       cl_ntoh16(p_pi->base_lid), cl_ntoh16(p_pi->master_sm_base_lid),
+	       cl_ntoh32(p_pi->capability_mask));
+}
+
+static void dump_one_portinfo_record(void *data)
+{
+	ib_portinfo_record_t *pir = data;
+	ib_port_info_t *pi = &pir->port_info;
+
+	printf("PortInfoRecord dump:\n"
+	       "\tRID:\n"
+	       "\t\tEndPortLid..............%u\n"
+	       "\t\tPortNum.................%u\n"
+	       "\t\tOptions.................0x%x\n"
+	       "\tPortInfo dump:\n",
+	       cl_ntoh16(pir->lid), pir->port_num, pir->options);
+	dump_portinfo(pi, sizeof(*pi), 2);
+}
+
+static void dump_one_mcmember_record(void *data)
+{
+	char mgid[INET6_ADDRSTRLEN], gid[INET6_ADDRSTRLEN];
+	ib_member_rec_t *mr = data;
+	uint32_t flow;
+	uint8_t sl, hop, scope, join;
+	ib_member_get_sl_flow_hop(mr->sl_flow_hop, &sl, &flow, &hop);
+	ib_member_get_scope_state(mr->scope_state, &scope, &join);
+	printf("MCMember Record dump:\n"
+	       "\t\tMGID....................%s\n"
+	       "\t\tPortGid.................%s\n"
+	       "\t\tqkey....................0x%x\n"
+	       "\t\tmlid....................0x%x\n"
+	       "\t\tmtu.....................0x%x\n"
+	       "\t\tTClass..................0x%x\n"
+	       "\t\tpkey....................0x%x\n"
+	       "\t\trate....................0x%x\n"
+	       "\t\tpkt_life................0x%x\n"
+	       "\t\tSL......................0x%x\n"
+	       "\t\tFlowLabel...............0x%x\n"
+	       "\t\tHopLimit................0x%x\n"
+	       "\t\tScope...................0x%x\n"
+	       "\t\tJoinState...............0x%x\n"
+	       "\t\tProxyJoin...............0x%x\n",
+	       inet_ntop(AF_INET6, mr->mgid.raw, mgid, sizeof(mgid)),
+	       inet_ntop(AF_INET6, mr->port_gid.raw, gid, sizeof(gid)),
+	       cl_ntoh32(mr->qkey), cl_ntoh16(mr->mlid), mr->mtu, mr->tclass,
+	       cl_ntoh16(mr->pkey), mr->rate, mr->pkt_life, sl,
+	       flow, hop, scope, join, mr->proxy_join);
 }
 
 static void dump_multicast_group_record(void *data)
 {
-	char   gid_str[INET6_ADDRSTRLEN];
+	char gid_str[INET6_ADDRSTRLEN];
 	ib_member_rec_t *p_mcmr = data;
 	uint8_t sl;
 	ib_member_get_sl_flow_hop(p_mcmr->sl_flow_hop, &sl, NULL, NULL);
@@ -314,46 +341,41 @@ static void dump_multicast_group_record(void *data)
 	       "\t\tMtu.....................0x%X\n"
 	       "\t\tpkey....................0x%X\n"
 	       "\t\tRate....................0x%X\n"
-	       "\t\tSL......................0x%X\n"
-	       "",
+	       "\t\tSL......................0x%X\n",
 	       inet_ntop(AF_INET6, p_mcmr->mgid.raw, gid_str, sizeof gid_str),
-	       cl_ntoh16( p_mcmr->mlid ),
-	       p_mcmr->mtu,
-	       cl_ntoh16( p_mcmr->pkey ),
-	       p_mcmr->rate,
-	       sl
-	       );
+	       cl_ntoh16(p_mcmr->mlid),
+	       p_mcmr->mtu, cl_ntoh16(p_mcmr->pkey), p_mcmr->rate, sl);
 }
 
-static void dump_multicast_member_record(void *data)
+static void dump_multicast_member_record(ib_member_rec_t *p_mcmr,
+					 struct sa_query_result *nr_result)
 {
-	char   gid_str[INET6_ADDRSTRLEN];
-	char   gid_str2[INET6_ADDRSTRLEN];
-	ib_member_rec_t *p_mcmr = data;
-	uint16_t mlid = cl_ntoh16( p_mcmr->mlid );
-	int      i = 0;
-	char *node_name = "<unknown>";
+	char gid_str[INET6_ADDRSTRLEN];
+	char gid_str2[INET6_ADDRSTRLEN];
+	uint16_t mlid = cl_ntoh16(p_mcmr->mlid);
+	unsigned i = 0;
+	char *node_name = strdup("<unknown>");
 
 	/* go through the node records searching for a port guid which matches
 	 * this port gid interface id.
 	 * This gives us a node name to print, if available.
 	 */
-	for (i = 0; i < result.result_cnt; i++) {
-		ib_node_record_t *nr = osmv_get_query_node_rec(result.p_result_madw, i);
-		if (nr->node_info.port_guid == p_mcmr->port_gid.unicast.interface_id) {
-			node_name = clean_nodedesc((char *)nr->node_desc.description);
+	for (i = 0; i < nr_result->result_cnt; i++) {
+		ib_node_record_t *nr = sa_get_query_rec(nr_result->p_result_madw, i);
+		if (nr->node_info.port_guid ==
+		    p_mcmr->port_gid.unicast.interface_id) {
+			node_name = remap_node_name(node_name_map,
+						nr->node_info.node_guid,
+						(char *)nr->node_desc.description);
 			break;
 		}
 	}
 
 	if (requested_name) {
-		if (strtol(requested_name, NULL, 0) == mlid) {
+		if (strtol(requested_name, NULL, 0) == mlid)
 			printf("\t\tPortGid.................%s (%s)\n",
-				inet_ntop(AF_INET6, p_mcmr->port_gid.raw,
-					gid_str, sizeof gid_str),
-			       node_name
-			      );
-		}
+			       inet_ntop(AF_INET6, p_mcmr->port_gid.raw,
+					 gid_str, sizeof gid_str), node_name);
 	} else {
 		printf("MCMemberRecord member dump:\n"
 		       "\t\tMGID....................%s\n"
@@ -361,45 +383,34 @@ static void dump_multicast_member_record(void *data)
 		       "\t\tPortGid.................%s\n"
 		       "\t\tScopeState..............0x%X\n"
 		       "\t\tProxyJoin...............0x%X\n"
-		       "\t\tNodeDescription.........%s\n"
-		       "",
+		       "\t\tNodeDescription.........%s\n",
 		       inet_ntop(AF_INET6, p_mcmr->mgid.raw, gid_str,
-				sizeof gid_str),
-		       cl_ntoh16( p_mcmr->mlid ),
+				 sizeof gid_str),
+		       cl_ntoh16(p_mcmr->mlid),
 		       inet_ntop(AF_INET6, p_mcmr->port_gid.raw,
-				gid_str2, sizeof gid_str2),
-		       p_mcmr->scope_state,
-		       p_mcmr->proxy_join,
-		       node_name
-		      );
+				 gid_str2, sizeof gid_str2),
+		       p_mcmr->scope_state, p_mcmr->proxy_join, node_name);
 	}
+	free(node_name);
 }
 
 static void dump_service_record(void *data)
 {
-	char   gid_str[INET6_ADDRSTRLEN];
+	char gid[INET6_ADDRSTRLEN];
 	char buf_service_key[35];
 	char buf_service_name[65];
 	ib_service_record_t *p_sr = data;
 
 	sprintf(buf_service_key,
 		"0x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
-		p_sr->service_key[0],
-		p_sr->service_key[1],
-		p_sr->service_key[2],
-		p_sr->service_key[3],
-		p_sr->service_key[4],
-		p_sr->service_key[5],
-		p_sr->service_key[6],
-		p_sr->service_key[7],
-		p_sr->service_key[8],
-		p_sr->service_key[9],
-		p_sr->service_key[10],
-		p_sr->service_key[11],
-		p_sr->service_key[12],
-		p_sr->service_key[13],
-		p_sr->service_key[14],
-		p_sr->service_key[15]);
+		p_sr->service_key[0], p_sr->service_key[1],
+		p_sr->service_key[2], p_sr->service_key[3],
+		p_sr->service_key[4], p_sr->service_key[5],
+		p_sr->service_key[6], p_sr->service_key[7],
+		p_sr->service_key[8], p_sr->service_key[9],
+		p_sr->service_key[10], p_sr->service_key[11],
+		p_sr->service_key[12], p_sr->service_key[13],
+		p_sr->service_key[14], p_sr->service_key[15]);
 	strncpy(buf_service_name, (char *)p_sr->service_name, 64);
 	buf_service_name[64] = '\0';
 
@@ -439,15 +450,12 @@ static void dump_service_record(void *data)
 	       "\t\tServiceData32.3.........0x%X\n"
 	       "\t\tServiceData32.4.........0x%X\n"
 	       "\t\tServiceData64.1.........0x%016" PRIx64 "\n"
-	       "\t\tServiceData64.2.........0x%016" PRIx64 "\n"
-	       "",
-	       cl_ntoh64( p_sr->service_id ),
-	       inet_ntop(AF_INET6, p_sr->service_gid.raw, gid_str,
-			sizeof gid_str),
-	       cl_ntoh16( p_sr->service_pkey ),
-	       cl_ntoh32( p_sr->service_lease ),
-	       buf_service_key,
-	       buf_service_name,
+	       "\t\tServiceData64.2.........0x%016" PRIx64 "\n",
+	       cl_ntoh64(p_sr->service_id),
+	       inet_ntop(AF_INET6, p_sr->service_gid.raw, gid, sizeof gid),
+	       cl_ntoh16(p_sr->service_pkey), cl_ntoh32(p_sr->service_lease),
+	       (show_keys ? buf_service_key : NOT_DISPLAYED_STR),
+               buf_service_name,
 	       p_sr->service_data8[0], p_sr->service_data8[1],
 	       p_sr->service_data8[2], p_sr->service_data8[3],
 	       p_sr->service_data8[4], p_sr->service_data8[5],
@@ -456,33 +464,33 @@ static void dump_service_record(void *data)
 	       p_sr->service_data8[10], p_sr->service_data8[11],
 	       p_sr->service_data8[12], p_sr->service_data8[13],
 	       p_sr->service_data8[14], p_sr->service_data8[15],
-	       cl_ntoh16( p_sr->service_data16[0] ),
-	       cl_ntoh16( p_sr->service_data16[1] ),
-	       cl_ntoh16( p_sr->service_data16[2] ),
-	       cl_ntoh16( p_sr->service_data16[3] ),
-	       cl_ntoh16( p_sr->service_data16[4] ),
-	       cl_ntoh16( p_sr->service_data16[5] ),
-	       cl_ntoh16( p_sr->service_data16[6] ),
-	       cl_ntoh16( p_sr->service_data16[7] ),
-	       cl_ntoh32( p_sr->service_data32[0] ),
-	       cl_ntoh32( p_sr->service_data32[1] ),
-	       cl_ntoh32( p_sr->service_data32[2] ),
-	       cl_ntoh32( p_sr->service_data32[3] ),
-	       cl_ntoh64( p_sr->service_data64[0] ),
-	       cl_ntoh64( p_sr->service_data64[1] )
-	      );
+	       cl_ntoh16(p_sr->service_data16[0]),
+	       cl_ntoh16(p_sr->service_data16[1]),
+	       cl_ntoh16(p_sr->service_data16[2]),
+	       cl_ntoh16(p_sr->service_data16[3]),
+	       cl_ntoh16(p_sr->service_data16[4]),
+	       cl_ntoh16(p_sr->service_data16[5]),
+	       cl_ntoh16(p_sr->service_data16[6]),
+	       cl_ntoh16(p_sr->service_data16[7]),
+	       cl_ntoh32(p_sr->service_data32[0]),
+	       cl_ntoh32(p_sr->service_data32[1]),
+	       cl_ntoh32(p_sr->service_data32[2]),
+	       cl_ntoh32(p_sr->service_data32[3]),
+	       cl_ntoh64(p_sr->service_data64[0]),
+	       cl_ntoh64(p_sr->service_data64[1]));
 }
 
 static void dump_inform_info_record(void *data)
 {
-	char   gid_str[INET6_ADDRSTRLEN];
-	char   gid_str2[INET6_ADDRSTRLEN];
+	char gid_str[INET6_ADDRSTRLEN];
+	char gid_str2[INET6_ADDRSTRLEN];
 	ib_inform_info_record_t *p_iir = data;
 	uint32_t qpn;
-	uint8_t  resp_time_val;
-
-	ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v.generic.qpn_resp_time_val, &qpn, &resp_time_val);
+	uint8_t resp_time_val;
 
+	ib_inform_info_get_qpn_resp_time(p_iir->inform_info.g_or_v.
+					 generic.qpn_resp_time_val, &qpn,
+					 &resp_time_val);
 	if (p_iir->inform_info.is_generic) {
 		printf("InformInfoRecord dump:\n"
 		       "\t\tRID\n"
@@ -490,31 +498,35 @@ static void dump_inform_info_record(void *data)
 		       "\t\tSubscriberEnum..........0x%X\n"
 		       "\t\tInformInfo dump:\n"
 		       "\t\tgid.....................%s\n"
-		       "\t\tlid_range_begin.........0x%X\n"
-		       "\t\tlid_range_end...........0x%X\n"
+		       "\t\tlid_range_begin.........%u\n"
+		       "\t\tlid_range_end...........%u\n"
 		       "\t\tis_generic..............0x%X\n"
 		       "\t\tsubscribe...............0x%X\n"
 		       "\t\ttrap_type...............0x%X\n"
-		       "\t\ttrap_num................%u\n"
-		       "\t\tqpn.....................0x%06X\n"
-		       "\t\tresp_time_val...........0x%X\n"
-		       "\t\tnode_type...............0x%06X\n"
-		       "",
+		       "\t\ttrap_num................%u\n",
 		       inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, gid_str,
-				sizeof gid_str),
-		       cl_ntoh16( p_iir->subscriber_enum ),
+				 sizeof gid_str),
+		       cl_ntoh16(p_iir->subscriber_enum),
 		       inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, gid_str2,
-				sizeof gid_str2),
-		       cl_ntoh16( p_iir->inform_info.lid_range_begin ),
-		       cl_ntoh16( p_iir->inform_info.lid_range_end ),
+				 sizeof gid_str2),
+		       cl_ntoh16(p_iir->inform_info.lid_range_begin),
+		       cl_ntoh16(p_iir->inform_info.lid_range_end),
 		       p_iir->inform_info.is_generic,
 		       p_iir->inform_info.subscribe,
-		       cl_ntoh16( p_iir->inform_info.trap_type ),
-		       cl_ntoh16( p_iir->inform_info.g_or_v.generic.trap_num ),
-		       cl_ntoh32( qpn ),
+		       cl_ntoh16(p_iir->inform_info.trap_type),
+		       cl_ntoh16(p_iir->inform_info.g_or_v.generic.trap_num));
+		if (show_keys) {
+			printf("\t\tqpn.....................0x%06X\n",
+			       cl_ntoh32(qpn));
+		} else {
+			printf("\t\tqpn....................."
+			       NOT_DISPLAYED_STR "\n");
+		}
+		printf("\t\tresp_time_val...........0x%X\n"
+		       "\t\tnode_type...............0x%06X\n",
 		       resp_time_val,
-		       cl_ntoh32(ib_inform_info_get_prod_type( &p_iir->inform_info ))
-		      );
+		       cl_ntoh32(ib_inform_info_get_prod_type
+				 (&p_iir->inform_info)));
 	} else {
 		printf("InformInfoRecord dump:\n"
 		       "\t\tRID\n"
@@ -522,31 +534,35 @@ static void dump_inform_info_record(void *data)
 		       "\t\tSubscriberEnum..........0x%X\n"
 		       "\t\tInformInfo dump:\n"
 		       "\t\tgid.....................%s\n"
-		       "\t\tlid_range_begin.........0x%X\n"
-		       "\t\tlid_range_end...........0x%X\n"
+		       "\t\tlid_range_begin.........%u\n"
+		       "\t\tlid_range_end...........%u\n"
 		       "\t\tis_generic..............0x%X\n"
 		       "\t\tsubscribe...............0x%X\n"
 		       "\t\ttrap_type...............0x%X\n"
-		       "\t\tdev_id..................0x%X\n"
-		       "\t\tqpn.....................0x%06X\n"
-		       "\t\tresp_time_val...........0x%X\n"
-		       "\t\tvendor_id...............0x%06X\n"
-		       "",
+		       "\t\tdev_id..................0x%X\n",
 		       inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, gid_str,
-				sizeof gid_str),
-		       cl_ntoh16( p_iir->subscriber_enum ),
+				 sizeof gid_str),
+		       cl_ntoh16(p_iir->subscriber_enum),
 		       inet_ntop(AF_INET6, p_iir->inform_info.gid.raw,
-				gid_str2, sizeof gid_str2),
-		       cl_ntoh16( p_iir->inform_info.lid_range_begin ),
-		       cl_ntoh16( p_iir->inform_info.lid_range_end ),
+				 gid_str2, sizeof gid_str2),
+		       cl_ntoh16(p_iir->inform_info.lid_range_begin),
+		       cl_ntoh16(p_iir->inform_info.lid_range_end),
 		       p_iir->inform_info.is_generic,
 		       p_iir->inform_info.subscribe,
-		       cl_ntoh16( p_iir->inform_info.trap_type ),
-		       cl_ntoh16( p_iir->inform_info.g_or_v.vend.dev_id ),
-		       cl_ntoh32( qpn ),
+		       cl_ntoh16(p_iir->inform_info.trap_type),
+		       cl_ntoh16(p_iir->inform_info.g_or_v.vend.dev_id));
+		if (show_keys) {
+			printf("\t\tqpn.....................0x%06X\n",
+			       cl_ntoh32(qpn));
+		} else {
+			printf("\t\tqpn....................."
+			       NOT_DISPLAYED_STR "\n");
+		}
+		printf("\t\tresp_time_val...........0x%X\n"
+		       "\t\tvendor_id...............0x%06X\n",
 		       resp_time_val,
-		       cl_ntoh32(ib_inform_info_get_prod_type( &p_iir->inform_info ))
-		      );
+		       cl_ntoh32(ib_inform_info_get_prod_type
+				 (&p_iir->inform_info)));
 	}
 }
 
@@ -594,23 +610,21 @@ static void dump_one_vlarb_record(void *data)
 	       "\t\tPort.......................%u\n"
 	       "\t\tBlock......................%u\n",
 	       cl_ntoh16(vlarb->lid), vlarb->port_num, vlarb->block_num);
-	for (i = 0; i < 32 ; i += 16) {
+	for (i = 0; i < 32; i += 16)
 		printf("\t\tVL    :%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|"
-		       "%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|",
+		       "%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|\n"
+		       "\t\tWeight:%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|"
+		       "%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|\n",
 		       e[i + 0].vl, e[i + 1].vl, e[i + 2].vl, e[i + 3].vl,
 		       e[i + 4].vl, e[i + 5].vl, e[i + 6].vl, e[i + 7].vl,
 		       e[i + 8].vl, e[i + 9].vl, e[i + 10].vl, e[i + 11].vl,
-		       e[i + 12].vl, e[i + 13].vl, e[i + 14].vl, e[i + 15].vl);
-		printf("\n\t\tWeight:%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|"
-		       "%2u|%2u|%2u|%2u|%2u|%2u|%2u|%2u|",
+		       e[i + 12].vl, e[i + 13].vl, e[i + 14].vl, e[i + 15].vl,
 		       e[i + 0].weight, e[i + 1].weight, e[i + 2].weight,
 		       e[i + 3].weight, e[i + 4].weight, e[i + 5].weight,
 		       e[i + 6].weight, e[i + 7].weight, e[i + 8].weight,
 		       e[i + 9].weight, e[i + 10].weight, e[i + 11].weight,
 		       e[i + 12].weight, e[i + 13].weight, e[i + 14].weight,
 		       e[i + 15].weight);
-		printf("\n");
-	}
 }
 
 static void dump_one_pkey_tbl_record(void *data)
@@ -624,7 +638,7 @@ static void dump_one_pkey_tbl_record(void *data)
 	       "\t\tBlock......................%u\n"
 	       "\t\tPKey Table:\n",
 	       cl_ntoh16(pktr->lid), pktr->port_num, pktr->block_num);
-	for (i = 0; i < 32 ; i += 8)
+	for (i = 0; i < 32; i += 8)
 		printf("\t\t0x%04x 0x%04x 0x%04x 0x%04x"
 		       " 0x%04x 0x%04x 0x%04x 0x%04x\n",
 		       cl_ntoh16(p[i + 0]), cl_ntoh16(p[i + 1]),
@@ -642,174 +656,212 @@ static void dump_one_lft_record(void *data)
 	printf("LFT Record dump:\n"
 	       "\t\tLID........................%u\n"
 	       "\t\tBlock......................%u\n"
-	       "\t\tLFT:\n\t\tLID\tPort Number\n",
-	       cl_ntoh16(lftr->lid), block);
-	for (i = 0; i < 64 ; i++)
-		printf("\t\t%u\t%u\n", block*64 + i, lftr->lft[i]);
+	       "\t\tLFT:\n\t\tLID\tPort Number\n", cl_ntoh16(lftr->lid), block);
+	for (i = 0; i < 64; i++)
+		printf("\t\t%u\t%u\n", block * 64 + i, lftr->lft[i]);
 	printf("\n");
 }
 
+static void dump_one_guidinfo_record(void *data)
+{
+	ib_guidinfo_record_t *gir = data;
+	printf("GUIDInfo Record dump:\n"
+	       "\t\tLID........................%u\n"
+	       "\t\tBlock......................%u\n"
+	       "\t\tGUID 0.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 1.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 2.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 3.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 4.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 5.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 6.....................0x%016" PRIx64 "\n"
+	       "\t\tGUID 7.....................0x%016" PRIx64 "\n",
+	       cl_ntoh16(gir->lid), gir->block_num,
+	       cl_ntoh64(gir->guid_info.guid[0]),
+	       cl_ntoh64(gir->guid_info.guid[1]),
+	       cl_ntoh64(gir->guid_info.guid[2]),
+	       cl_ntoh64(gir->guid_info.guid[3]),
+	       cl_ntoh64(gir->guid_info.guid[4]),
+	       cl_ntoh64(gir->guid_info.guid[5]),
+	       cl_ntoh64(gir->guid_info.guid[6]),
+	       cl_ntoh64(gir->guid_info.guid[7]));
+}
+
 static void dump_one_mft_record(void *data)
 {
 	ib_mft_record_t *mftr = data;
 	unsigned position = cl_ntoh16(mftr->position_block_num) >> 12;
 	unsigned block = cl_ntoh16(mftr->position_block_num) &
-			 IB_MCAST_BLOCK_ID_MASK_HO;
+	    IB_MCAST_BLOCK_ID_MASK_HO;
 	int i;
+	unsigned offset;
+
 	printf("MFT Record dump:\n"
 	       "\t\tLID........................%u\n"
 	       "\t\tPosition...................%u\n"
 	       "\t\tBlock......................%u\n"
-		"\t\tMFT:\n\t\tMLID\tPort Mask\n",
+	       "\t\tMFT:\n\t\tMLID\tPort Mask\n",
 	       cl_ntoh16(mftr->lid), position, block);
+	offset = IB_LID_MCAST_START_HO + block * 32;
 	for (i = 0; i < IB_MCAST_BLOCK_SIZE; i++)
-		printf("\t\t0x%x\t0x%x\n", IB_LID_MCAST_START_HO + block*64 + i,
-		       cl_ntoh16(mftr->mft[i]));
+		printf("\t\t0x%04x\t0x%04x\n",
+		       offset + i, cl_ntoh16(mftr->mft[i]));
 	printf("\n");
 }
-static void dump_results(osmv_query_res_t *r, void (*dump_func)(void *))
+
+static void dump_results(struct sa_query_result *r, void (*dump_func) (void *))
 {
-	int i;
+	unsigned i;
 	for (i = 0; i < r->result_cnt; i++) {
-		void *data = osmv_get_query_result(r->p_result_madw, i);
+		void *data = sa_get_query_rec(r->p_result_madw, i);
 		dump_func(data);
 	}
 }
 
-static void
-return_mad(void)
-{
-	/*
-	 * Return the IB query MAD to the pool as necessary.
-	 */
-	if (result.p_result_madw != NULL) {
-		osm_mad_pool_put(&mad_pool, result.p_result_madw);
-		result.p_result_madw = NULL;
-	}
-}
-
 /**
  * Get any record(s)
  */
-static ib_api_status_t
-get_any_records(osm_bind_handle_t bind_handle,
-		ib_net16_t attr_id, ib_net32_t attr_mod, ib_net64_t comp_mask,
-		void *attr, ib_net16_t attr_offset,
-		ib_net64_t sm_key)
+static int get_any_records(bind_handle_t h,
+			   uint16_t attr_id, uint32_t attr_mod,
+			   ib_net64_t comp_mask, void *attr,
+			   size_t attr_size,
+			   struct sa_query_result *result)
 {
-	ib_api_status_t   status;
-	osmv_query_req_t  req;
-	osmv_user_query_t user;
-
-	memset(&req, 0, sizeof(req));
-	memset(&user, 0, sizeof(user));
-
-	user.attr_id = attr_id;
-	user.attr_offset = attr_offset;
-	user.attr_mod = attr_mod;
-	user.comp_mask = comp_mask;
-	user.p_attr = attr;
-
-	req.query_type = OSMV_QUERY_USER_DEFINED;
-	req.timeout_ms = sa_timeout_ms;
-	req.retry_cnt = 1;
-	req.flags = OSM_SA_FLAGS_SYNC;
-	req.query_context = NULL;
-	req.pfn_query_cb = query_res_cb;
-	req.p_query_input = &user;
-	req.sm_key = sm_key;
-
-	if ((status = osmv_query_sa(bind_handle, &req)) != IB_SUCCESS) {
-		fprintf(stderr, "Query SA failed: %s\n",
-			ib_get_err_str(status));
-		return status;
+	int ret = sa_query(h, IB_MAD_METHOD_GET_TABLE, attr_id, attr_mod,
+			   cl_ntoh64(comp_mask), ibd_sakey, attr, attr_size, result);
+	if (ret) {
+		fprintf(stderr, "Query SA failed: %s\n", strerror(ret));
+		return ret;
 	}
 
-	if (result.status != IB_SUCCESS) {
-		fprintf(stderr, "Query result returned: %s\n",
-			ib_get_err_str(result.status));
-		return result.status;
+	if (result->status != IB_SA_MAD_STATUS_SUCCESS) {
+		sa_report_err(result->status);
+		return EIO;
 	}
 
-	return status;
+	return ret;
+}
+
+static int get_and_dump_any_records(bind_handle_t h, uint16_t attr_id,
+				    uint32_t attr_mod, ib_net64_t comp_mask,
+				    void *attr,
+				    size_t attr_size,
+				    void (*dump_func) (void *))
+{
+	struct sa_query_result result;
+	int ret = get_any_records(h, attr_id, attr_mod, comp_mask, attr,
+				  attr_size, &result);
+	if (ret)
+		return ret;
+
+	dump_results(&result, dump_func);
+	sa_free_result_mad(&result);
+	return 0;
 }
 
 /**
  * Get all the records available for requested query type.
  */
-static ib_api_status_t
-get_all_records(osm_bind_handle_t bind_handle,
-		ib_net16_t query_id,
-		ib_net16_t attr_offset,
-		int trusted)
+static int get_all_records(bind_handle_t h, uint16_t attr_id,
+			   struct sa_query_result *result)
 {
-	return get_any_records(bind_handle, query_id, 0, 0, NULL, attr_offset,
-			       trusted ? smkey : 0);
+	return get_any_records(h, attr_id, 0, 0, NULL, 0, result);
+}
+
+static int get_and_dump_all_records(bind_handle_t h, uint16_t attr_id,
+				    void (*dump_func) (void *))
+{
+	struct sa_query_result result;
+	int ret = get_all_records(h, attr_id, &result);
+	if (ret)
+		return ret;
+
+	dump_results(&result, dump_func);
+	sa_free_result_mad(&result);
+	return ret;
 }
 
 /**
  * return the lid from the node descriptor (name) supplied
  */
-static ib_api_status_t
-get_lid_from_name(osm_bind_handle_t bind_handle, const char *name, ib_net16_t *lid)
+static int get_lid_from_name(bind_handle_t h, const char *name, uint16_t * lid)
 {
-	int               i = 0;
 	ib_node_record_t *node_record = NULL;
-	ib_node_info_t   *p_ni = NULL;
-	ib_net16_t        attr_offset = ib_get_attr_offset(sizeof(*node_record));
-	ib_api_status_t   status;
+	ib_node_info_t *p_ni = NULL;
+	unsigned i;
+	int ret;
+	struct sa_query_result result;
 
-	status = get_all_records(bind_handle, IB_MAD_ATTR_NODE_RECORD, attr_offset, 0);
-	if (status != IB_SUCCESS)
-		return (status);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
+	if (ret)
+		return ret;
 
+	ret = ENONET;
 	for (i = 0; i < result.result_cnt; i++) {
-		node_record = osmv_get_query_node_rec(result.p_result_madw, i);
+		node_record = sa_get_query_rec(result.p_result_madw, i);
 		p_ni = &(node_record->node_info);
-		if (name && strncmp(name, (char *)node_record->node_desc.description,
-				    sizeof(node_record->node_desc.description)) == 0) {
+		if (name
+		    && strncmp(name, (char *)node_record->node_desc.description,
+			       sizeof(node_record->node_desc.description)) ==
+		    0) {
 			*lid = cl_ntoh16(node_record->lid);
+			ret = 0;
 			break;
 		}
 	}
-	return_mad();
-	return (status);
+	sa_free_result_mad(&result);
+	return ret;
 }
 
-static ib_net16_t
-get_lid(osm_bind_handle_t bind_handle, const char * name)
+static uint16_t get_lid(bind_handle_t h, const char *name)
 {
-	ib_net16_t rc_lid = 0;
+	int rc = 0;
+	uint16_t rc_lid = 0;
 
 	if (!name)
-		return(0);
-	if (isalpha(name[0]))
-		assert(get_lid_from_name(bind_handle, name, &rc_lid) == IB_SUCCESS);
-	else
-		rc_lid = atoi(name);
-	if (rc_lid == 0)
-		fprintf(stderr, "Failed to find lid for \"%s\"\n", name);
-        return (rc_lid);
+		return 0;
+	if (isalpha(name[0])) {
+		if ((rc = get_lid_from_name(h, name, &rc_lid)) != 0) {
+			fprintf(stderr, "Failed to find lid for \"%s\": %s\n",
+				name, strerror(rc));
+			exit(rc);
+		}
+	} else {
+		long val;
+		errno = 0;
+		val = strtol(name, NULL, 0);
+		if (errno != 0 || val <= 0 || val > UINT16_MAX) {
+			fprintf(stderr, "Invalid lid specified: \"%s\"\n", name);
+			exit(EINVAL);
+		}
+		rc_lid = (uint16_t)val;
+	}
+
+	return rc_lid;
 }
 
-static int parse_lid_and_ports(osm_bind_handle_t bind_handle,
+static int parse_lid_and_ports(bind_handle_t h,
 			       char *str, int *lid, int *port1, int *port2)
 {
 	char *p, *e;
 
-	if (port1) *port1 = -1;
-	if (port2) *port2 = -1;
+	if (port1)
+		*port1 = -1;
+	if (port2)
+		*port2 = -1;
 
 	p = strchr(str, '/');
-	if (p) *p = '\0';
+	if (p)
+		*p = '\0';
 	if (lid)
-		*lid = get_lid(bind_handle, str);
+		*lid = get_lid(h, str);
 
 	if (!p)
 		return 0;
 	str = p + 1;
 	p = strchr(str, '/');
-	if (p) *p = '\0';
+	if (p)
+		*p = '\0';
 	if (port1) {
 		*port1 = strtoul(str, &e, 0);
 		if (e == str)
@@ -831,871 +883,769 @@ static int parse_lid_and_ports(osm_bind_handle_t bind_handle,
 /*
  * Get the portinfo records available with IsSM or IsSMdisabled CapabilityMask bit on.
  */
-static ib_api_status_t
-get_issm_records(osm_bind_handle_t bind_handle, ib_net32_t capability_mask)
+static int get_issm_records(bind_handle_t h, ib_net32_t capability_mask,
+			    struct sa_query_result *result)
 {
 	ib_portinfo_record_t attr;
 
-	memset( &attr, 0, sizeof ( attr ) );
+	memset(&attr, 0, sizeof(attr));
 	attr.port_info.capability_mask = capability_mask;
 
-	return get_any_records(bind_handle, IB_MAD_ATTR_PORTINFO_RECORD,
-			       cl_hton32(1 << 31), IB_PIR_COMPMASK_CAPMASK,
-			       &attr,
-			       ib_get_attr_offset(sizeof(ib_portinfo_record_t)),
-			       0);
+	return get_any_records(h, IB_SA_ATTR_PORTINFORECORD, 1 << 31,
+			       IB_PIR_COMPMASK_CAPMASK, &attr, sizeof(attr), result);
 }
 
-static ib_api_status_t
-print_node_records(osm_bind_handle_t bind_handle)
+static int print_node_records(bind_handle_t h)
 {
-	int               i = 0;
-	ib_node_record_t *node_record = NULL;
-	ib_net16_t        attr_offset = ib_get_attr_offset(sizeof(*node_record));
-	ib_api_status_t   status;
+	unsigned i;
+	int ret;
+	struct sa_query_result result;
 
-	status  = get_all_records(bind_handle, IB_MAD_ATTR_NODE_RECORD, attr_offset, 0);
-	if (status != IB_SUCCESS)
-		return (status);
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &result);
+	if (ret)
+		return ret;
 
 	if (node_print_desc == ALL_DESC) {
 		printf("   LID \"name\"\n");
 		printf("================\n");
 	}
 	for (i = 0; i < result.result_cnt; i++) {
-		node_record = osmv_get_query_node_rec(result.p_result_madw, i);
+		ib_node_record_t *node_record;
+		node_record = sa_get_query_rec(result.p_result_madw, i);
 		if (node_print_desc == ALL_DESC) {
 			print_node_desc(node_record);
 		} else if (node_print_desc == NAME_OF_LID) {
-			if (requested_lid == cl_ntoh16(node_record->lid)) {
+			if (requested_lid == cl_ntoh16(node_record->lid))
 				print_node_record(node_record);
-			}
 		} else if (node_print_desc == NAME_OF_GUID) {
 			ib_node_info_t *p_ni = &(node_record->node_info);
 
-			if (requested_guid == cl_ntoh64(p_ni->port_guid)) {
+			if (requested_guid == cl_ntoh64(p_ni->port_guid))
 				print_node_record(node_record);
-			}
 		} else {
 			if (!requested_name ||
 			    (strncmp(requested_name,
 				     (char *)node_record->node_desc.description,
-				     sizeof(node_record->node_desc.description)) == 0)) {
+				     sizeof(node_record->
+					    node_desc.description)) == 0)) {
 				print_node_record(node_record);
 				if (node_print_desc == UNIQUE_LID_ONLY) {
-					return_mad();
+					sa_free_result_mad(&result);
 					exit(0);
 				}
 			}
 		}
 	}
-	return_mad();
-	return (status);
-}
-
-static ib_api_status_t
-get_print_path_rec_lid(osm_bind_handle_t bind_handle,
-		       ib_net16_t src_lid,
-		       ib_net16_t dst_lid)
-{
-	osmv_query_req_t      req;
-	osmv_lid_pair_t       lid_pair;
-	ib_api_status_t       status;
-
-	lid_pair.src_lid = cl_hton16(src_lid);
-	lid_pair.dest_lid = cl_hton16(dst_lid);
-
-	memset( &req, 0, sizeof( req ) );
-
-	req.query_type = OSMV_QUERY_PATH_REC_BY_LIDS;
-	req.timeout_ms = sa_timeout_ms;
-	req.retry_cnt = 1;
-	req.flags = OSM_SA_FLAGS_SYNC;
-	req.query_context = NULL;
-	req.pfn_query_cb = query_res_cb;
-	req.p_query_input = (void *)&lid_pair;
-	req.sm_key = 0;
-
-	if ((status = osmv_query_sa(bind_handle, &req)) != IB_SUCCESS) {
-		fprintf(stderr, "ERROR: Query SA failed: %s\n",
-			ib_get_err_str(status));
-		return (status);
-	}
-	if (result.status != IB_SUCCESS) {
-		fprintf(stderr, "ERROR: Query result returned: %s\n",
-			ib_get_err_str(result.status));
-		return (result.status);
-	}
-	status = result.status;
-	dump_results(&result, dump_path_record);
-	return_mad();
-	return (status);
+	sa_free_result_mad(&result);
+	return ret;
 }
 
-static ib_api_status_t
-get_print_path_rec_gid(osm_bind_handle_t bind_handle,
-		       const ib_gid_t *src_gid,
-		       const ib_gid_t *dst_gid)
+static int get_print_class_port_info(bind_handle_t h)
 {
-	osmv_query_req_t      req;
-	osmv_gid_pair_t       gid_pair;
-	ib_api_status_t       status;
-
-	gid_pair.src_gid = *src_gid;
-	gid_pair.dest_gid = *dst_gid;
-
-	memset( &req, 0, sizeof( req ) );
-
-	req.query_type = OSMV_QUERY_PATH_REC_BY_GIDS;
-	req.timeout_ms = sa_timeout_ms;
-	req.retry_cnt = 1;
-	req.flags = OSM_SA_FLAGS_SYNC;
-	req.query_context = NULL;
-	req.pfn_query_cb = query_res_cb;
-	req.p_query_input = (void *)&gid_pair;
-	req.sm_key = 0;
-
-	if ((status = osmv_query_sa(bind_handle, &req)) != IB_SUCCESS) {
-		fprintf(stderr, "ERROR: Query SA failed: %s\n",
-			ib_get_err_str(status));
-		return (status);
+	struct sa_query_result result;
+	int ret = sa_query(h, IB_MAD_METHOD_GET, CLASS_PORT_INFO, 0, 0,
+			   ibd_sakey, NULL, 0, &result);
+	if (ret) {
+		fprintf(stderr, "ERROR: Query SA failed: %s\n", strerror(ret));
+		return ret;
 	}
-	if (result.status != IB_SUCCESS) {
-		fprintf(stderr, "ERROR: Query result returned: %s\n",
-			ib_get_err_str(result.status));
-		return (result.status);
+	if (result.status != IB_SA_MAD_STATUS_SUCCESS) {
+		sa_report_err(result.status);
+		ret = EIO;
+		goto Exit;
 	}
-	status = result.status;
-	dump_results(&result, dump_path_record);
-	return_mad();
-	return (status);
-}
-
-static ib_api_status_t
-get_print_class_port_info(osm_bind_handle_t bind_handle)
-{
-	osmv_query_req_t      req;
-	ib_api_status_t       status;
-
-	memset( &req, 0, sizeof( req ) );
-
-	req.query_type = OSMV_QUERY_CLASS_PORT_INFO;
-	req.timeout_ms = sa_timeout_ms;
-	req.retry_cnt = 1;
-	req.flags = OSM_SA_FLAGS_SYNC;
-	req.query_context = NULL;
-	req.pfn_query_cb = query_res_cb;
-	req.p_query_input = NULL;
-	req.sm_key = 0;
-
-	if ((status = osmv_query_sa(bind_handle, &req)) != IB_SUCCESS) {
-		fprintf(stderr, "ERROR: Query SA failed: %s\n",
-			ib_get_err_str(status));
-		return (status);
-	}
-	if (result.status != IB_SUCCESS) {
-		fprintf(stderr, "ERROR: Query result returned: %s\n",
-			ib_get_err_str(result.status));
-		return (result.status);
-	}
-	status = result.status;
 	dump_results(&result, dump_class_port_info);
-	return_mad();
-	return (status);
+Exit:
+	sa_free_result_mad(&result);
+	return ret;
 }
 
-static ib_api_status_t
-print_path_records(osm_bind_handle_t bind_handle)
+static int query_path_records(const struct query_cmd *q, bind_handle_t h,
+			      struct query_params *p, int argc, char *argv[])
 {
-	ib_net16_t attr_offset = ib_get_attr_offset(sizeof(ib_path_rec_t));
-	ib_api_status_t status;
-
-	status = get_all_records(bind_handle, IB_MAD_ATTR_PATH_RECORD, attr_offset, 0);
-	if (status != IB_SUCCESS)
-		return (status);
-
-	dump_results(&result, dump_path_record);
-	return_mad();
-	return (status);
+	ib_path_rec_t pr;
+	ib_net64_t comp_mask = 0;
+	uint32_t flow = 0;
+	uint16_t qos_class = 0;
+	uint8_t reversible = 0;
+
+	memset(&pr, 0, sizeof(pr));
+	CHECK_AND_SET_GID(p->sgid, pr.sgid, PR, SGID);
+	CHECK_AND_SET_GID(p->dgid, pr.dgid, PR, DGID);
+	CHECK_AND_SET_VAL(p->slid, 16, 0, pr.slid, PR, SLID);
+	CHECK_AND_SET_VAL(p->dlid, 16, 0, pr.dlid, PR, DLID);
+	CHECK_AND_SET_VAL(p->hop_limit, 32, -1, pr.hop_flow_raw, PR, HOPLIMIT);
+	CHECK_AND_SET_VAL(p->flow_label, 8, 0, flow, PR, FLOWLABEL);
+	pr.hop_flow_raw |= cl_hton32(flow << 8);
+	CHECK_AND_SET_VAL(p->tclass, 8, 0, pr.tclass, PR, TCLASS);
+	CHECK_AND_SET_VAL(p->reversible, 8, -1, reversible, PR, REVERSIBLE);
+	CHECK_AND_SET_VAL(p->numb_path, 8, -1, pr.num_path, PR, NUMBPATH);
+	pr.num_path |= reversible << 7;
+	CHECK_AND_SET_VAL(p->pkey, 16, 0, pr.pkey, PR, PKEY);
+	CHECK_AND_SET_VAL(p->sl, 16, -1, pr.qos_class_sl, PR, SL);
+	CHECK_AND_SET_VAL(p->qos_class, 16, -1, qos_class, PR, QOS_CLASS);
+	ib_path_rec_set_qos_class(&pr, qos_class);
+	CHECK_AND_SET_VAL_AND_SEL(p->mtu, pr.mtu, PR, MTU, SELEC);
+	CHECK_AND_SET_VAL_AND_SEL(p->rate, pr.rate, PR, RATE, SELEC);
+	CHECK_AND_SET_VAL_AND_SEL(p->pkt_life, pr.pkt_life, PR, PKTLIFETIME,
+				  SELEC);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_PATHRECORD, 0, comp_mask,
+					&pr, sizeof(pr), dump_path_record);
 }
 
-static ib_api_status_t
-print_portinfo_records(osm_bind_handle_t bind_handle)
+static int print_issm_records(bind_handle_t h)
 {
-	ib_api_status_t       status;
+	struct sa_query_result result;
+	int ret = 0;
 
 	/* First, get IsSM records */
-	status = get_issm_records(bind_handle, IB_PORT_CAP_IS_SM);
-	if (status != IB_SUCCESS)
-		return (status);
+	ret = get_issm_records(h, IB_PORT_CAP_IS_SM, &result);
+	if (ret != 0)
+		return (ret);
 
 	printf("IsSM ports\n");
 	dump_results(&result, dump_portinfo_record);
-	return_mad();
+	sa_free_result_mad(&result);
 
 	/* Now, get IsSMdisabled records */
-	status = get_issm_records(bind_handle, IB_PORT_CAP_SM_DISAB);
-	if (status != IB_SUCCESS)
-		return (status);
+	ret = get_issm_records(h, IB_PORT_CAP_SM_DISAB, &result);
+	if (ret != 0)
+		return (ret);
 
 	printf("\nIsSMdisabled ports\n");
 	dump_results(&result, dump_portinfo_record);
-	return_mad();
+	sa_free_result_mad(&result);
 
-	return (status);
+	return (ret);
 }
 
-static ib_api_status_t
-print_multicast_member_records(osm_bind_handle_t bind_handle)
+static int print_multicast_member_records(bind_handle_t h)
 {
-	osmv_query_res_t  mc_group_result;
-	ib_api_status_t   status;
-
-	status = get_all_records(bind_handle, IB_MAD_ATTR_MCMEMBER_RECORD,
-				 ib_get_attr_offset(sizeof(ib_member_rec_t)), 1);
-	if (status != IB_SUCCESS)
-		return (status);
+	struct sa_query_result mc_group_result;
+	struct sa_query_result nr_result;
+	int ret;
+	unsigned i;
 
-	mc_group_result = result;
+	ret = get_all_records(h, IB_SA_ATTR_MCRECORD, &mc_group_result);
+	if (ret)
+		return ret;
 
-	status  = get_all_records(bind_handle, IB_MAD_ATTR_NODE_RECORD,
-				  ib_get_attr_offset(sizeof(ib_node_record_t)), 0);
-	if (status != IB_SUCCESS)
+	ret = get_all_records(h, IB_SA_ATTR_NODERECORD, &nr_result);
+	if (ret)
 		goto return_mc;
 
-	dump_results(&mc_group_result, dump_multicast_member_record);
-	return_mad();
+	for (i = 0; i < mc_group_result.result_cnt; i++) {
+		ib_member_rec_t *rec = (ib_member_rec_t *)
+				sa_get_query_rec(mc_group_result.p_result_madw,
+					      i);
+		dump_multicast_member_record(rec, &nr_result);
+	}
+
+	sa_free_result_mad(&nr_result);
 
 return_mc:
-	/* return_mad for the mc_group_result */
-	if (mc_group_result.p_result_madw != NULL) {
-		osm_mad_pool_put(&mad_pool, mc_group_result.p_result_madw);
-		mc_group_result.p_result_madw = NULL;
-	}
+	sa_free_result_mad(&mc_group_result);
 
-	return (status);
+	return ret;
 }
 
-static ib_api_status_t
-print_multicast_group_records(osm_bind_handle_t bind_handle)
+static int print_multicast_group_records(bind_handle_t h)
 {
-	ib_api_status_t   status;
+	return get_and_dump_all_records(h, IB_SA_ATTR_MCRECORD,
+					dump_multicast_group_record);
+}
 
-	status = get_all_records(bind_handle, IB_MAD_ATTR_MCMEMBER_RECORD,
-				 ib_get_attr_offset(sizeof(ib_member_rec_t)), 0);
-	if (status != IB_SUCCESS)
-		return (status);
+static int query_class_port_info(const struct query_cmd *q, bind_handle_t h,
+				 struct query_params *p, int argc, char *argv[])
+{
+	return get_print_class_port_info(h);
+}
 
-	dump_results(&result, dump_multicast_group_record);
-	return_mad();
-	return (status);
+static int query_node_records(const struct query_cmd *q, bind_handle_t h,
+			      struct query_params *p, int argc, char *argv[])
+{
+	ib_node_record_t nr;
+	ib_net64_t comp_mask = 0;
+	int lid = 0;
+
+	if (argc > 0)
+		parse_lid_and_ports(h, argv[0], &lid, NULL, NULL);
+
+	memset(&nr, 0, sizeof(nr));
+	CHECK_AND_SET_VAL(lid, 16, 0, nr.lid, NR, LID);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_NODERECORD, 0, comp_mask,
+					&nr, sizeof(nr), dump_node_record);
 }
 
-static ib_api_status_t
-print_service_records(osm_bind_handle_t bind_handle)
+static int query_portinfo_records(const struct query_cmd *q,
+				  bind_handle_t h, struct query_params *p,
+				  int argc, char *argv[])
 {
-	ib_net16_t attr_offset = ib_get_attr_offset(sizeof(ib_service_record_t));
-	ib_api_status_t status;
+	ib_portinfo_record_t pir;
+	ib_net64_t comp_mask = 0;
+	int lid = 0, port = -1, options = -1;
 
-	status = get_all_records(bind_handle, IB_MAD_ATTR_SERVICE_RECORD, attr_offset, 0);
-	if (status != IB_SUCCESS)
-		return (status);
+	if (argc > 0)
+		parse_lid_and_ports(h, argv[0], &lid, &port, &options);
 
-	dump_results(&result, dump_service_record);
-	return_mad();
-	return (status);
+	memset(&pir, 0, sizeof(pir));
+	CHECK_AND_SET_VAL(lid, 16, 0, pir.lid, PIR, LID);
+	CHECK_AND_SET_VAL(port, 8, -1, pir.port_num, PIR, PORTNUM);
+	CHECK_AND_SET_VAL(options, 8, -1, pir.options, PIR, OPTIONS);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_PORTINFORECORD, 0,
+					comp_mask, &pir, sizeof(pir),
+					dump_one_portinfo_record);
 }
 
-static ib_api_status_t
-print_inform_info_records(osm_bind_handle_t bind_handle)
+static int query_mcmember_records(const struct query_cmd *q,
+				  bind_handle_t h, struct query_params *p,
+				  int argc, char *argv[])
 {
-	ib_net16_t attr_offset = ib_get_attr_offset(sizeof(ib_inform_info_record_t));
-	ib_api_status_t status;
+	ib_member_rec_t mr;
+	ib_net64_t comp_mask = 0;
+	uint32_t flow = 0;
+	uint8_t sl = 0, hop = 0, scope = 0;
+
+	memset(&mr, 0, sizeof(mr));
+	CHECK_AND_SET_GID(p->mgid, mr.mgid, MCR, MGID);
+	CHECK_AND_SET_GID(p->gid, mr.port_gid, MCR, PORT_GID);
+	CHECK_AND_SET_VAL(p->mlid, 16, 0, mr.mlid, MCR, MLID);
+	CHECK_AND_SET_VAL(p->qkey, 32, 0, mr.qkey, MCR, QKEY);
+	CHECK_AND_SET_VAL_AND_SEL(p->mtu, mr.mtu, MCR, MTU, _SEL);
+	CHECK_AND_SET_VAL_AND_SEL(p->rate, mr.rate, MCR, RATE, _SEL);
+	CHECK_AND_SET_VAL_AND_SEL(p->pkt_life, mr.pkt_life, MCR, LIFE, _SEL);
+	CHECK_AND_SET_VAL(p->tclass, 8, 0, mr.tclass, MCR, TCLASS);
+	CHECK_AND_SET_VAL(p->pkey, 16, 0, mr.pkey, MCR, PKEY);
+	CHECK_AND_SET_VAL(p->sl, 8, -1, sl, MCR, SL);
+	CHECK_AND_SET_VAL(p->flow_label, 8, 0, flow, MCR, FLOW);
+	CHECK_AND_SET_VAL(p->hop_limit, 8, -1, hop, MCR, HOP);
+	mr.sl_flow_hop = ib_member_set_sl_flow_hop(sl, flow, hop);
+	CHECK_AND_SET_VAL(p->scope, 8, 0, scope, MCR, SCOPE);
+	CHECK_AND_SET_VAL(p->join_state, 8, 0, mr.scope_state, MCR, JOIN_STATE);
+	mr.scope_state |= scope << 4;
+	CHECK_AND_SET_VAL(p->proxy_join, 8, -1, mr.proxy_join, MCR, PROXY);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_MCRECORD, 0, comp_mask,
+					&mr, sizeof(mr), dump_one_mcmember_record);
+}
 
-	status = get_all_records(bind_handle, IB_MAD_ATTR_INFORM_INFO_RECORD, attr_offset, 0);
-	if (status != IB_SUCCESS)
-		return (status);
+static int query_service_records(const struct query_cmd *q, bind_handle_t h,
+				 struct query_params *p, int argc, char *argv[])
+{
+	return get_and_dump_all_records(h, IB_SA_ATTR_SERVICERECORD,
+					dump_service_record);
+}
 
-	dump_results(&result, dump_inform_info_record);
-	return_mad();
-	return (status);
+static int query_informinfo_records(const struct query_cmd *q,
+				    bind_handle_t h, struct query_params *p,
+				    int argc, char *argv[])
+{
+	return get_and_dump_all_records(h, IB_SA_ATTR_INFORMINFORECORD,
+					dump_inform_info_record);
 }
 
-static ib_api_status_t
-print_link_records(osm_bind_handle_t bind_handle, int argc, char *argv[])
+static int query_link_records(const struct query_cmd *q, bind_handle_t h,
+			      struct query_params *p, int argc, char *argv[])
 {
 	ib_link_record_t lr;
 	ib_net64_t comp_mask = 0;
 	int from_lid = 0, to_lid = 0, from_port = -1, to_port = -1;
-	ib_api_status_t status;
 
 	if (argc > 0)
-		parse_lid_and_ports(bind_handle, argv[0],
-				    &from_lid, &from_port, NULL);
+		parse_lid_and_ports(h, argv[0], &from_lid, &from_port, NULL);
 
 	if (argc > 1)
-		parse_lid_and_ports(bind_handle, argv[1],
-				    &to_lid, &to_port, NULL);
+		parse_lid_and_ports(h, argv[1], &to_lid, &to_port, NULL);
 
 	memset(&lr, 0, sizeof(lr));
+	CHECK_AND_SET_VAL(from_lid, 16, 0, lr.from_lid, LR, FROM_LID);
+	CHECK_AND_SET_VAL(from_port, 8, -1, lr.from_port_num, LR, FROM_PORT);
+	CHECK_AND_SET_VAL(to_lid, 16, 0, lr.to_lid, LR, TO_LID);
+	CHECK_AND_SET_VAL(to_port, 8, -1, lr.to_port_num, LR, TO_PORT);
 
-	if (from_lid > 0) {
-		lr.from_lid = cl_hton16(from_lid);
-		comp_mask |= IB_LR_COMPMASK_FROM_LID;
-	}
-	if (from_port >= 0) {
-		lr.from_port_num = from_port;
-		comp_mask |= IB_LR_COMPMASK_FROM_PORT;
-	}
-	if (to_lid > 0) {
-		lr.to_lid = cl_hton16(to_lid);
-		comp_mask |= IB_LR_COMPMASK_TO_LID;
-	}
-	if (to_port >= 0) {
-		lr.to_port_num = to_port;
-		comp_mask |= IB_LR_COMPMASK_TO_PORT;
-	}
-
-	status = get_any_records(bind_handle, IB_MAD_ATTR_LINK_RECORD, 0,
-				 comp_mask, &lr,
-				 ib_get_attr_offset(sizeof(lr)), 0);
-	if (status != IB_SUCCESS)
-		return status;
-
-	dump_results(&result, dump_one_link_record);
-	return_mad();
-	return status;
+	return get_and_dump_any_records(h, IB_SA_ATTR_LINKRECORD, 0, comp_mask,
+					&lr, sizeof(lr), dump_one_link_record);
 }
 
-static int
-print_sl2vl_records(const struct query_cmd *q, osm_bind_handle_t bind_handle,
-		    int argc, char *argv[])
+static int query_sl2vl_records(const struct query_cmd *q, bind_handle_t h,
+			       struct query_params *p, int argc, char *argv[])
 {
 	ib_slvl_table_record_t slvl;
 	ib_net64_t comp_mask = 0;
 	int lid = 0, in_port = -1, out_port = -1;
-	ib_api_status_t status;
 
 	if (argc > 0)
-		parse_lid_and_ports(bind_handle, argv[0],
-				    &lid, &in_port, &out_port);
+		parse_lid_and_ports(h, argv[0], &lid, &in_port, &out_port);
 
 	memset(&slvl, 0, sizeof(slvl));
+	CHECK_AND_SET_VAL(lid, 16, 0, slvl.lid, SLVL, LID);
+	CHECK_AND_SET_VAL(in_port, 8, -1, slvl.in_port_num, SLVL, IN_PORT);
+	CHECK_AND_SET_VAL(out_port, 8, -1, slvl.out_port_num, SLVL, OUT_PORT);
 
-	if (lid > 0) {
-		slvl.lid = cl_hton16(lid);
-		comp_mask |= IB_SLVL_COMPMASK_LID;
-	}
-	if (in_port >= 0) {
-		slvl.in_port_num = in_port;
-		comp_mask |= IB_SLVL_COMPMASK_IN_PORT;
-	}
-	if (out_port >= 0) {
-		slvl.out_port_num = out_port;
-		comp_mask |= IB_SLVL_COMPMASK_OUT_PORT;
-	}
-
-	status = get_any_records(bind_handle, IB_MAD_ATTR_SLVL_RECORD, 0,
-				 comp_mask, &slvl,
-				 ib_get_attr_offset(sizeof(slvl)), 0);
-	if (status != IB_SUCCESS)
-		return status;
-
-	dump_results(&result, dump_one_slvl_record);
-	return_mad();
-	return status;
+	return get_and_dump_any_records(h, IB_SA_ATTR_SL2VLTABLERECORD, 0,
+					comp_mask, &slvl, sizeof(slvl),
+					dump_one_slvl_record);
 }
 
-static int
-print_vlarb_records(const struct query_cmd *q, osm_bind_handle_t bind_handle,
-		    int argc, char *argv[])
+static int query_vlarb_records(const struct query_cmd *q, bind_handle_t h,
+			       struct query_params *p, int argc, char *argv[])
 {
 	ib_vl_arb_table_record_t vlarb;
 	ib_net64_t comp_mask = 0;
 	int lid = 0, port = -1, block = -1;
-	ib_api_status_t status;
 
 	if (argc > 0)
-		parse_lid_and_ports(bind_handle, argv[0],
-				    &lid, &port, &block);
+		parse_lid_and_ports(h, argv[0], &lid, &port, &block);
 
 	memset(&vlarb, 0, sizeof(vlarb));
+	CHECK_AND_SET_VAL(lid, 16, 0, vlarb.lid, VLA, LID);
+	CHECK_AND_SET_VAL(port, 8, -1, vlarb.port_num, VLA, OUT_PORT);
+	CHECK_AND_SET_VAL(block, 8, -1, vlarb.block_num, VLA, BLOCK);
 
-	if (lid > 0) {
-		vlarb.lid = cl_hton16(lid);
-		comp_mask |= IB_VLA_COMPMASK_LID;
-	}
-	if (port >= 0) {
-		vlarb.port_num = port;
-		comp_mask |= IB_VLA_COMPMASK_OUT_PORT;
-	}
-	if (block >= 0) {
-		vlarb.block_num = block;
-		comp_mask |= IB_VLA_COMPMASK_BLOCK;
-	}
-
-	status = get_any_records(bind_handle, IB_MAD_ATTR_VLARB_RECORD, 0,
-				 comp_mask, &vlarb,
-				 ib_get_attr_offset(sizeof(vlarb)), 0);
-	if (status != IB_SUCCESS)
-		return status;
-
-	dump_results(&result, dump_one_vlarb_record);
-	return_mad();
-	return status;
+	return get_and_dump_any_records(h, IB_SA_ATTR_VLARBTABLERECORD, 0,
+					comp_mask, &vlarb, sizeof(vlarb),
+					dump_one_vlarb_record);
 }
 
-static int
-print_pkey_tbl_records(const struct query_cmd *q, osm_bind_handle_t bind_handle,
-		       int argc, char *argv[])
+static int query_pkey_tbl_records(const struct query_cmd *q,
+				  bind_handle_t h, struct query_params *p,
+				  int argc, char *argv[])
 {
 	ib_pkey_table_record_t pktr;
 	ib_net64_t comp_mask = 0;
 	int lid = 0, port = -1, block = -1;
-	ib_api_status_t status;
 
 	if (argc > 0)
-		parse_lid_and_ports(bind_handle, argv[0],
-				    &lid, &port, &block);
+		parse_lid_and_ports(h, argv[0], &lid, &port, &block);
 
 	memset(&pktr, 0, sizeof(pktr));
+	CHECK_AND_SET_VAL(lid, 16, 0, pktr.lid, PKEY, LID);
+	CHECK_AND_SET_VAL(port, 8, -1, pktr.port_num, PKEY, PORT);
+	CHECK_AND_SET_VAL(block, 16, -1, pktr.block_num, PKEY, BLOCK);
 
-	if (lid > 0) {
-		pktr.lid = cl_hton16(lid);
-		comp_mask |= IB_PKEY_COMPMASK_LID;
-	}
-	if (port >= 0) {
-		pktr.port_num = port;
-		comp_mask |= IB_PKEY_COMPMASK_PORT;
-	}
-	if (block >= 0) {
-		pktr.block_num = block;
-		comp_mask |= IB_PKEY_COMPMASK_BLOCK;
-	}
-
-	status = get_any_records(bind_handle, IB_MAD_ATTR_PKEY_TBL_RECORD, 0,
-				 comp_mask, &pktr,
-				 ib_get_attr_offset(sizeof(pktr)), smkey);
-	if (status != IB_SUCCESS)
-		return status;
-
-	dump_results(&result, dump_one_pkey_tbl_record);
-	return_mad();
-	return status;
+	return get_and_dump_any_records(h, IB_SA_ATTR_PKEYTABLERECORD, 0,
+					comp_mask, &pktr, sizeof(pktr),
+					dump_one_pkey_tbl_record);
 }
 
-static int
-print_lft_records(const struct query_cmd *q, osm_bind_handle_t bind_handle,
-		  int argc, char *argv[])
+static int query_lft_records(const struct query_cmd *q, bind_handle_t h,
+			     struct query_params *p, int argc, char *argv[])
 {
 	ib_lft_record_t lftr;
 	ib_net64_t comp_mask = 0;
 	int lid = 0, block = -1;
-	ib_api_status_t status;
 
 	if (argc > 0)
-		parse_lid_and_ports(bind_handle, argv[0],
-				    &lid, &block, NULL);
+		parse_lid_and_ports(h, argv[0], &lid, &block, NULL);
 
 	memset(&lftr, 0, sizeof(lftr));
+	CHECK_AND_SET_VAL(lid, 16, 0, lftr.lid, LFTR, LID);
+	CHECK_AND_SET_VAL(block, 16, -1, lftr.block_num, LFTR, BLOCK);
 
-	if (lid > 0) {
-		lftr.lid = cl_hton16(lid);
-		comp_mask |= IB_LFTR_COMPMASK_LID;
-	}
-	if (block >= 0) {
-		lftr.block_num = cl_hton16(block);
-		comp_mask |= IB_LFTR_COMPMASK_BLOCK;
-	}
-
-	status = get_any_records(bind_handle, IB_MAD_ATTR_LFT_RECORD, 0,
-				 comp_mask, &lftr,
-				 ib_get_attr_offset(sizeof(lftr)), 0);
-	if (status != IB_SUCCESS)
-		return status;
-
-	dump_results(&result, dump_one_lft_record);
-	return_mad();
-	return status;
+	return get_and_dump_any_records(h, IB_SA_ATTR_LFTRECORD, 0, comp_mask,
+					&lftr, sizeof(lftr), dump_one_lft_record);
 }
 
-static int
-print_mft_records(const struct query_cmd *q, osm_bind_handle_t bind_handle,
-		  int argc, char *argv[])
+static int query_guidinfo_records(const struct query_cmd *q, bind_handle_t h,
+				  struct query_params *p, int argc, char *argv[])
 {
-	ib_mft_record_t mftr;
+	ib_guidinfo_record_t gir;
 	ib_net64_t comp_mask = 0;
-	int lid = 0, block = -1, position = -1;
-	ib_api_status_t status;
+	int lid = 0, block = -1;
 
 	if (argc > 0)
-		parse_lid_and_ports(bind_handle, argv[0],
-				   &lid, &position, &block);
+		parse_lid_and_ports(h, argv[0], &lid, &block, NULL);
 
-	memset(&mftr, 0, sizeof(mftr));
+	memset(&gir, 0, sizeof(gir));
+	CHECK_AND_SET_VAL(lid, 16, 0, gir.lid, GIR, LID);
+	CHECK_AND_SET_VAL(block, 8, -1, gir.block_num, GIR, BLOCKNUM);
 
-	if (lid > 0) {
-		mftr.lid = cl_hton16(lid);
-		comp_mask |= IB_MFTR_COMPMASK_LID;
-	}
-	if (position >= 0) {
-		mftr.position_block_num = cl_hton16(position << 12);
-		comp_mask |= IB_MFTR_COMPMASK_POSITION;
-	}
-	if (block >= 0) {
-		mftr.position_block_num |= cl_hton16(block & IB_MCAST_BLOCK_ID_MASK_HO);
-		comp_mask |= IB_MFTR_COMPMASK_BLOCK;
-	}
-
-	status = get_any_records(bind_handle, IB_MAD_ATTR_MFT_RECORD, 0,
-				 comp_mask, &mftr,
-				 ib_get_attr_offset(sizeof(mftr)), 0);
-	if (status != IB_SUCCESS)
-		return status;
-
-	dump_results(&result, dump_one_mft_record);
-	return_mad();
-	return status;
+	return get_and_dump_any_records(h, IB_SA_ATTR_GUIDINFORECORD, 0,
+					comp_mask, &gir, sizeof(gir),
+					dump_one_guidinfo_record);
 }
 
-static osm_bind_handle_t
-get_bind_handle(void)
+static int query_mft_records(const struct query_cmd *q, bind_handle_t h,
+			     struct query_params *p, int argc, char *argv[])
 {
-	uint32_t           i = 0;
-	uint64_t           port_guid = (uint64_t)-1;
-	osm_bind_handle_t  bind_handle;
-	ib_api_status_t    status;
-	ib_port_attr_t     attr_array[MAX_PORTS];
-	uint32_t           num_ports = MAX_PORTS;
-	uint32_t           ca_name_index = 0;
-
-	complib_init();
-
-	osm_log_construct(&log_osm);
-	if ((status = osm_log_init_v2(&log_osm, TRUE, 0x0001, NULL,
-				      0, TRUE)) != IB_SUCCESS) {
-		fprintf(stderr, "Failed to init osm_log: %s\n",
-			ib_get_err_str(status));
-		exit(-1);
-	}
-	osm_log_set_level(&log_osm, OSM_LOG_NONE);
-	if (osm_debug)
-		osm_log_set_level(&log_osm, OSM_LOG_DEFAULT_LEVEL);
-
-        vendor = osm_vendor_new(&log_osm, sa_timeout_ms);
-	osm_mad_pool_construct(&mad_pool);
-	if ((status = osm_mad_pool_init(&mad_pool)) != IB_SUCCESS) {
-		fprintf(stderr, "Failed to init mad pool: %s\n",
-			ib_get_err_str(status));
-		exit(-1);
-	}
-
-	if ((status = osm_vendor_get_all_port_attr(vendor, attr_array, &num_ports)) != IB_SUCCESS) {
-		fprintf(stderr, "Failed to get port attributes: %s\n",
-			ib_get_err_str(status));
-		exit(-1);
-	}
-
-	for (i = 0; i < num_ports; i++) {
-		if (i > 1 && cl_ntoh64(attr_array[i].port_guid)
-				!= (cl_ntoh64(attr_array[i-1].port_guid) + 1))
-			ca_name_index++;
-		if (sa_port_num && sa_port_num != attr_array[i].port_num)
-			continue;
-		if (sa_hca_name
-		 && strcmp(sa_hca_name, vendor->ca_names[ca_name_index]) != 0)
-			continue;
-		if (attr_array[i].link_state == IB_LINK_ACTIVE) {
-			port_guid = attr_array[i].port_guid;
-			break;
-		}
-	}
-
-	if (port_guid == (uint64_t)-1) {
-		fprintf(stderr, "Failed to find active port, check port status with \"ibstat\"\n");
-		exit(-1);
-	}
-
-	bind_handle = osmv_bind_sa(vendor, &mad_pool, port_guid);
+	ib_mft_record_t mftr;
+	ib_net64_t comp_mask = 0;
+	int lid = 0, block = -1, position = -1;
+	uint16_t pos = 0;
 
-	if (bind_handle == OSM_BIND_INVALID_HANDLE) {
-		fprintf(stderr, "Failed to bind to SA\n");
-		exit(-1);
-	}
-	return (bind_handle);
-}
+	if (argc > 0)
+		parse_lid_and_ports(h, argv[0], &lid, &position, &block);
 
-static void
-clean_up(void)
-{
-	osm_mad_pool_destroy(&mad_pool);
-	osm_vendor_delete(&vendor);
+	memset(&mftr, 0, sizeof(mftr));
+	CHECK_AND_SET_VAL(lid, 16, 0, mftr.lid, MFTR, LID);
+	CHECK_AND_SET_VAL(block, 16, -1, mftr.position_block_num, MFTR, BLOCK);
+	mftr.position_block_num &= cl_hton16(IB_MCAST_BLOCK_ID_MASK_HO);
+	CHECK_AND_SET_VAL(position, 8, -1, pos, MFTR, POSITION);
+	mftr.position_block_num |= cl_hton16(pos << 12);
+
+	return get_and_dump_any_records(h, IB_SA_ATTR_MFTRECORD, 0, comp_mask,
+					&mftr, sizeof(mftr), dump_one_mft_record);
 }
 
 static const struct query_cmd query_cmds[] = {
-	{ "ClassPortInfo", "CPI", IB_MAD_ATTR_CLASS_PORT_INFO, },
-	{ "NodeRecord", "NR", IB_MAD_ATTR_NODE_RECORD, },
-	{ "PortInfoRecord", "PIR", IB_MAD_ATTR_PORTINFO_RECORD, },
-	{ "SL2VLTableRecord", "SL2VL", IB_MAD_ATTR_SLVL_RECORD,
-	  "[[lid]/[in_port]/[out_port]]",
-	   print_sl2vl_records },
-	{ "PKeyTableRecord", "PKTR", IB_MAD_ATTR_PKEY_TBL_RECORD,
-	  "[[lid]/[port]/[block]]",
-	   print_pkey_tbl_records },
-	{ "VLArbitrationTableRecord", "VLAR", IB_MAD_ATTR_VLARB_RECORD,
-	  "[[lid]/[port]/[block]]",
-	   print_vlarb_records },
-	{ "InformInfoRecord", "IIR", IB_MAD_ATTR_INFORM_INFO_RECORD, },
-	{ "LinkRecord", "LR", IB_MAD_ATTR_LINK_RECORD,
-	  "[[from_lid]/[from_port]] [[to_lid]/[to_port]]", },
-	{ "ServiceRecord", "SR", IB_MAD_ATTR_SERVICE_RECORD, },
-	{ "PathRecord", "PR", IB_MAD_ATTR_PATH_RECORD, },
-	{ "MCMemberRecord", "MCMR", IB_MAD_ATTR_MCMEMBER_RECORD, },
-	{ "LFTRecord", "LFTR", IB_MAD_ATTR_LFT_RECORD, "[[lid]/[block]]",
-	  print_lft_records },
-	{ "MFTRecord", "MFTR", IB_MAD_ATTR_MFT_RECORD,
-	  "[[mlid]/[position]/[block]]",
-	  print_mft_records },
-	{ 0 }
+	{"ClassPortInfo", "CPI", CLASS_PORT_INFO,
+	 NULL, query_class_port_info},
+	{"NodeRecord", "NR", IB_SA_ATTR_NODERECORD,
+	 "[lid]", query_node_records},
+	{"PortInfoRecord", "PIR", IB_SA_ATTR_PORTINFORECORD,
+	 "[[lid]/[port]/[options]]", query_portinfo_records},
+	{"SL2VLTableRecord", "SL2VL", IB_SA_ATTR_SL2VLTABLERECORD,
+	 "[[lid]/[in_port]/[out_port]]", query_sl2vl_records},
+	{"PKeyTableRecord", "PKTR", IB_SA_ATTR_PKEYTABLERECORD,
+	 "[[lid]/[port]/[block]]", query_pkey_tbl_records},
+	{"VLArbitrationTableRecord", "VLAR", IB_SA_ATTR_VLARBTABLERECORD,
+	 "[[lid]/[port]/[block]]", query_vlarb_records},
+	{"InformInfoRecord", "IIR", IB_SA_ATTR_INFORMINFORECORD,
+	 NULL, query_informinfo_records},
+	{"LinkRecord", "LR", IB_SA_ATTR_LINKRECORD,
+	 "[[from_lid]/[from_port]] [[to_lid]/[to_port]]", query_link_records},
+	{"ServiceRecord", "SR", IB_SA_ATTR_SERVICERECORD,
+	 NULL, query_service_records},
+	{"PathRecord", "PR", IB_SA_ATTR_PATHRECORD,
+	 NULL, query_path_records},
+	{"MCMemberRecord", "MCMR", IB_SA_ATTR_MCRECORD,
+	 NULL, query_mcmember_records},
+	{"LFTRecord", "LFTR", IB_SA_ATTR_LFTRECORD,
+	 "[[lid]/[block]]", query_lft_records},
+	{"MFTRecord", "MFTR", IB_SA_ATTR_MFTRECORD,
+	 "[[mlid]/[position]/[block]]", query_mft_records},
+	{"GUIDInfoRecord", "GIR", IB_SA_ATTR_GUIDINFORECORD,
+	 "[[lid]/[block]]", query_guidinfo_records},
+	{0}
 };
 
 static const struct query_cmd *find_query(const char *name)
 {
 	const struct query_cmd *q;
-	unsigned len = strlen(name);
 
 	for (q = query_cmds; q->name; q++)
-		if (!strncasecmp(name, q->name, len) ||
-		    (q->alias && !strncasecmp(name, q->alias, len)))
+		if (!strcasecmp(name, q->name) ||
+		    (q->alias && !strcasecmp(name, q->alias)))
 			return q;
 
 	return NULL;
 }
 
-static void
-usage(void)
+static const struct query_cmd *find_query_by_type(uint16_t type)
 {
 	const struct query_cmd *q;
 
-	fprintf(stderr, "Usage: %s [-h -d -p -N] [--list | -D] [-S -I -L -l -G"
-		" -O -U -c -s -g -m --src-to-dst <src:dst> --sgid-to-dgid <src-dst> "
-		"-C <ca_name> -P <ca_port> -t(imeout) <msec>] [query-name] [<name> | <lid> | <guid>]\n",
-		argv0);
-	fprintf(stderr, "   Queries node records by default\n");
-	fprintf(stderr, "   -d enable debugging\n");
-	fprintf(stderr, "   -p get PathRecord info\n");
-	fprintf(stderr, "   -N get NodeRecord info\n");
-	fprintf(stderr, "   --list | -D the node desc of the CA's\n");
-	fprintf(stderr, "   -S get ServiceRecord info\n");
-	fprintf(stderr, "   -I get InformInfoRecord (subscription) info\n");
-	fprintf(stderr, "   -L return the Lids of the name specified\n");
-	fprintf(stderr, "   -l return the unique Lid of the name specified\n");
-	fprintf(stderr, "   -G return the Guids of the name specified\n");
-	fprintf(stderr, "   -O return name for the Lid specified\n");
-	fprintf(stderr, "   -U return name for the Guid specified\n");
-	fprintf(stderr, "   -c get the SA's class port info\n");
-	fprintf(stderr, "   -s return the PortInfoRecords with isSM or "
-				"isSMdisabled capability mask bit on\n");
-	fprintf(stderr, "   -g get multicast group info\n");
-	fprintf(stderr, "   -m get multicast member info\n");
-	fprintf(stderr, "      (if multicast group specified, list member GIDs"
-				" only for group specified\n");
-	fprintf(stderr, "      specified, for example 'saquery -m 0xC000')\n");
-	fprintf(stderr, "   -x get LinkRecord info\n");
-	fprintf(stderr, "   --src-to-dst get a PathRecord for <src:dst>\n"
-			"                where src and dst are either node "
-				"names or LIDs\n");
-	fprintf(stderr, "   --sgid-to-dgid get a PathRecord for <sgid-dgid>\n"
-			"                where sgid and dgid are addresses in "
-				"IPv6 format\n");
-	fprintf(stderr, "   -C <ca_name> specify the SA query HCA\n");
-	fprintf(stderr, "   -P <ca_port> specify the SA query port\n");
-	fprintf(stderr, "   --smkey <val> specify SM_Key value for the query."
-			" If non-numeric value \n"
-			"                 (like 'x') is specified then "
-			"saquery will prompt for a value\n");
-	fprintf(stderr, "   -t | --timeout <msec> specify the SA query "
-				"response timeout (default %u msec)\n",
-			DEFAULT_SA_TIMEOUT_MS);
-	fprintf(stderr, "   --node-name-map <node-name-map> specify a node name map\n");
-	fprintf(stderr, "\n   Supported query names (and aliases):\n");
 	for (q = query_cmds; q->name; q++)
-		fprintf(stderr, "      %s (%s) %s\n", q->name,
-			q->alias ? q->alias : "", q->usage ? q->usage : "");
-	fprintf(stderr, "\n");
+		if (q->query_type == type)
+			return q;
 
-	exit(-1);
+	return NULL;
 }
 
-int
-main(int argc, char **argv)
-{
-	int                ch = 0;
-	int                members = 0;
-	osm_bind_handle_t  bind_handle;
-	const struct query_cmd *q = NULL;
-	char              *src = NULL;
-	char              *dst = NULL;
-	char              *sgid = NULL;
-	char              *dgid = NULL;
-	ib_net16_t         query_type = 0;
-	ib_net16_t         src_lid;
-	ib_net16_t         dst_lid;
-	ib_api_status_t    status;
-
-	static char const str_opts[] = "pVNDLlGOUcSIsgmxdhP:C:t:";
-	static const struct option long_opts [] = {
-	   {"p", 0, 0, 'p'},
-	   {"Version", 0, 0, 'V'},
-	   {"N", 0, 0, 'N'},
-	   {"L", 0, 0, 'L'},
-	   {"l", 0, 0, 'l'},
-	   {"G", 0, 0, 'G'},
-	   {"O", 0, 0, 'O'},
-	   {"U", 0, 0, 'U'},
-	   {"s", 0, 0, 's'},
-	   {"g", 0, 0, 'g'},
-	   {"m", 0, 0, 'm'},
-	   {"x", 0, 0, 'x'},
-	   {"d", 0, 0, 'd'},
-	   {"c", 0, 0, 'c'},
-	   {"S", 0, 0, 'S'},
-	   {"I", 0, 0, 'I'},
-	   {"P", 1, 0, 'P'},
-	   {"C", 1, 0, 'C'},
-	   {"help", 0, 0, 'h'},
-	   {"list", 0, 0, 'D'},
-	   {"src-to-dst", 1, 0, 1},
-	   {"sgid-to-dgid", 1, 0, 2},
-	   {"timeout", 1, 0, 't'},
-	   {"node-name-map", 1, 0, 3},
-	   {"smkey", 1, 0, 4},
-	   { }
-	};
+enum saquery_command {
+	SAQUERY_CMD_QUERY,
+	SAQUERY_CMD_NODE_RECORD,
+	SAQUERY_CMD_CLASS_PORT_INFO,
+	SAQUERY_CMD_ISSM,
+	SAQUERY_CMD_MCGROUPS,
+	SAQUERY_CMD_MCMEMBERS,
+};
 
-	argv0 = argv[0];
+static enum saquery_command command = SAQUERY_CMD_QUERY;
+static uint16_t query_type;
+static char *src_lid, *dst_lid;
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	struct query_params *p = context;
 
-	while ((ch = getopt_long(argc, argv, str_opts, long_opts, NULL)) != -1) {
-		switch (ch) {
-		case 1:
+	switch (ch) {
+	case 1:
 		{
-			char *opt  = strdup(optarg);
-			char *ch = strchr(opt, ':');
-			if (!ch) {
-				fprintf(stderr,
-					"ERROR: --src-to-dst <node>:<node>\n");
-				usage();
-			}
-			*ch++ = '\0';
-			if (*opt)
-				src = strdup(opt);
-			if (*ch)
-				dst = strdup(ch);
-			free(opt);
-			query_type = IB_MAD_ATTR_PATH_RECORD;
-			break;
+			src_lid = strdup(optarg);
+			dst_lid = strchr(src_lid, ':');
+			if (!dst_lid)
+				ibdiag_show_usage();
+			*dst_lid++ = '\0';
 		}
-		case 2:
+		p->numb_path = 0x7f;
+		query_type = IB_SA_ATTR_PATHRECORD;
+		break;
+	case 2:
 		{
-			char *opt  = strdup(optarg);
-			char *tok1 = strtok(opt, "-");
-			char *tok2 = strtok(NULL, "\0");
-
-			if (tok1 && tok2) {
-				sgid = strdup(tok1);
-				dgid = strdup(tok2);
-			} else {
-				fprintf(stderr,
-					"ERROR: --sgid-to-dgid <GID>-<GID>\n");
-				usage();
-			}
-			free(opt);
-			query_type = IB_MAD_ATTR_PATH_RECORD;
-			break;
+			char *src_addr = strdup(optarg);
+			char *dst_addr = strchr(src_addr, '-');
+			if (!dst_addr)
+				ibdiag_show_usage();
+			*dst_addr++ = '\0';
+			if (inet_pton(AF_INET6, src_addr, &p->sgid) <= 0)
+				ibdiag_show_usage();
+			if (inet_pton(AF_INET6, dst_addr, &p->dgid) <= 0)
+				ibdiag_show_usage();
+			free(src_addr);
 		}
-		case 3:
-			node_name_map_file = strdup(optarg);
-			break;
-		case 4:
-			if (!isxdigit(*optarg) &&
-			    !(optarg = getpass("SM_Key: "))) {
-				fprintf(stderr, "cannot get SM_Key\n");
-				usage();
-			}
-			smkey = cl_hton64(strtoull(optarg, NULL, 0));
-			break;
-		case 'p':
-			query_type = IB_MAD_ATTR_PATH_RECORD;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version());
-			exit(-1);
-		case 'D':
-			node_print_desc = ALL_DESC;
-			break;
-		case 'c':
-			query_type = IB_MAD_ATTR_CLASS_PORT_INFO;
-			break;
-		case 'S':
-			query_type = IB_MAD_ATTR_SERVICE_RECORD;
-			break;
-		case 'I':
-			query_type = IB_MAD_ATTR_INFORM_INFO_RECORD;
-			break;
-		case 'N':
-			query_type = IB_MAD_ATTR_NODE_RECORD;
-			break;
-		case 'L':
-			node_print_desc = LID_ONLY;
-			break;
-		case 'l':
-			node_print_desc = UNIQUE_LID_ONLY;
-			break;
-		case 'G':
-			node_print_desc = GUID_ONLY;
-			break;
-		case 'O':
-			node_print_desc = NAME_OF_LID;
-			break;
-		case 'U':
-			node_print_desc = NAME_OF_GUID;
-			break;
-		case 's':
-			query_type = IB_MAD_ATTR_PORTINFO_RECORD;
-			break;
-		case 'g':
-			query_type = IB_MAD_ATTR_MCMEMBER_RECORD;
-			break;
-		case 'm':
-			query_type = IB_MAD_ATTR_MCMEMBER_RECORD;
-			members = 1;
-			break;
-		case 'x':
-			query_type = IB_MAD_ATTR_LINK_RECORD;
-			break;
-		case 'd':
-			osm_debug = 1;
-			break;
-		case 'C':
-			sa_hca_name = optarg;
-			break;
-		case 'P':
-			sa_port_num = strtoul(optarg, NULL, 0);
-			break;
-		case 't':
-			sa_timeout_ms = strtoul(optarg, NULL, 0);
-			break;
-		case 'h':
-		default:
-			usage();
+		p->numb_path = 0x7f;
+		query_type = IB_SA_ATTR_PATHRECORD;
+		break;
+	case 3:
+		node_name_map_file = strdup(optarg);
+		break;
+	case 4:
+		if (!isxdigit(*optarg) && !(optarg = getpass("SM_Key: "))) {
+			fprintf(stderr, "cannot get SM_Key\n");
+			ibdiag_show_usage();
+		}
+		ibd_sakey = strtoull(optarg, NULL, 0);
+		break;
+	case 'p':
+		query_type = IB_SA_ATTR_PATHRECORD;
+		break;
+	case 'D':
+		node_print_desc = ALL_DESC;
+		break;
+	case 'c':
+		command = SAQUERY_CMD_CLASS_PORT_INFO;
+		break;
+	case 'S':
+		query_type = IB_SA_ATTR_SERVICERECORD;
+		break;
+	case 'I':
+		query_type = IB_SA_ATTR_INFORMINFORECORD;
+		break;
+	case 'N':
+		command = SAQUERY_CMD_NODE_RECORD;
+		break;
+	case 'L':
+		node_print_desc = LID_ONLY;
+		command = SAQUERY_CMD_NODE_RECORD;
+		break;
+	case 'l':
+		node_print_desc = UNIQUE_LID_ONLY;
+		command = SAQUERY_CMD_NODE_RECORD;
+		break;
+	case 'G':
+		node_print_desc = GUID_ONLY;
+		command = SAQUERY_CMD_NODE_RECORD;
+		break;
+	case 'O':
+		node_print_desc = NAME_OF_LID;
+		command = SAQUERY_CMD_NODE_RECORD;
+		break;
+	case 'U':
+		node_print_desc = NAME_OF_GUID;
+		command = SAQUERY_CMD_NODE_RECORD;
+		break;
+	case 's':
+		command = SAQUERY_CMD_ISSM;
+		break;
+	case 'g':
+		command = SAQUERY_CMD_MCGROUPS;
+		break;
+	case 'm':
+		command = SAQUERY_CMD_MCMEMBERS;
+		break;
+	case 'x':
+		query_type = IB_SA_ATTR_LINKRECORD;
+		break;
+	case 5:
+		p->slid = (uint16_t) strtoul(optarg, NULL, 0);
+		break;
+	case 6:
+		p->dlid = (uint16_t) strtoul(optarg, NULL, 0);
+		break;
+	case 7:
+		p->mlid = (uint16_t) strtoul(optarg, NULL, 0);
+		break;
+	case 14:
+		if (inet_pton(AF_INET6, optarg, &p->sgid) <= 0)
+			ibdiag_show_usage();
+		break;
+	case 15:
+		if (inet_pton(AF_INET6, optarg, &p->dgid) <= 0)
+			ibdiag_show_usage();
+		break;
+	case 16:
+		if (inet_pton(AF_INET6, optarg, &p->gid) <= 0)
+			ibdiag_show_usage();
+		break;
+	case 17:
+		if (inet_pton(AF_INET6, optarg, &p->mgid) <= 0)
+			ibdiag_show_usage();
+		break;
+	case 'r':
+		p->reversible = strtoul(optarg, NULL, 0);
+		break;
+	case 'n':
+		p->numb_path = strtoul(optarg, NULL, 0);
+		break;
+	case 18:
+		if (!isxdigit(*optarg) && !(optarg = getpass("P_Key: "))) {
+			fprintf(stderr, "cannot get P_Key\n");
+			ibdiag_show_usage();
+		}
+		p->pkey = (uint16_t) strtoul(optarg, NULL, 0);
+		break;
+	case 'Q':
+		p->qos_class = strtoul(optarg, NULL, 0);
+		break;
+	case 19:
+		p->sl = strtoul(optarg, NULL, 0);
+		break;
+	case 'M':
+		p->mtu = (uint8_t) strtoul(optarg, NULL, 0);
+		break;
+	case 'R':
+		p->rate = (uint8_t) strtoul(optarg, NULL, 0);
+		break;
+	case 20:
+		p->pkt_life = (uint8_t) strtoul(optarg, NULL, 0);
+		break;
+	case 'q':
+		if (!isxdigit(*optarg) && !(optarg = getpass("Q_Key: "))) {
+			fprintf(stderr, "cannot get Q_Key\n");
+			ibdiag_show_usage();
 		}
+		p->qkey = strtoul(optarg, NULL, 0);
+		break;
+	case 'T':
+		p->tclass = (uint8_t) strtoul(optarg, NULL, 0);
+		break;
+	case 'F':
+		p->flow_label = strtoul(optarg, NULL, 0);
+		break;
+	case 'H':
+		p->hop_limit = strtoul(optarg, NULL, 0);
+		break;
+	case 21:
+		p->scope = (uint8_t) strtoul(optarg, NULL, 0);
+		break;
+	case 'J':
+		p->join_state = (uint8_t) strtoul(optarg, NULL, 0);
+		break;
+	case 'X':
+		p->proxy_join = strtoul(optarg, NULL, 0);
+		break;
+	default:
+		return -1;
 	}
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	char usage_args[1024];
+	bind_handle_t h;
+	struct query_params params;
+	const struct query_cmd *q;
+	int status;
+	int n;
+
+	const struct ibdiag_opt opts[] = {
+		{"p", 'p', 0, NULL, "get PathRecord info"},
+		{"N", 'N', 0, NULL, "get NodeRecord info"},
+		{"L", 'L', 0, NULL, "return the Lids of the name specified"},
+		{"l", 'l', 0, NULL,
+		 "return the unique Lid of the name specified"},
+		{"G", 'G', 0, NULL, "return the Guids of the name specified"},
+		{"O", 'O', 0, NULL, "return name for the Lid specified"},
+		{"U", 'U', 0, NULL, "return name for the Guid specified"},
+		{"s", 's', 0, NULL, "return the PortInfoRecords with isSM or"
+		 " isSMdisabled capability mask bit on"},
+		{"g", 'g', 0, NULL, "get multicast group info"},
+		{"m", 'm', 0, NULL, "get multicast member info (if multicast"
+		 " group specified, list member GIDs only for group specified,"
+		 " for example 'saquery -m 0xC000')"},
+		{"x", 'x', 0, NULL, "get LinkRecord info"},
+		{"c", 'c', 0, NULL, "get the SA's class port info"},
+		{"S", 'S', 0, NULL, "get ServiceRecord info"},
+		{"I", 'I', 0, NULL, "get InformInfoRecord (subscription) info"},
+		{"list", 'D', 0, NULL, "the node desc of the CA's"},
+		{"src-to-dst", 1, 1, "<src:dst>", "get a PathRecord for"
+		 " <src:dst> where src and dst are either node names or LIDs"},
+		{"sgid-to-dgid", 2, 1, "<sgid-dgid>", "get a PathRecord for"
+		 " <sgid-dgid> where sgid and dgid are addresses in IPv6 format"},
+		{"node-name-map", 3, 1, "<file>",
+		 "specify a node name map file"},
+		{"smkey", 4, 1, "<val>",
+		 "SA SM_Key value for the query."
+		 " If non-numeric value (like 'x') is specified then"
+		 " saquery will prompt for a value. "
+		 " Default (when not specified here or in ibdiag.conf) is to "
+		 " use SM_Key == 0 (or \"untrusted\")"},
+		{"slid", 5, 1, "<lid>", "Source LID (PathRecord)"},
+		{"dlid", 6, 1, "<lid>", "Destination LID (PathRecord)"},
+		{"mlid", 7, 1, "<lid>", "Multicast LID (MCMemberRecord)"},
+		{"sgid", 14, 1, "<gid>",
+		 "Source GID (IPv6 format) (PathRecord)"},
+		{"dgid", 15, 1, "<gid>",
+		 "Destination GID (IPv6 format) (PathRecord)"},
+		{"gid", 16, 1, "<gid>", "Port GID (MCMemberRecord)"},
+		{"mgid", 17, 1, "<gid>", "Multicast GID (MCMemberRecord)"},
+		{"reversible", 'r', 1, NULL, "Reversible path (PathRecord)"},
+		{"numb_path", 'n', 1, NULL, "Number of paths (PathRecord)"},
+		{"pkey", 18, 1, NULL, "P_Key (PathRecord, MCMemberRecord)."
+		 " If non-numeric value (like 'x') is specified then"
+		 " saquery will prompt for a value"},
+		{"qos_class", 'Q', 1, NULL, "QoS Class (PathRecord)"},
+		{"sl", 19, 1, NULL,
+		 "Service level (PathRecord, MCMemberRecord)"},
+		{"mtu", 'M', 1, NULL,
+		 "MTU and selector (PathRecord, MCMemberRecord)"},
+		{"rate", 'R', 1, NULL,
+		 "Rate and selector (PathRecord, MCMemberRecord)"},
+		{"pkt_lifetime", 20, 1, NULL,
+		 "Packet lifetime and selector (PathRecord, MCMemberRecord)"},
+		{"qkey", 'q', 1, NULL, "Q_Key (MCMemberRecord)."
+		 " If non-numeric value (like 'x') is specified then"
+		 " saquery will prompt for a value"},
+		{"tclass", 'T', 1, NULL,
+		 "Traffic Class (PathRecord, MCMemberRecord)"},
+		{"flow_label", 'F', 1, NULL,
+		 "Flow Label (PathRecord, MCMemberRecord)"},
+		{"hop_limit", 'H', 1, NULL,
+		 "Hop limit (PathRecord, MCMemberRecord)"},
+		{"scope", 21, 1, NULL, "Scope (MCMemberRecord)"},
+		{"join_state", 'J', 1, NULL, "Join state (MCMemberRecord)"},
+		{"proxy_join", 'X', 1, NULL, "Proxy join (MCMemberRecord)"},
+		{0}
+	};
+
+	memset(&params, 0, sizeof params);
+	params.hop_limit = -1;
+	params.reversible = -1;
+	params.numb_path = -1;
+	params.qos_class = -1;
+	params.sl = -1;
+	params.proxy_join = -1;
+
+	n = sprintf(usage_args, "[query-name] [<name> | <lid> | <guid>]\n"
+		    "\nSupported query names (and aliases):\n");
+	for (q = query_cmds; q->name; q++) {
+		n += snprintf(usage_args + n, sizeof(usage_args) - n,
+			      "  %s (%s) %s\n", q->name,
+			      q->alias ? q->alias : "",
+			      q->usage ? q->usage : "");
+		if (n >= sizeof(usage_args))
+			exit(-1);
+	}
+	snprintf(usage_args + n, sizeof(usage_args) - n,
+		 "\n  Queries node records by default.");
+
+	q = NULL;
+	ibd_timeout = DEFAULT_SA_TIMEOUT_MS;
+
+	ibdiag_process_opts(argc, argv, &params, "DGLsy", opts, process_opt,
+			    usage_args, NULL);
+
 	argc -= optind;
 	argv += optind;
 
-	if (!query_type) {
+	if (!query_type && command == SAQUERY_CMD_QUERY) {
 		if (!argc || !(q = find_query(argv[0])))
-			query_type = IB_MAD_ATTR_NODE_RECORD;
+			query_type = IB_SA_ATTR_NODERECORD;
 		else {
 			query_type = q->query_type;
 			argc--;
@@ -1705,112 +1655,79 @@ main(int argc, char **argv)
 
 	if (argc) {
 		if (node_print_desc == NAME_OF_LID) {
-			requested_lid = (ib_net16_t)strtoul(argv[0], NULL, 0);
+			requested_lid = (uint16_t) strtoul(argv[0], NULL, 0);
 			requested_lid_flag++;
 		} else if (node_print_desc == NAME_OF_GUID) {
-			requested_guid = (ib_net64_t)strtoul(argv[0], NULL, 0);
+			requested_guid = strtoul(argv[0], NULL, 0);
 			requested_guid_flag++;
-		} else {
+		} else
 			requested_name = argv[0];
-		}
 	}
 
 	if ((node_print_desc == LID_ONLY ||
 	     node_print_desc == UNIQUE_LID_ONLY ||
-	     node_print_desc == GUID_ONLY) &&
-	     !requested_name) {
+	     node_print_desc == GUID_ONLY) && !requested_name) {
 		fprintf(stderr, "ERROR: name not specified\n");
-		usage();
+		ibdiag_show_usage();
 	}
 
 	if (node_print_desc == NAME_OF_LID && !requested_lid_flag) {
 		fprintf(stderr, "ERROR: lid not specified\n");
-		usage();
+		ibdiag_show_usage();
 	}
 
 	if (node_print_desc == NAME_OF_GUID && !requested_guid_flag) {
 		fprintf(stderr, "ERROR: guid not specified\n");
-		usage();
+		ibdiag_show_usage();
 	}
 
 	/* Note: lid cannot be 0; see infiniband spec 4.1.3 */
 	if (node_print_desc == NAME_OF_LID && !requested_lid) {
 		fprintf(stderr, "ERROR: lid invalid\n");
-		usage();
+		ibdiag_show_usage();
 	}
 
-	bind_handle = get_bind_handle();
+	h = sa_get_bind_handle();
+	if (!h)
+		IBPANIC("Failed to bind to the SA");
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
-	switch (query_type) {
-	case IB_MAD_ATTR_NODE_RECORD:
-		status = print_node_records(bind_handle);
-		break;
-	case IB_MAD_ATTR_PATH_RECORD:
-		if (src && dst) {
-        		src_lid = get_lid(bind_handle, src);
-        		dst_lid = get_lid(bind_handle, dst);
-			printf("Path record for %s -> %s\n", src, dst);
-			if (src_lid == 0 || dst_lid == 0) {
-	        		status = IB_UNKNOWN_ERROR;
-			} else {
-	        		status = get_print_path_rec_lid(bind_handle, src_lid, dst_lid);
-			}
-		} else if (sgid && dgid) {
-			struct in6_addr src_addr, dst_addr;
+	if (src_lid && *src_lid)
+		params.slid = get_lid(h, src_lid);
+	if (dst_lid && *dst_lid)
+		params.dlid = get_lid(h, dst_lid);
 
-			if (inet_pton(AF_INET6, sgid, &src_addr) <= 0) {
-				fprintf(stderr, "invalid src gid: %s\n", sgid);
-				exit(-1);
-			}
-			if (inet_pton(AF_INET6, dgid, &dst_addr) <= 0) {
-				fprintf(stderr, "invalid dst gid: %s\n", dgid);
-				exit(-1);
-			}
-			status = get_print_path_rec_gid(
-				bind_handle,
-				(ib_gid_t *) &src_addr.s6_addr,
-				(ib_gid_t *) &dst_addr.s6_addr);
-		} else {
-			status = print_path_records(bind_handle);
-		}
+	switch (command) {
+	case SAQUERY_CMD_NODE_RECORD:
+		status = print_node_records(h);
 		break;
-	case IB_MAD_ATTR_CLASS_PORT_INFO:
-		status = get_print_class_port_info(bind_handle);
+	case SAQUERY_CMD_CLASS_PORT_INFO:
+		status = get_print_class_port_info(h);
 		break;
-	case IB_MAD_ATTR_PORTINFO_RECORD:
-		status = print_portinfo_records(bind_handle);
+	case SAQUERY_CMD_ISSM:
+		status = print_issm_records(h);
 		break;
-	case IB_MAD_ATTR_MCMEMBER_RECORD:
-		if (members)
-			status = print_multicast_member_records(bind_handle);
-		else
-			status = print_multicast_group_records(bind_handle);
+	case SAQUERY_CMD_MCGROUPS:
+		status = print_multicast_group_records(h);
 		break;
-	case IB_MAD_ATTR_SERVICE_RECORD:
-		status = print_service_records(bind_handle);
-		break;
-	case IB_MAD_ATTR_INFORM_INFO_RECORD:
-		status = print_inform_info_records(bind_handle);
-		break;
-	case IB_MAD_ATTR_LINK_RECORD:
-		status = print_link_records(bind_handle, argc, argv);
+	case SAQUERY_CMD_MCMEMBERS:
+		status = print_multicast_member_records(h);
 		break;
 	default:
-		if (q && q->handler)
-			status = q->handler(q, bind_handle, argc, argv);
-		else {
-			fprintf(stderr, "Unknown query type %d\n", query_type);
-			status = IB_UNKNOWN_ERROR;
-		}
+		if ((!q && !(q = find_query_by_type(query_type)))
+		    || !q->handler) {
+			fprintf(stderr, "Unknown query type %d\n",
+				ntohs(query_type));
+			status = EINVAL;
+		} else
+			status = q->handler(q, h, &params, argc, argv);
 		break;
 	}
 
-	if (src)
-		free(src);
-	if (dst)
-		free(dst);
-	clean_up();
+	if (src_lid)
+		free(src_lid);
+	sa_free_bind_handle(h);
 	close_node_name_map(node_name_map);
 	return (status);
 }
diff --git a/src/sminfo.c b/src/sminfo.c
index fdd3071..2471a08 100644
--- a/src/sminfo.c
+++ b/src/sminfo.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,35 +34,25 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <getopt.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 
 #include "ibdiag_common.h"
 
-static uint8_t sminfo[1024];
+static uint8_t sminfo[1024] = { 0 };
 
-char *argv0 = "sminfo";
+struct ibmad_port *srcport;
 
-static void
-usage(void)
-{
-	fprintf(stderr, "Usage: %s [-d(ebug) -e(rr_show) -s state -p prio -a activity -D(irect) -G(uid) -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms] <sm_lid|sm_dr_path> [modifier]\n",
-			argv0);
-	exit(-1);
-}
+int strdata, xdata = 1, bindata;
 
-int strdata, xdata=1, bindata;
 enum {
 	SMINFO_NOTACT,
 	SMINFO_DISCOVER,
@@ -72,111 +63,73 @@ enum {
 };
 
 char *statestr[] = {
-	[SMINFO_NOTACT] "SMINFO_NOTACT",
-	[SMINFO_DISCOVER] "SMINFO_DISCOVER",
-	[SMINFO_STANDBY] "SMINFO_STANDBY",
-	[SMINFO_MASTER] "SMINFO_MASTER",
+	"SMINFO_NOTACT",
+	"SMINFO_DISCOVER",
+	"SMINFO_STANDBY",
+	"SMINFO_MASTER",
 };
 
-#define STATESTR(s)	(((uint)(s)) < SMINFO_STATE_LAST ? statestr[s] : "???")
+#define STATESTR(s)	(((unsigned)(s)) < SMINFO_STATE_LAST ? statestr[s] : "???")
+
+static unsigned act;
+static int prio, state = SMINFO_STANDBY;
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	switch (ch) {
+	case 'a':
+		act = strtoul(optarg, 0, 0);
+		break;
+	case 's':
+		state = strtoul(optarg, 0, 0);
+		break;
+	case 'p':
+		prio = strtoul(optarg, 0, 0);
+		break;
+	default:
+		return -1;
+	}
+	return 0;
+}
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
 	int mod = 0;
-	ib_portid_t portid = {0};
-	int timeout = 0;	/* use default */
+	ib_portid_t portid = { 0 };
 	uint8_t *p;
-	uint act = 0;
-	int prio = 0, state = SMINFO_STANDBY;
 	uint64_t guid = 0, key = 0;
-	extern int ibdebug;
-	int dest_type = IB_DEST_LID;
-	int udebug = 0;
-	char *ca = 0;
-	int ca_port = 0;
-
-	static char const str_opts[] = "C:P:t:s:p:a:deDGVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "err_show", 0, 0, 'e'},
-		{ "s", 1, 0, 's'},
-		{ "p", 1, 0, 'p'},
-		{ "a", 1, 0, 'a'},
-		{ "Direct", 0, 0, 'D'},
-		{ "Guid", 0, 0, 'G'},
-		{ "Version", 0, 0, 'V'},
-		{ "timeout", 1, 0, 't'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+
+	const struct ibdiag_opt opts[] = {
+		{"state", 's', 1, "<0-3>", "set SM state"},
+		{"priority", 'p', 1, "<0-15>", "set SM priority"},
+		{"activity", 'a', 1, NULL, "set activity count"},
+		{0}
 	};
+	char usage_args[] = "<sm_lid|sm_dr_path> [modifier]";
+
+	ibdiag_process_opts(argc, argv, NULL, "sK", opts, process_opt,
+			    usage_args, NULL);
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'e':
-			madrpc_show_errors(1);
-			break;
-		case 'D':
-			dest_type = IB_DEST_DRPATH;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'a':
-			act = strtoul(optarg, 0, 0);
-			break;
-		case 's':
-			state = strtoul(optarg, 0, 0);
-			break;
-		case 'p':
-			prio = strtoul(optarg, 0, 0);
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
 	if (argc > 1)
 		mod = atoi(argv[1]);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
 
 	if (argc) {
-		if (ib_resolve_portid_str(&portid, argv[0], dest_type, 0) < 0)
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+				       ibd_dest_type, 0, srcport) < 0)
 			IBERROR("can't resolve destination port %s", argv[0]);
 	} else {
-		if (ib_resolve_smlid(&portid, timeout) < 0)
+		if (resolve_sm_portid(ibd_ca, ibd_ca_port, &portid) < 0)
 			IBERROR("can't resolve sm port %s", argv[0]);
 	}
 
@@ -187,11 +140,12 @@ main(int argc, char **argv)
 	mad_encode_field(sminfo, IB_SMINFO_STATE_F, &state);
 
 	if (mod) {
-		if (!(p = smp_set(sminfo, &portid, IB_ATTR_SMINFO, mod, timeout)))
-			IBERROR("query");
-	} else
-		if (!(p = smp_query(sminfo, &portid, IB_ATTR_SMINFO, 0, timeout)))
+		if (!(p = smp_set_via(sminfo, &portid, IB_ATTR_SMINFO, mod,
+				      ibd_timeout, srcport)))
 			IBERROR("query");
+	} else if (!(p = smp_query_via(sminfo, &portid, IB_ATTR_SMINFO, 0,
+				       ibd_timeout, srcport)))
+		IBERROR("query");
 
 	mad_decode_field(sminfo, IB_SMINFO_GUID_F, &guid);
 	mad_decode_field(sminfo, IB_SMINFO_ACT_F, &act);
@@ -199,8 +153,10 @@ main(int argc, char **argv)
 	mad_decode_field(sminfo, IB_SMINFO_PRIO_F, &prio);
 	mad_decode_field(sminfo, IB_SMINFO_STATE_F, &state);
 
-	printf("sminfo: sm lid %d sm guid 0x%" PRIx64 ", activity count %u priority %d state %d %s\n",
-		portid.lid, guid, act, prio, state, STATESTR(state));
+	printf("sminfo: sm lid %d sm guid 0x%" PRIx64
+	       ", activity count %u priority %d state %d %s\n", portid.lid,
+	       guid, act, prio, state, STATESTR(state));
 
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/smpdump.c b/src/smpdump.c
index 209d7b1..4d67be7 100644
--- a/src/smpdump.c
+++ b/src/smpdump.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -35,145 +35,118 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
 #include <getopt.h>
-#include <endian.h>
-#include <byteswap.h>
-#include <sys/poll.h>
-#include <syslog.h>
 #include <netinet/in.h>
 
-#include <infiniband/common.h>
 #include <infiniband/mad.h>
 #include <infiniband/umad.h>
 
 #include <ibdiag_common.h>
 
-static const uint8_t  CLASS_SUBN_DIRECTED_ROUTE = 0x81;
-static const uint8_t  CLASS_SUBN_LID_ROUTE = 0x1;
-
-#define  ATTR_NODE_DESC ((uint16_t)(htons(0x10)))
-#define  ATTR_NODE_INFO ((uint16_t)(htons(0x11)))
-#define  ATTR_PORT_INFO ((uint16_t)(htons(0x15)))
-
 static int mad_agent;
 static int drmad_tid = 0x123;
 
-static int debug, verbose;
-
-char *argv0 = "smpdump";
-
 typedef struct {
 	char path[64];
 	int hop_cnt;
 } DRPath;
 
 struct drsmp {
-	uint8_t		base_version;
-	uint8_t		mgmt_class;
-	uint8_t		class_version;
-	uint8_t		method;
-	uint16_t	status;
-	uint8_t		hop_ptr;
-	uint8_t		hop_cnt;
-	uint64_t	tid;
-	uint16_t	attr_id;
-	uint16_t	resv;
-	uint32_t	attr_mod;
-	uint64_t	mkey;
-	uint16_t	dr_slid;
-	uint16_t	dr_dlid;
-	uint8_t		reserved[28];
-	uint8_t		data[64];
-	uint8_t		initial_path[64];
-	uint8_t		return_path[64];
+	uint8_t base_version;
+	uint8_t mgmt_class;
+	uint8_t class_version;
+	uint8_t method;
+	uint16_t status;
+	uint8_t hop_ptr;
+	uint8_t hop_cnt;
+	uint64_t tid;
+	uint16_t attr_id;
+	uint16_t resv;
+	uint32_t attr_mod;
+	uint64_t mkey;
+	uint16_t dr_slid;
+	uint16_t dr_dlid;
+	uint8_t reserved[28];
+	uint8_t data[64];
+	uint8_t initial_path[64];
+	uint8_t return_path[64];
 };
 
-void
-drsmp_get_init(void *umad, DRPath *path, int attr, int mod)
+void drsmp_get_init(void *umad, DRPath * path, int attr, int mod)
 {
 	struct drsmp *smp = (struct drsmp *)(umad_get_mad(umad));
 
-	memset(smp, 0, sizeof (*smp));
+	memset(smp, 0, sizeof(*smp));
 
-	smp->base_version  = 1;
-	smp->mgmt_class    = CLASS_SUBN_DIRECTED_ROUTE;
+	smp->base_version = 1;
+	smp->mgmt_class = IB_SMI_DIRECT_CLASS;
 	smp->class_version = 1;
 
-	smp->method        = 1;
-	smp->attr_id	   = (uint16_t)htons((uint16_t)attr);
-	smp->attr_mod	   = htonl(mod);
-	smp->tid           = htonll(drmad_tid++);
-	smp->dr_slid       = 0xffff;
-	smp->dr_dlid       = 0xffff;
+	smp->method = 1;
+	smp->attr_id = (uint16_t) htons((uint16_t) attr);
+	smp->attr_mod = htonl(mod);
+	smp->tid = htonll(drmad_tid++);
+	smp->dr_slid = 0xffff;
+	smp->dr_dlid = 0xffff;
 
 	umad_set_addr(umad, 0xffff, 0, 0, 0);
 
 	if (path)
-		memcpy(smp->initial_path, path->path, path->hop_cnt+1);
+		memcpy(smp->initial_path, path->path, path->hop_cnt + 1);
 
-	smp->hop_cnt = path->hop_cnt;
+	smp->hop_cnt = (uint8_t) path->hop_cnt;
 }
 
-void
-smp_get_init(void *umad, int lid, int attr, int mod)
+void smp_get_init(void *umad, int lid, int attr, int mod)
 {
 	struct drsmp *smp = (struct drsmp *)(umad_get_mad(umad));
 
-	memset(smp, 0, sizeof (*smp));
+	memset(smp, 0, sizeof(*smp));
 
-	smp->base_version  = 1;
-	smp->mgmt_class    = CLASS_SUBN_LID_ROUTE;
+	smp->base_version = 1;
+	smp->mgmt_class = IB_SMI_CLASS;
 	smp->class_version = 1;
 
-	smp->method        = 1;
-	smp->attr_id	   = (uint16_t)htons((uint16_t)attr);
-	smp->attr_mod	   = htonl(mod);
-	smp->tid           = htonll(drmad_tid++);
+	smp->method = 1;
+	smp->attr_id = (uint16_t) htons((uint16_t) attr);
+	smp->attr_mod = htonl(mod);
+	smp->tid = htonll(drmad_tid++);
 
-	umad_set_addr(umad, lid, 0, 0xffff, 0);
+	umad_set_addr(umad, lid, 0, 0, 0);
 }
 
-void
-drsmp_set_init(void *umad, DRPath *path, int attr, int mod, void *data)
+void drsmp_set_init(void *umad, DRPath * path, int attr, int mod, void *data)
 {
 	struct drsmp *smp = (struct drsmp *)(umad_get_mad(umad));
 
-	memset(smp, 0, sizeof (*smp));
+	memset(smp, 0, sizeof(*smp));
 
-	smp->method        = 2;		/* SET */
-	smp->attr_id	   = (uint16_t)htons((uint16_t)attr);
-	smp->attr_mod	   = htonl(mod);
-	smp->tid           = htonll(drmad_tid++);
-	smp->dr_slid       = 0xffff;
-	smp->dr_dlid       = 0xffff;
+	smp->method = 2;	/* SET */
+	smp->attr_id = (uint16_t) htons((uint16_t) attr);
+	smp->attr_mod = htonl(mod);
+	smp->tid = htonll(drmad_tid++);
+	smp->dr_slid = 0xffff;
+	smp->dr_dlid = 0xffff;
 
 	umad_set_addr(umad, 0xffff, 0, 0, 0);
 
 	if (path)
-		memcpy(smp->initial_path, path->path, path->hop_cnt+1);
+		memcpy(smp->initial_path, path->path, path->hop_cnt + 1);
 
 	if (data)
 		memcpy(smp->data, data, sizeof smp->data);
 
-	smp->hop_cnt = path->hop_cnt;
+	smp->hop_cnt = (uint8_t) path->hop_cnt;
 }
 
-char *
-drmad_status_str(struct drsmp *drsmp)
+char *drmad_status_str(struct drsmp *drsmp)
 {
 	switch (drsmp->status) {
 	case 0:
@@ -184,8 +157,7 @@ drmad_status_str(struct drsmp *drsmp)
 	return "unknown error";
 }
 
-int
-str2DRPath(char *str, DRPath *path)
+int str2DRPath(char *str, DRPath * path)
 {
 	char *s;
 
@@ -195,15 +167,15 @@ str2DRPath(char *str, DRPath *path)
 	while (str && *str) {
 		if ((s = strchr(str, ',')))
 			*s = 0;
-		path->path[++path->hop_cnt] = atoi(str);
+		path->path[++path->hop_cnt] = (char)atoi(str);
 		if (!s)
 			break;
-		str = s+1;
+		str = s + 1;
 	}
 
 #if 0
 	if (path->path[0] != 0 ||
-	   (path->hop_cnt > 0 && dev_port && path->path[1] != dev_port)) {
+	    (path->hop_cnt > 0 && dev_port && path->path[1] != dev_port)) {
 		DEBUG("hop 0 != 0 or hop 1 != dev_port");
 		return -1;
 	}
@@ -212,26 +184,29 @@ str2DRPath(char *str, DRPath *path)
 	return path->hop_cnt;
 }
 
-void
-usage(void)
+static int dump_char, mgmt_class = IB_SMI_CLASS;
+
+static int process_opt(void *context, int ch, char *optarg)
 {
-	fprintf(stderr, "Usage: %s [-s(ring) -D(irect) -V(ersion) -C ca_name -P ca_port -t(imeout) timeout_ms] <dlid|dr_path> <attr> [mod]\n", argv0);
-	fprintf(stderr, "\tDR examples:\n");
-	fprintf(stderr, "\t\t%s -D 0,1,2,3,5 16	# NODE DESC\n", argv0);
-	fprintf(stderr, "\t\t%s -D 0,1,2 0x15 2	# PORT INFO, port 2\n", argv0);
-	fprintf(stderr, "\n\tLID routed examples:\n");
-	fprintf(stderr, "\t\t%s 3 0x15 2	# PORT INFO, lid 3 port 2\n", argv0);
-	fprintf(stderr, "\t\t%s 0xa0 0x11	# NODE INFO, lid 0xa0\n", argv0);
-	fprintf(stderr, "\n");
-	exit(-1);
+	switch (ch) {
+	case 's':
+		dump_char++;
+		break;
+	case 'D':
+		mgmt_class = IB_SMI_DIRECT_CLASS;
+		break;
+	case 'L':
+		mgmt_class = IB_SMI_CLASS;
+		break;
+	default:
+		return -1;
+	}
+	return 0;
 }
 
-int
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
 {
-	int dump_char = 0, timeout_ms = 1000;
-	int dev_port = 0, mgmt_class = CLASS_SUBN_LID_ROUTE, dlid = 0;
-	char *dev_name = 0;
+	int dlid = 0;
 	void *umad;
 	struct drsmp *smp;
 	int i, portid, mod = 0, attr;
@@ -239,66 +214,37 @@ main(int argc, char *argv[])
 	uint8_t *desc;
 	int length;
 
-	static char const str_opts[] = "C:P:t:dsDVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "sring", 0, 0, 's'},
-		{ "Direct", 0, 0, 'D'},
-		{ "timeout", 1, 0, 't'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+	const struct ibdiag_opt opts[] = {
+		{"string", 's', 0, NULL, ""},
+		{0}
+	};
+	char usage_args[] = "<dlid|dr_path> <attr> [mod]";
+	const char *usage_examples[] = {
+		" -- DR routed examples:",
+		"-D 0,1,2,3,5 16	# NODE DESC",
+		"-D 0,1,2 0x15 2	# PORT INFO, port 2",
+		" -- LID routed examples:",
+		"3 0x15 2	# PORT INFO, lid 3 port 2",
+		"0xa0 0x11	# NODE INFO, lid 0xa0",
+		NULL
 	};
 
-	argv0 = argv[0];
+	ibd_timeout = 1000;
+
+	ibdiag_process_opts(argc, argv, NULL, "GKs", opts, process_opt,
+			    usage_args, usage_examples);
 
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 's':
-			dump_char++;
-			break;
-		case 'd':
-			debug++;
-			if (debug > 1)
-				umad_debug(debug-1);
-			break;
-		case 'D':
-			mgmt_class = CLASS_SUBN_DIRECTED_ROUTE;
-			break;
-		case 'C':
-			dev_name = optarg;
-			break;
-		case 'P':
-			dev_port = atoi(optarg);
-			break;
-		case 't':
-			timeout_ms = strtoul(optarg, 0, 0);
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
-			break;
-		}
-	}
 	argc -= optind;
 	argv += optind;
 
 	if (argc < 2)
-		usage();
+		ibdiag_show_usage();
 
-	if (mgmt_class == CLASS_SUBN_DIRECTED_ROUTE &&
+	if (mgmt_class == IB_SMI_DIRECT_CLASS &&
 	    str2DRPath(strdupa(argv[0]), &path) < 0)
 		IBPANIC("bad path str '%s'", argv[0]);
 
-	if (mgmt_class == CLASS_SUBN_LID_ROUTE)
+	if (mgmt_class == IB_SMI_CLASS)
 		dlid = strtoul(argv[0], 0, 0);
 
 	attr = strtoul(argv[1], 0, 0);
@@ -308,8 +254,8 @@ main(int argc, char *argv[])
 	if (umad_init() < 0)
 		IBPANIC("can't init UMAD library");
 
-	if ((portid = umad_open_port(dev_name, dev_port)) < 0)
-		IBPANIC("can't open UMAD port (%s:%d)", dev_name, dev_port);
+	if ((portid = umad_open_port(ibd_ca, ibd_ca_port)) < 0)
+		IBPANIC("can't open UMAD port (%s:%d)", ibd_ca, ibd_ca_port);
 
 	if ((mad_agent = umad_register(portid, mgmt_class, 1, 0, 0)) < 0)
 		IBPANIC("Couldn't register agent for SMPs");
@@ -319,16 +265,16 @@ main(int argc, char *argv[])
 
 	smp = umad_get_mad(umad);
 
-	if (mgmt_class == CLASS_SUBN_DIRECTED_ROUTE)
+	if (mgmt_class == IB_SMI_DIRECT_CLASS)
 		drsmp_get_init(umad, &path, attr, mod);
 	else
 		smp_get_init(umad, dlid, attr, mod);
 
-	if (debug > 1)
+	if (ibdebug > 1)
 		xdump(stderr, "before send:\n", smp, 256);
 
 	length = IB_MAD_SIZE;
-	if (umad_send(portid, mad_agent, umad, length, timeout_ms, 0) < 0)
+	if (umad_send(portid, mad_agent, umad, length, ibd_timeout, 0) < 0)
 		IBPANIC("send failed");
 
 	if (umad_recv(portid, umad, &length, -1) != mad_agent)
@@ -337,8 +283,9 @@ main(int argc, char *argv[])
 	if (!dump_char) {
 		xdump(stdout, 0, smp->data, 64);
 		if (smp->status)
-			fprintf(stdout, "SMP status: 0x%x\n", ntohs(smp->status));
-		return 0;
+			fprintf(stdout, "SMP status: 0x%x\n",
+				ntohs(smp->status));
+		goto exit;
 	}
 
 	desc = smp->data;
@@ -350,5 +297,8 @@ main(int argc, char *argv[])
 	putchar('\n');
 	if (smp->status)
 		fprintf(stdout, "SMP status: 0x%x\n", ntohs(smp->status));
+
+exit:
+	umad_free(umad);
 	return 0;
 }
diff --git a/src/smpquery.c b/src/smpquery.c
index 0e55afb..66354e0 100644
--- a/src/smpquery.c
+++ b/src/smpquery.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2011 Mellanox Technologies LTD.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,13 +34,11 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
-#include <time.h>
 #include <string.h>
 #include <getopt.h>
 #include <netinet/in.h>
@@ -47,64 +46,59 @@
 #define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
-#include <infiniband/complib/cl_nodenamemap.h>
+#include <complib/cl_nodenamemap.h>
 
 #include "ibdiag_common.h"
 
-#undef DEBUG
-#define	DEBUG	if (verbose>1) IBWARN
+struct ibmad_port *srcport;
 
-static int dest_type = IB_DEST_LID;
-static int verbose;
-
-typedef char *(op_fn_t)(ib_portid_t *dest, char **argv, int argc);
+typedef char *(op_fn_t) (ib_portid_t * dest, char **argv, int argc);
 
 typedef struct match_rec {
-	char *name;
+	const char *name, *alias;
 	op_fn_t *fn;
 	unsigned opt_portnum;
 } match_rec_t;
 
-static op_fn_t	node_desc, node_info, port_info, switch_info, pkey_table,
-	sl2vl_table, vlarb_table, guid_info;
+static op_fn_t node_desc, node_info, port_info, switch_info, pkey_table,
+    sl2vl_table, vlarb_table, guid_info, mlnx_ext_port_info;
 
 static const match_rec_t match_tbl[] = {
-	{ "nodeinfo", node_info },
-	{ "nodedesc", node_desc },
-	{ "portinfo", port_info, 1 },
-	{ "switchinfo", switch_info },
-	{ "pkeys", pkey_table, 1 },
-	{ "sl2vl", sl2vl_table, 1 },
-	{ "vlarb", vlarb_table, 1 },
-	{ "guids", guid_info },
+	{"NodeInfo", "NI", node_info},
+	{"NodeDesc", "ND", node_desc},
+	{"PortInfo", "PI", port_info, 1},
+	{"SwitchInfo", "SI", switch_info},
+	{"PKeyTable", "PKeys", pkey_table, 1},
+	{"SL2VLTable", "SL2VL", sl2vl_table, 1},
+	{"VLArbitration", "VLArb", vlarb_table, 1},
+	{"GUIDInfo", "GI", guid_info},
+	{"MlnxExtPortInfo", "MEPI", mlnx_ext_port_info, 1},
 	{0}
 };
 
-char *argv0 = "smpquery";
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
+static int extended_speeds = 0;
 
 /*******************************************/
-static char *
-node_desc(ib_portid_t *dest, char **argv, int argc)
+static char *node_desc(ib_portid_t * dest, char **argv, int argc)
 {
-	int       node_type, l;
-	uint64_t  node_guid;
-	char      nd[IB_SMP_DATA_SIZE];
-	uint8_t   data[IB_SMP_DATA_SIZE];
-	char      dots[128];
-	char     *nodename = NULL;
-
-	if (!smp_query(data, dest, IB_ATTR_NODE_INFO, 0, 0))
+	int node_type, l;
+	uint64_t node_guid;
+	char nd[IB_SMP_DATA_SIZE] = { 0 };
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
+	char dots[128];
+	char *nodename = NULL;
+
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
 		return "node info query failed";
 
 	mad_decode_field(data, IB_NODE_TYPE_F, &node_type);
 	mad_decode_field(data, IB_NODE_GUID_F, &node_guid);
 
-	if (!smp_query(nd, dest, IB_ATTR_NODE_DESC, 0, 0))
+	if (!smp_query_via(nd, dest, IB_ATTR_NODE_DESC, 0, 0, srcport))
 		return "node desc query failed";
 
 	nodename = remap_node_name(node_name_map, node_guid, nd);
@@ -123,13 +117,12 @@ node_desc(ib_portid_t *dest, char **argv, int argc)
 	return 0;
 }
 
-static char *
-node_info(ib_portid_t *dest, char **argv, int argc)
+static char *node_info(ib_portid_t * dest, char **argv, int argc)
 {
 	char buf[2048];
-	char data[IB_SMP_DATA_SIZE];
+	char data[IB_SMP_DATA_SIZE] = { 0 };
 
-	if (!smp_query(data, dest, IB_ATTR_NODE_INFO, 0, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
 		return "node info query failed";
 
 	mad_dump_nodeinfo(buf, sizeof buf, data, sizeof data);
@@ -138,32 +131,49 @@ node_info(ib_portid_t *dest, char **argv, int argc)
 	return 0;
 }
 
-static char *
-port_info(ib_portid_t *dest, char **argv, int argc)
+static char *port_info(ib_portid_t * dest, char **argv, int argc)
 {
-	char buf[2048];
+	char data[IB_SMP_DATA_SIZE] = { 0 };
+	int portnum = 0, orig_portnum;
+
+	if (argc > 0)
+		portnum = strtol(argv[0], 0, 0);
+	orig_portnum = portnum;
+	if (extended_speeds)
+		portnum |= 1 << 31;
+
+	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
+		return "port info query failed";
+
+	printf("# Port info: %s port %d\n", portid2str(dest), orig_portnum);
+	dump_portinfo(data, sizeof data, 0);
+	return 0;
+}
+
+static char *mlnx_ext_port_info(ib_portid_t * dest, char **argv, int argc)
+{
+	char buf[2300];
 	char data[IB_SMP_DATA_SIZE];
 	int portnum = 0;
 
 	if (argc > 0)
 		portnum = strtol(argv[0], 0, 0);
 
-	if (!smp_query(data, dest, IB_ATTR_PORT_INFO, portnum, 0))
-		return "port info query failed";
+	if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO, portnum, 0, srcport))
+		return "Mellanox ext port info query failed";
 
-	mad_dump_portinfo(buf, sizeof buf, data, sizeof data);
+	mad_dump_mlnx_ext_port_info(buf, sizeof buf, data, sizeof data);
 
-	printf("# Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
+	printf("# MLNX ext Port info: %s port %d\n%s", portid2str(dest), portnum, buf);
 	return 0;
 }
 
-static char *
-switch_info(ib_portid_t *dest, char **argv, int argc)
+static char *switch_info(ib_portid_t * dest, char **argv, int argc)
 {
 	char buf[2048];
-	char data[IB_SMP_DATA_SIZE];
+	char data[IB_SMP_DATA_SIZE] = { 0 };
 
-	if (!smp_query(data, dest, IB_ATTR_SWITCH_INFO, 0, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_SWITCH_INFO, 0, 0, srcport))
 		return "switch info query failed";
 
 	mad_dump_switchinfo(buf, sizeof buf, data, sizeof data);
@@ -172,13 +182,12 @@ switch_info(ib_portid_t *dest, char **argv, int argc)
 	return 0;
 }
 
-static char *
-pkey_table(ib_portid_t *dest, char **argv, int argc)
+static char *pkey_table(ib_portid_t * dest, char **argv, int argc)
 {
-	uint8_t data[IB_SMP_DATA_SIZE];
-	uint32_t i, j, k;
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
+	int i, j, k;
 	uint16_t *p;
-	uint mod;
+	unsigned mod;
 	int n, t, phy_ports;
 	int portnum = 0;
 
@@ -186,7 +195,7 @@ pkey_table(ib_portid_t *dest, char **argv, int argc)
 		portnum = strtol(argv[0], 0, 0);
 
 	/* Get the partition capacity */
-	if (!smp_query(data, dest, IB_ATTR_NODE_INFO, 0, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
 		return "node info query failed";
 
 	mad_decode_field(data, IB_NODE_TYPE_F, &t);
@@ -195,15 +204,17 @@ pkey_table(ib_portid_t *dest, char **argv, int argc)
 		return "invalid port number";
 
 	if ((t == IB_NODE_SWITCH) && (portnum != 0)) {
-		if (!smp_query(data, dest, IB_ATTR_SWITCH_INFO, 0, 0))
+		if (!smp_query_via(data, dest, IB_ATTR_SWITCH_INFO, 0, 0,
+				   srcport))
 			return "switch info failed";
 		mad_decode_field(data, IB_SW_PARTITION_ENFORCE_CAP_F, &n);
 	} else
 		mad_decode_field(data, IB_NODE_PARTITION_CAP_F, &n);
 
 	for (i = 0; i < (n + 31) / 32; i++) {
-		mod =  i | (portnum << 16);
-		if (!smp_query(data, dest, IB_ATTR_PKEY_TBL, mod, 0))
+		mod = i | (portnum << 16);
+		if (!smp_query_via(data, dest, IB_ATTR_PKEY_TBL, mod, 0,
+				   srcport))
 			return "pkey table query failed";
 		if (i + 1 == (n + 31) / 32)
 			k = ((n + 7 - i * 32) / 8) * 8;
@@ -211,12 +222,11 @@ pkey_table(ib_portid_t *dest, char **argv, int argc)
 			k = 32;
 		p = (uint16_t *) data;
 		for (j = 0; j < k; j += 8, p += 8) {
-			printf("%4u: 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
-				(i * 32) + j,
-				ntohs(p[0]), ntohs(p[1]),
-				ntohs(p[2]), ntohs(p[3]),
-				ntohs(p[4]), ntohs(p[5]),
-				ntohs(p[6]), ntohs(p[7]));
+			printf
+			    ("%4u: 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+			     (i * 32) + j, ntohs(p[0]), ntohs(p[1]),
+			     ntohs(p[2]), ntohs(p[3]), ntohs(p[4]), ntohs(p[5]),
+			     ntohs(p[6]), ntohs(p[7]));
 		}
 	}
 	printf("%d pkeys capacity for this port\n", n);
@@ -224,13 +234,13 @@ pkey_table(ib_portid_t *dest, char **argv, int argc)
 	return 0;
 }
 
-static char *sl2vl_dump_table_entry(ib_portid_t *dest, int in, int out)
+static char *sl2vl_dump_table_entry(ib_portid_t * dest, int in, int out)
 {
 	char buf[2048];
-	char data[IB_SMP_DATA_SIZE];
+	char data[IB_SMP_DATA_SIZE] = { 0 };
 	int portnum = (in << 8) | out;
 
-	if (!smp_query(data, dest, IB_ATTR_SLVL_TABLE, portnum, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_SLVL_TABLE, portnum, 0, srcport))
 		return "slvl query failed";
 
 	mad_dump_sltovl(buf, sizeof buf, data, sizeof data);
@@ -239,10 +249,9 @@ static char *sl2vl_dump_table_entry(ib_portid_t *dest, int in, int out)
 	return 0;
 }
 
-static char *
-sl2vl_table(ib_portid_t *dest, char **argv, int argc)
+static char *sl2vl_table(ib_portid_t * dest, char **argv, int argc)
 {
-	uint8_t data[IB_SMP_DATA_SIZE];
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	int type, num_ports, portnum = 0;
 	int i;
 	char *ret;
@@ -250,7 +259,7 @@ sl2vl_table(ib_portid_t *dest, char **argv, int argc)
 	if (argc > 0)
 		portnum = strtol(argv[0], 0, 0);
 
-	if (!smp_query(data, dest, IB_ATTR_NODE_INFO, 0, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0, srcport))
 		return "node info query failed";
 
 	mad_decode_field(data, IB_NODE_TYPE_F, &type);
@@ -260,14 +269,14 @@ sl2vl_table(ib_portid_t *dest, char **argv, int argc)
 
 	printf("# SL2VL table: %s\n", portid2str(dest));
 	printf("#                 SL: |");
-	for (i = 0 ; i < 16 ; i++)
+	for (i = 0; i < 16; i++)
 		printf("%2d|", i);
 	printf("\n");
 
 	if (type != IB_NODE_SWITCH)
 		return sl2vl_dump_table_entry(dest, 0, 0);
 
-	for (i = 0 ; i <= num_ports ; i++) {
+	for (i = 0; i <= num_ports; i++) {
 		ret = sl2vl_dump_table_entry(dest, i, portnum);
 		if (ret)
 			return ret;
@@ -275,21 +284,22 @@ sl2vl_table(ib_portid_t *dest, char **argv, int argc)
 	return 0;
 }
 
-static char *vlarb_dump_table_entry(ib_portid_t *dest, int portnum, int offset, unsigned cap)
+static char *vlarb_dump_table_entry(ib_portid_t * dest, int portnum, int offset,
+				    unsigned cap)
 {
 	char buf[2048];
-	char data[IB_SMP_DATA_SIZE];
+	char data[IB_SMP_DATA_SIZE] = { 0 };
 
-	if (!smp_query(data, dest, IB_ATTR_VL_ARBITRATION,
-			(offset << 16) | portnum, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_VL_ARBITRATION,
+			   (offset << 16) | portnum, 0, srcport))
 		return "vl arb query failed";
 	mad_dump_vlarbitration(buf, sizeof(buf), data, cap * 2);
 	printf("%s", buf);
 	return 0;
 }
 
-static char *vlarb_dump_table(ib_portid_t *dest, int portnum,
-	char *name, int offset, int cap)
+static char *vlarb_dump_table(ib_portid_t * dest, int portnum,
+			      char *name, int offset, int cap)
 {
 	char *ret;
 
@@ -302,10 +312,9 @@ static char *vlarb_dump_table(ib_portid_t *dest, int portnum,
 	return ret;
 }
 
-static char *
-vlarb_table(ib_portid_t *dest, char **argv, int argc)
+static char *vlarb_table(ib_portid_t * dest, char **argv, int argc)
 {
-	uint8_t data[IB_SMP_DATA_SIZE];
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
 	int portnum = 0;
 	int type, enhsp0, lowcap, highcap;
 	char *ret = 0;
@@ -315,30 +324,35 @@ vlarb_table(ib_portid_t *dest, char **argv, int argc)
 
 	/* port number of 0 could mean SP0 or port MAD arrives on */
 	if (portnum == 0) {
-		if (!smp_query(data, dest, IB_ATTR_NODE_INFO, 0, 0))
+		if (!smp_query_via(data, dest, IB_ATTR_NODE_INFO, 0, 0,
+				   srcport))
 			return "node info query failed";
 
 		mad_decode_field(data, IB_NODE_TYPE_F, &type);
 		if (type == IB_NODE_SWITCH) {
-			if (!smp_query(data, dest, IB_ATTR_SWITCH_INFO, 0, 0))
+			memset(data, 0, sizeof(data));
+			if (!smp_query_via(data, dest, IB_ATTR_SWITCH_INFO, 0,
+					   0, srcport))
 				return "switch info query failed";
 			mad_decode_field(data, IB_SW_ENHANCED_PORT0_F, &enhsp0);
 			if (!enhsp0) {
-				printf("# No VLArbitration tables (BSP0): %s port %d\n",
-                        		portid2str(dest), 0);
+				printf
+				    ("# No VLArbitration tables (BSP0): %s port %d\n",
+				     portid2str(dest), 0);
 				return 0;
 			}
+			memset(data, 0, sizeof(data));
 		}
 	}
 
-	if (!smp_query(data, dest, IB_ATTR_PORT_INFO, portnum, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, portnum, 0, srcport))
 		return "port info query failed";
 
 	mad_decode_field(data, IB_PORT_VL_ARBITRATION_LOW_CAP_F, &lowcap);
-	mad_decode_field(data, IB_PORT_VL_ARBITRATION_HIGH_CAP_F,&highcap);
+	mad_decode_field(data, IB_PORT_VL_ARBITRATION_HIGH_CAP_F, &highcap);
 
 	printf("# VLArbitration tables: %s port %d LowCap %d HighCap %d\n",
-			portid2str(dest), portnum, lowcap, highcap);
+	       portid2str(dest), portnum, lowcap, highcap);
 
 	if (lowcap > 0)
 		ret = vlarb_dump_table(dest, portnum, "Low", 1, lowcap);
@@ -349,23 +363,23 @@ vlarb_table(ib_portid_t *dest, char **argv, int argc)
 	return ret;
 }
 
-static char *
-guid_info(ib_portid_t *dest, char **argv, int argc)
+static char *guid_info(ib_portid_t * dest, char **argv, int argc)
 {
-	uint8_t data[IB_SMP_DATA_SIZE];
-	uint32_t i, j, k;
+	uint8_t data[IB_SMP_DATA_SIZE] = { 0 };
+	int i, j, k;
 	uint64_t *p;
-	uint mod;
+	unsigned mod;
 	int n;
 
 	/* Get the guid capacity */
-	if (!smp_query(data, dest, IB_ATTR_PORT_INFO, 0, 0))
+	if (!smp_query_via(data, dest, IB_ATTR_PORT_INFO, 0, 0, srcport))
 		return "port info failed";
 	mad_decode_field(data, IB_PORT_GUID_CAP_F, &n);
 
 	for (i = 0; i < (n + 7) / 8; i++) {
-		mod =  i;
-		if (!smp_query(data, dest, IB_ATTR_GUID_INFO, mod, 0))
+		mod = i;
+		if (!smp_query_via(data, dest, IB_ATTR_GUID_INFO, mod, 0,
+				   srcport))
 			return "guid info query failed";
 		if (i + 1 == (n + 7) / 8)
 			k = ((n + 1 - i * 8) / 2) * 2;
@@ -373,9 +387,8 @@ guid_info(ib_portid_t *dest, char **argv, int argc)
 			k = 8;
 		p = (uint64_t *) data;
 		for (j = 0; j < k; j += 2, p += 2) {
-			printf("%4u: 0x%016"PRIx64" 0x%016"PRIx64"\n",
-				(i * 8) + j,
-				ntohll(p[0]), ntohll(p[1]));
+			printf("%4u: 0x%016" PRIx64 " 0x%016" PRIx64 "\n",
+			       (i * 8) + j, ntohll(p[0]), ntohll(p[1]));
 		}
 	}
 	printf("%d guids capacity for this port\n", n);
@@ -383,156 +396,109 @@ guid_info(ib_portid_t *dest, char **argv, int argc)
 	return 0;
 }
 
-static op_fn_t *
-match_op(char *name)
+static op_fn_t *match_op(char *name)
 {
 	const match_rec_t *r;
 	for (r = match_tbl; r->name; r++)
-		if (!strcmp(r->name, name))
+		if (!strcasecmp(r->name, name) ||
+		    (r->alias && !strcasecmp(r->alias, name)))
 			return r->fn;
-	return 0;
+	return NULL;
 }
 
-static void
-usage(void)
+static int process_opt(void *context, int ch, char *optarg)
 {
-	char *basename;
-	const match_rec_t *r;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -e(rr_show) -v(erbose) -D(irect) -G(uid) -s smlid -V(ersion) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms --node-name-map node-name-map] <op> <dest dr_path|lid|guid> [op params]\n",
-			basename);
-	fprintf(stderr, "\tsupported ops:\n");
-	for (r = match_tbl ; r->name ; r++) {
-		fprintf(stderr, "\t\t%s <addr>%s\n", r->name,
-				r->opt_portnum ? " [<portnum>]" : "");
+	switch (ch) {
+	case 1:
+		node_name_map_file = strdup(optarg);
+		break;
+	case 'c':
+		ibd_dest_type = IB_DEST_DRSLID;
+		break;
+	case 'x':
+		extended_speeds = 1;
+		break;
+	default:
+		return -1;
 	}
-	fprintf(stderr, "\n\texamples:\n");
-	fprintf(stderr, "\t\t%s portinfo 3 1\t\t\t\t# portinfo by lid, with port modifier\n", basename);
-	fprintf(stderr, "\t\t%s -G switchinfo 0x2C9000100D051 1\t# switchinfo by guid\n", basename);
-	fprintf(stderr, "\t\t%s -D nodeinfo 0\t\t\t\t# nodeinfo by direct route\n", basename);
-	fprintf(stderr, "\t\t%s -c nodeinfo 6 0,12\t\t\t# nodeinfo by combined route\n", basename);
-	exit(-1);
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
 {
-	int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};
-	ib_portid_t portid = {0};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	extern int ibdebug;
-	int timeout = 0, udebug = 0;
-	char *ca = 0;
-	int ca_port = 0;
+	char usage_args[1024];
+	int mgmt_classes[3] =
+	    { IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS };
+	ib_portid_t portid = { 0 };
 	char *err;
 	op_fn_t *fn;
+	const match_rec_t *r;
+	int n;
 
-	static char const str_opts[] = "C:P:t:s:devDcGVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "debug", 0, 0, 'd'},
-		{ "err_show", 0, 0, 'e'},
-		{ "verbose", 0, 0, 'v'},
-		{ "Direct", 0, 0, 'D'},
-		{ "combined", 0, 0, 'c'},
-		{ "Guid", 0, 0, 'G'},
-		{ "smlid", 1, 0, 's'},
-		{ "timeout", 1, 0, 't'},
-		{ "node-name-map", 1, 0, 1},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
+	const struct ibdiag_opt opts[] = {
+		{"combined", 'c', 0, NULL,
+		 "use Combined route address argument"},
+		{"node-name-map", 1, 1, "<file>", "node name map file"},
+		{"extended", 'x', 0, NULL, "use extended speeds"},
+		{0}
+	};
+	const char *usage_examples[] = {
+		"portinfo 3 1\t\t\t\t# portinfo by lid, with port modifier",
+		"-G switchinfo 0x2C9000100D051 1\t# switchinfo by guid",
+		"-D nodeinfo 0\t\t\t\t# nodeinfo by direct route",
+		"-c nodeinfo 6 0,12\t\t\t# nodeinfo by combined route",
+		NULL
 	};
 
-	argv0 = argv[0];
-
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 1:
-			node_name_map_file = strdup(optarg);
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'e':
-			madrpc_show_errors(1);
-			break;
-		case 'D':
-			dest_type = IB_DEST_DRPATH;
-			break;
-		case 'c':
-			dest_type = IB_DEST_DRSLID;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
-			break;
-		case 'v':
-			verbose++;
-			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
+	n = sprintf(usage_args, "<op> <dest dr_path|lid|guid> [op params]\n"
+		    "\nSupported ops (and aliases, case insensitive):\n");
+	for (r = match_tbl; r->name; r++) {
+		n += snprintf(usage_args + n, sizeof(usage_args) - n,
+			      "  %s (%s) <addr>%s\n", r->name,
+			      r->alias ? r->alias : "",
+			      r->opt_portnum ? " [<portnum>]" : "");
+		if (n >= sizeof(usage_args))
 			exit(-1);
-		default:
-			usage();
-			break;
-		}
 	}
+
+	ibdiag_process_opts(argc, argv, NULL, NULL, opts, process_opt,
+			    usage_args, usage_examples);
+
 	argc -= optind;
 	argv += optind;
 
 	if (argc < 2)
-		usage();
+		ibdiag_show_usage();
 
 	if (!(fn = match_op(argv[0])))
 		IBERROR("operation '%s' not supported", argv[0]);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 3);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
+
+	smp_mkey_set(srcport, ibd_mkey);
+
 	node_name_map = open_node_name_map(node_name_map_file);
 
-	if (dest_type != IB_DEST_DRSLID) {
-		if (ib_resolve_portid_str(&portid, argv[1], dest_type, sm_id) < 0)
+	if (ibd_dest_type != IB_DEST_DRSLID) {
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[1],
+				       ibd_dest_type, ibd_sm_id, srcport) < 0)
 			IBERROR("can't resolve destination port %s", argv[1]);
-		if ((err = fn(&portid, argv+2, argc-2)))
+		if ((err = fn(&portid, argv + 2, argc - 2)))
 			IBERROR("operation %s: %s", argv[0], err);
 	} else {
 		char concat[64];
 
 		memset(concat, 0, 64);
 		snprintf(concat, sizeof(concat), "%s %s", argv[1], argv[2]);
-		if (ib_resolve_portid_str(&portid, concat, dest_type, sm_id) < 0)
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, concat,
+				       ibd_dest_type, ibd_sm_id, srcport) < 0)
 			IBERROR("can't resolve destination port %s", concat);
-		if ((err = fn(&portid, argv+3, argc-3)))
+		if ((err = fn(&portid, argv + 3, argc - 3)))
 			IBERROR("operation %s: %s", argv[0], err);
 	}
 	close_node_name_map(node_name_map);
+	mad_rpc_close_port(srcport);
 	exit(0);
 }
diff --git a/src/vendstat.c b/src/vendstat.c
index 0674986..8535792 100644
--- a/src/vendstat.c
+++ b/src/vendstat.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2004-2008 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2012 Mellanox Technologies LTD.  All rights reserved.
+ * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -33,16 +34,14 @@
 
 #if HAVE_CONFIG_H
 #  include <config.h>
-#endif /* HAVE_CONFIG_H */
+#endif				/* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <stdarg.h>
 #include <getopt.h>
 #include <netinet/in.h>
 
-#include <infiniband/common.h>
 #include <infiniband/umad.h>
 #include <infiniband/mad.h>
 
@@ -54,15 +53,18 @@
 /* Vendor specific Attribute IDs */
 #define IB_MLX_IS3_GENERAL_INFO		0x17
 #define IB_MLX_IS3_CONFIG_SPACE_ACCESS	0x50
+#define IB_MLX_IS4_COUNTER_GROUP_INFO   0x90
+#define IB_MLX_IS4_CONFIG_COUNTER_GROUP 0x91
 /* Config space addresses */
 #define IB_MLX_IS3_PORT_XMIT_WAIT	0x10013C
 
-char *argv0 = "vendstat";
+
+struct ibmad_port *srcport;
 
 typedef struct {
 	uint16_t hw_revision;
 	uint16_t device_id;
-	uint8_t  reserved[24];
+	uint8_t reserved[24];
 	uint32_t uptime;
 } is3_hw_info_t;
 
@@ -82,6 +84,12 @@ typedef struct {
 } is3_fw_info_t;
 
 typedef struct {
+	uint32_t ext_major;
+	uint32_t ext_minor;
+	uint32_t ext_sub_minor;
+} is4_fw_ext_info_t;
+
+typedef struct {
 	uint8_t resv1;
 	uint8_t major;
 	uint8_t minor;
@@ -90,219 +98,389 @@ typedef struct {
 } is3_sw_info_t;
 
 typedef struct {
-	uint8_t       reserved[8];
+	uint8_t reserved[8];
 	is3_hw_info_t hw_info;
 	is3_fw_info_t fw_info;
 	is3_sw_info_t sw_info;
 } is3_general_info_t;
 
 typedef struct {
-	uint32_t address;
-	uint32_t data;
-	uint32_t mask;
-} is3_record_t;
+	uint8_t reserved[8];
+	is3_hw_info_t hw_info;
+	is3_fw_info_t fw_info;
+	is4_fw_ext_info_t ext_fw_info;
+	is3_sw_info_t sw_info;
+} is4_general_info_t;
 
 typedef struct {
-	uint8_t      reserved[8];
-	is3_record_t record[18];
+	uint8_t reserved[8];
+	struct is3_record {
+		uint32_t address;
+		uint32_t data;
+		uint32_t mask;
+	} record[18];
 } is3_config_space_t;
 
-static void
-usage(void)
+#define COUNTER_GROUPS_NUM 2
+
+typedef struct {
+	uint8_t reserved1[8];
+	uint8_t reserved[3];
+	uint8_t num_of_counter_groups;
+	uint32_t group_masks[COUNTER_GROUPS_NUM];
+} is4_counter_group_info_t;
+
+typedef struct {
+	uint8_t reserved[3];
+	uint8_t group_select;
+} is4_group_select_t;
+
+typedef struct {
+	uint8_t reserved1[8];
+	uint8_t reserved[4];
+	is4_group_select_t group_selects[COUNTER_GROUPS_NUM];
+} is4_config_counter_groups_t;
+
+static uint16_t ext_fw_info_device[][2] = {
+	{0x0245, 0x0245},	/* Switch-X */
+	{0xc738, 0xc738},	/* Switch-X */
+	{0x01b3, 0x01b3},	/* IS-4 */
+	{0x1003, 0x1011},	/* Connect-X */
+	{0x0000, 0x0000}};
+
+static int is_ext_fw_info_supported(uint16_t device_id) {
+	int i;
+	for (i = 0; ext_fw_info_device[i][0]; i++)
+		if (ext_fw_info_device[i][0] <= device_id &&
+		    device_id <= ext_fw_info_device[i][1])
+			return 1;
+	return 0;
+}
+
+static int do_vendor(ib_portid_t *portid, struct ibmad_port *srcport,
+		     uint8_t class, uint8_t method, uint16_t attr_id,
+		     uint32_t attr_mod, void *data)
 {
-	char *basename;
-
-	if (!(basename = strrchr(argv0, '/')))
-		basename = argv0;
-	else
-		basename++;
-
-	fprintf(stderr, "Usage: %s [-d(ebug) -N -w -G(uid) -C ca_name -P ca_port "
-			"-t(imeout) timeout_ms -V(ersion) -h(elp)] <lid|guid>\n",
-			basename);
-	fprintf(stderr, "\tExamples:\n");
-	fprintf(stderr, "\t\t%s -N 6\t\t# read IS3 general information\n", basename);
-	fprintf(stderr, "\t\t%s -w 6\t\t# read IS3 port xmit wait counters\n", basename);
-	exit(-1);
+	ib_vendor_call_t call;
+
+	memset(&call, 0, sizeof(call));
+	call.mgmt_class = class;
+	call.method = method;
+	call.timeout = ibd_timeout;
+	call.attrid = attr_id;
+	call.mod = attr_mod;
+
+	if (!ib_vendor_call_via(data, portid, &call, srcport))
+		IBERROR("vendstat: method %u, attribute %u", method, attr_id);
+
+	return 0;
 }
 
-int
-main(int argc, char **argv)
+static void do_config_space_records(ib_portid_t *portid, unsigned set,
+				    is3_config_space_t *cs, unsigned records)
+{
+	unsigned i;
+
+	if (records > 18)
+		records = 18;
+	for (i = 0; i < records; i++) {
+		cs->record[i].address = htonl(cs->record[i].address);
+		cs->record[i].data = htonl(cs->record[i].data);
+		cs->record[i].mask = htonl(cs->record[i].mask);
+	}
+
+	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS,
+		      set ? IB_MAD_METHOD_SET : IB_MAD_METHOD_GET,
+		      IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | records << 16,
+		      cs))
+		IBERROR("cannot %s config space records", set ? "set" : "get");
+
+	for (i = 0; i < records; i++) {
+		printf("Config space record at 0x%x: 0x%x\n",
+		       ntohl(cs->record[i].address),
+		       ntohl(cs->record[i].data & cs->record[i].mask));
+	}
+}
+
+static void counter_groups_info(ib_portid_t * portid, int port)
 {
-	int mgmt_classes[4] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS, IB_MLX_VENDOR_CLASS};
-	ib_portid_t *sm_id = 0, sm_portid = {0};
-	ib_portid_t portid = {0};
-	extern int ibdebug;
-	int dest_type = IB_DEST_LID;
-	int timeout = 0;	/* use default */
-	int port = 0;
 	char buf[1024];
-	int udebug = 0;
-	char *ca = 0;
-	int ca_port = 0;
-	ib_vendor_call_t call;
-	is3_general_info_t *gi;
-	is3_config_space_t *cs;
-	int general_info = 0;
-	int xmit_wait = 0;
-	int i;
+	is4_counter_group_info_t *cg_info;
+	int i, num_cg;
 
-	static char const str_opts[] = "C:P:s:t:dNwGVhu";
-	static const struct option long_opts[] = {
-		{ "C", 1, 0, 'C'},
-		{ "P", 1, 0, 'P'},
-		{ "N", 1, 0, 'N'},
-		{ "w", 1, 0, 'w'},
-		{ "debug", 0, 0, 'd'},
-		{ "Guid", 0, 0, 'G'},
-		{ "sm_portid", 1, 0, 's'},
-		{ "timeout", 1, 0, 't'},
-		{ "Version", 0, 0, 'V'},
-		{ "help", 0, 0, 'h'},
-		{ "usage", 0, 0, 'u'},
-		{ }
-	};
+	/* Counter Group Info */
+	memset(&buf, 0, sizeof(buf));
+	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
+		      IB_MLX_IS4_COUNTER_GROUP_INFO, port, buf))
+		IBERROR("counter group info query");
+
+	cg_info = (is4_counter_group_info_t *) & buf;
+	num_cg = cg_info->num_of_counter_groups;
+	printf("counter_group_info:\n");
+	printf("%d counter groups\n", num_cg);
+	for (i = 0; i < num_cg; i++)
+		printf("group%d mask %#x\n", i, ntohl(cg_info->group_masks[i]));
+}
 
-	argv0 = argv[0];
+/* Group0 counter config values */
+#define IS4_G0_PortXmtDataSL_0_7  0
+#define IS4_G0_PortXmtDataSL_8_15 1
+#define IS4_G0_PortRcvDataSL_0_7  2
 
-	while (1) {
-		int ch = getopt_long(argc, argv, str_opts, long_opts, NULL);
-		if ( ch == -1 )
-			break;
-		switch(ch) {
-		case 'C':
-			ca = optarg;
-			break;
-		case 'P':
-			ca_port = strtoul(optarg, 0, 0);
-			break;
-		case 'N':
-			general_info = 1;
-			break;
-		case 'w':
-			xmit_wait = 1;
-			break;
-		case 'd':
-			ibdebug++;
-			madrpc_show_errors(1);
-			umad_debug(udebug);
-			udebug++;
-			break;
-		case 'G':
-			dest_type = IB_DEST_GUID;
-			break;
-		case 's':
-			if (ib_resolve_portid_str(&sm_portid, optarg, IB_DEST_LID, 0) < 0)
-				IBERROR("can't resolve SM destination port %s", optarg);
-			sm_id = &sm_portid;
-			break;
-		case 't':
-			timeout = strtoul(optarg, 0, 0);
-			madrpc_set_timeout(timeout);
+/* Group1 counter config values */
+#define IS4_G1_PortXmtDataSL_8_15 1
+#define IS4_G1_PortRcvDataSL_0_7  2
+#define IS4_G1_PortRcvDataSL_8_15 8
+
+static int cg0, cg1;
+
+static void config_counter_groups(ib_portid_t * portid, int port)
+{
+	char buf[1024];
+	is4_config_counter_groups_t *cg_config;
+
+	/* configure counter groups for groups 0 and 1 */
+	memset(&buf, 0, sizeof(buf));
+	cg_config = (is4_config_counter_groups_t *) & buf;
+
+	printf("counter_groups_config: configuring group0 %d group1 %d\n", cg0,
+	       cg1);
+	cg_config->group_selects[0].group_select = (uint8_t) cg0;
+	cg_config->group_selects[1].group_select = (uint8_t) cg1;
+
+	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_SET,
+		      IB_MLX_IS4_CONFIG_COUNTER_GROUP, port, buf))
+		IBERROR("config counter group set");
+
+	/* get config counter groups */
+	memset(&buf, 0, sizeof(buf));
+
+	if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
+		      IB_MLX_IS4_CONFIG_COUNTER_GROUP, port, buf))
+		IBERROR("config counter group query");
+}
+
+static int general_info, xmit_wait, counter_group_info, config_counter_group;
+static is3_config_space_t write_cs, read_cs;
+static unsigned write_cs_records, read_cs_records;
+
+
+static int process_opt(void *context, int ch, char *optarg)
+{
+	int ret;
+	switch (ch) {
+	case 'N':
+		general_info = 1;
+		break;
+	case 'w':
+		xmit_wait = 1;
+		break;
+	case 'i':
+		counter_group_info = 1;
+		break;
+	case 'c':
+		config_counter_group = 1;
+		ret = sscanf(optarg, "%d,%d", &cg0, &cg1);
+		if (ret != 2)
+			return -1;
+		break;
+	case 'R':
+		if (read_cs_records >= 18)
 			break;
-		case 'V':
-			fprintf(stderr, "%s %s\n", argv0, get_build_version() );
-			exit(-1);
-		default:
-			usage();
+		ret = sscanf(optarg, "%x,%x",
+			     &read_cs.record[read_cs_records].address,
+			     &read_cs.record[read_cs_records].mask);
+		if (ret < 1)
+			return -1;
+		else if (ret == 1)
+			read_cs.record[read_cs_records].mask = 0xffffffff;
+		read_cs_records++;
+		break;
+	case 'W':
+		if (write_cs_records >= 18)
 			break;
-		}
+		ret = sscanf(optarg, "%x,%x,%x",
+			     &write_cs.record[write_cs_records].address,
+			     &write_cs.record[write_cs_records].data,
+			     &write_cs.record[write_cs_records].mask);
+		if (ret < 2)
+			return -1;
+		else if (ret == 2)
+			write_cs.record[write_cs_records].mask = 0xffffffff;
+		write_cs_records++;
+		break;
+	default:
+		return -1;
 	}
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int mgmt_classes[2] = { IB_SA_CLASS, IB_MLX_VENDOR_CLASS };
+	ib_portid_t portid = { 0 };
+	int port = 0;
+	char buf[1024];
+	uint32_t fw_ver_major = 0;
+	uint32_t fw_ver_minor = 0;
+	uint32_t fw_ver_sub_minor = 0;
+	is3_general_info_t *gi_is3;
+	is4_general_info_t *gi_is4;
+	const struct ibdiag_opt opts[] = {
+		{"N", 'N', 0, NULL, "show IS3 or IS4 general information"},
+		{"w", 'w', 0, NULL, "show IS3 port xmit wait counters"},
+		{"i", 'i', 0, NULL, "show IS4 counter group info"},
+		{"c", 'c', 1, "<num,num>", "configure IS4 counter groups"},
+		{"Read", 'R', 1, "<addr,mask>", "Read configuration space record at addr"},
+		{"Write", 'W', 1, "<addr,val,mask>", "Write configuration space record at addr"},
+		{0}
+	};
+
+	char usage_args[] = "<lid|guid> [port]";
+	const char *usage_examples[] = {
+		"-N 6\t\t# read IS3 or IS4 general information",
+		"-w 6\t\t# read IS3 port xmit wait counters",
+		"-i 6 12\t# read IS4 port 12 counter group info",
+		"-c 0,1 6 12\t# configure IS4 port 12 counter groups for PortXmitDataSL",
+		"-c 2,8 6 12\t# configure IS4 port 12 counter groups for PortRcvDataSL",
+		NULL
+	};
+
+	ibdiag_process_opts(argc, argv, NULL, "DKy", opts, process_opt,
+			    usage_args, usage_examples);
+
 	argc -= optind;
 	argv += optind;
 
 	if (argc > 1)
 		port = strtoul(argv[1], 0, 0);
 
-	madrpc_init(ca, ca_port, mgmt_classes, 4);
+	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 2);
+	if (!srcport)
+		IBERROR("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
 
 	if (argc) {
-		if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
+		if (resolve_portid_str(ibd_ca, ibd_ca_port, &portid, argv[0],
+				       ibd_dest_type, ibd_sm_id, srcport) < 0)
 			IBERROR("can't resolve destination port %s", argv[0]);
 	} else {
-		if (ib_resolve_self(&portid, &port, 0) < 0)
+		if (resolve_self(ibd_ca, ibd_ca_port, &portid, &port, 0) < 0)
 			IBERROR("can't resolve self port %s", argv[0]);
 	}
 
+	if (counter_group_info) {
+		counter_groups_info(&portid, port);
+		exit(0);
+	}
+
+	if (config_counter_group) {
+		config_counter_groups(&portid, port);
+		exit(0);
+	}
+
+	if (read_cs_records || write_cs_records) {
+		if (read_cs_records)
+			do_config_space_records(&portid, 0, &read_cs,
+						read_cs_records);
+		if (write_cs_records)
+			do_config_space_records(&portid, 1, &write_cs,
+						write_cs_records);
+		exit(0);
+	}
+
+	/* These are Mellanox specific vendor MADs */
+	/* but vendors change the VendorId so how know for sure ? */
 	/* Only General Info and Port Xmit Wait Counters */
 	/* queries are currently supported */
 	if (!general_info && !xmit_wait)
 		IBERROR("at least one of -N and -w must be specified");
 
-	/* These are Mellanox specific vendor MADs */
-	/* but vendors change the VendorId so how know for sure ? */
 	/* Would need a list of these and it might not be complete */
 	/* so for right now, punt on this */
 
-	memset(&call, 0, sizeof(call));
-	call.mgmt_class = IB_MLX_VENDOR_CLASS;
-	call.method = IB_MAD_METHOD_GET;
-	call.timeout = timeout;
-
-	memset(&buf, 0, sizeof(buf));
 	/* vendor ClassPortInfo is required attribute if class supported */
-	call.attrid = CLASS_PORT_INFO;
-	if (!ib_vendor_call(&buf, &portid, &call))
+	memset(&buf, 0, sizeof(buf));
+	if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
+		      CLASS_PORT_INFO, 0, buf))
 		IBERROR("classportinfo query");
 
 	memset(&buf, 0, sizeof(buf));
-	call.attrid = IB_MLX_IS3_GENERAL_INFO;
-	if (!ib_vendor_call(&buf, &portid, &call))
-		IBERROR("vendstat");
-	gi = (is3_general_info_t *)&buf;
+	gi_is3 = (is3_general_info_t *) &buf;
+	if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS, IB_MAD_METHOD_GET,
+		      IB_MLX_IS3_GENERAL_INFO, 0, gi_is3))
+		IBERROR("generalinfo query");
+
+	if (is_ext_fw_info_supported(ntohs(gi_is3->hw_info.device_id))) {
+		gi_is4 = (is4_general_info_t *) &buf;
+		fw_ver_major = ntohl(gi_is4->ext_fw_info.ext_major);
+		fw_ver_minor = ntohl(gi_is4->ext_fw_info.ext_minor);
+		fw_ver_sub_minor = ntohl(gi_is4->ext_fw_info.ext_sub_minor);
+	} else {
+		fw_ver_major = gi_is3->fw_info.major;
+		fw_ver_minor = gi_is3->fw_info.minor;
+		fw_ver_sub_minor = gi_is3->fw_info.sub_minor;
+	}
 
 	if (general_info) {
-		/* dump IS3 general info here */
-		printf("hw_dev_rev:  0x%04x\n", ntohs(gi->hw_info.hw_revision));
-		printf("hw_dev_id:   0x%04x\n", ntohs(gi->hw_info.device_id));
-		printf("hw_uptime:   0x%08x\n", ntohl(gi->hw_info.uptime));
+		/* dump IS3 or IS4 general info here */
+		printf("hw_dev_rev:  0x%04x\n", ntohs(gi_is3->hw_info.hw_revision));
+		printf("hw_dev_id:   0x%04x\n", ntohs(gi_is3->hw_info.device_id));
+		printf("hw_uptime:   0x%08x\n", ntohl(gi_is3->hw_info.uptime));
 		printf("fw_version:  %02d.%02d.%02d\n",
-		       gi->fw_info.major, gi->fw_info.minor, gi->fw_info.sub_minor);
-		printf("fw_build_id: 0x%04x\n", ntohl(gi->fw_info.build_id));
-		printf("fw_date:     %02d/%02d/%04x\n",
-		       gi->fw_info.month, gi->fw_info.day, ntohs(gi->fw_info.year));
-		printf("fw_psid:     '%s'\n", gi->fw_info.psid);
-		printf("fw_ini_ver:  %d\n", ntohl(gi->fw_info.ini_file_version));
-		printf("sw_version:  %02d.%02d.%02d\n",
-		       gi->sw_info.major, gi->sw_info.minor, gi->sw_info.sub_minor);
+		       fw_ver_major, fw_ver_minor, fw_ver_sub_minor);
+		printf("fw_build_id: 0x%04x\n", ntohl(gi_is3->fw_info.build_id));
+		printf("fw_date:     %02x/%02x/%04x\n",
+		       gi_is3->fw_info.month, gi_is3->fw_info.day,
+		       ntohs(gi_is3->fw_info.year));
+		printf("fw_psid:     '%s'\n", gi_is3->fw_info.psid);
+		printf("fw_ini_ver:  %d\n",
+		       ntohl(gi_is3->fw_info.ini_file_version));
+		printf("sw_version:  %02d.%02d.%02d\n", gi_is3->sw_info.major,
+		       gi_is3->sw_info.minor, gi_is3->sw_info.sub_minor);
 	}
 
 	if (xmit_wait) {
-		if (ntohs(gi->hw_info.device_id) != IS3_DEVICE_ID)
-			IBERROR("Unsupported device ID 0x%x", ntohs(gi->hw_info.device_id));
+		is3_config_space_t *cs;
+		unsigned i;
+
+		if (ntohs(gi_is3->hw_info.device_id) != IS3_DEVICE_ID)
+			IBERROR("Unsupported device ID 0x%x",
+				ntohs(gi_is3->hw_info.device_id));
 
 		memset(&buf, 0, sizeof(buf));
-		call.attrid = IB_MLX_IS3_CONFIG_SPACE_ACCESS;
-		/* Limit of 18 accesses per MAD ? */
-		call.mod = 2 << 22 | 16 << 16; /* 16 records */
 		/* Set record addresses for each port */
-		cs = (is3_config_space_t *)&buf;
+		cs = (is3_config_space_t *) & buf;
 		for (i = 0; i < 16; i++)
-			cs->record[i].address = htonl(IB_MLX_IS3_PORT_XMIT_WAIT + ((i + 1) << 12));
-		if (!ib_vendor_call(&buf, &portid, &call))
+			cs->record[i].address =
+			    htonl(IB_MLX_IS3_PORT_XMIT_WAIT + ((i + 1) << 12));
+		if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS,
+			      IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS,
+			      2 << 22 | 16 << 16, cs))
 			IBERROR("vendstat");
 
 		for (i = 0; i < 16; i++)
 			if (cs->record[i].data)	/* PortXmitWait is 32 bit counter */
-				printf("Port %d: PortXmitWait 0x%x\n", i + 4, ntohl(cs->record[i].data)); /* port 4 is first port */
+				printf("Port %d: PortXmitWait 0x%x\n", i + 4, ntohl(cs->record[i].data));	/* port 4 is first port */
 
 		/* Last 8 ports is another query */
 		memset(&buf, 0, sizeof(buf));
-		call.attrid = IB_MLX_IS3_CONFIG_SPACE_ACCESS;
-                call.mod = 2 << 22 | 8 << 16; /* 8 records */
 		/* Set record addresses for each port */
-		cs = (is3_config_space_t *)&buf;
+		cs = (is3_config_space_t *) & buf;
 		for (i = 0; i < 8; i++)
-			cs->record[i].address = htonl(IB_MLX_IS3_PORT_XMIT_WAIT + ((i + 17) << 12));
-		if (!ib_vendor_call(&buf, &portid, &call))
+			cs->record[i].address =
+			    htonl(IB_MLX_IS3_PORT_XMIT_WAIT + ((i + 17) << 12));
+		if (do_vendor(&portid, srcport, IB_MLX_VENDOR_CLASS,
+			      IB_MAD_METHOD_GET, IB_MLX_IS3_CONFIG_SPACE_ACCESS,
+			      2 << 22 | 8 << 16, cs))
 			IBERROR("vendstat");
 
 		for (i = 0; i < 8; i++)
-			if (cs->record[i].data) /* PortXmitWait is 32 bit counter */
+			if (cs->record[i].data)	/* PortXmitWait is 32 bit counter */
 				printf("Port %d: PortXmitWait 0x%x\n",
 				       i < 4 ? i + 21 : i - 3,
 				       ntohl(cs->record[i].data));
 	}
 
+	mad_rpc_close_port(srcport);
 	exit(0);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/infiniband-diags.git



More information about the Pkg-ofed-commits mailing list