[IBDIAGS] adding ibtracert & ibroute to the build.
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 10 Feb 2009 01:53:01 +0000 (01:53 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 10 Feb 2009 01:53:01 +0000 (01:53 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1936 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

tools/infiniband_diags/src/dirs
tools/infiniband_diags/src/ibroute.c
tools/infiniband_diags/src/ibroute/SOURCES [new file with mode: 0644]
tools/infiniband_diags/src/ibroute/ibroute.rc [new file with mode: 0644]
tools/infiniband_diags/src/ibroute/makefile [new file with mode: 0644]
tools/infiniband_diags/src/ibtracert.c
tools/infiniband_diags/src/ibtracert/SOURCES [new file with mode: 0644]
tools/infiniband_diags/src/ibtracert/ibtracert.rc [new file with mode: 0644]
tools/infiniband_diags/src/ibtracert/makefile [new file with mode: 0644]

index 3d4ce27..13e1bf4 100644 (file)
@@ -5,5 +5,7 @@ DIRS =                          \
        ibaddr                  \\r
        ibnetdiscover   \\r
        vendstat                \ \r
-       ibportstate\r
+       ibportstate             \\r
+       ibroute                 \\r
+       ibtracert\r
        \r
index 83e2142..f0bbc24 100644 (file)
 #include <stdarg.h>\r
 #include <time.h>\r
 #include <string.h>\r
+#if defined(_WIN32)\r
+#else\r
 #include <inttypes.h>\r
-#include <getopt.h>\r
 #include <netinet/in.h>\r
+#endif\r
+#include <getopt.h>\r
 #include <ctype.h>\r
 \r
-#include <infiniband/common.h>\r
 #include <infiniband/umad.h>\r
 #include <infiniband/mad.h>\r
 #include <infiniband/complib/cl_nodenamemap.h>\r
@@ -336,7 +338,7 @@ dump_unicast_tables(ib_portid_t *portid, int startlid, int endlid)
 \r
                for (;i < e; i++) {\r
                        unsigned outport = lft[i % IB_SMP_DATA_SIZE];\r
-                       unsigned valid = (outport <= nports);\r
+                       unsigned valid = (outport <= (unsigned)nports);\r
 \r
                        if (!valid && !dump_all)\r
                                continue;\r
@@ -379,7 +381,7 @@ usage(void)
        exit(-1);\r
 }\r
 \r
-int\r
+int _CDECL\r
 main(int argc, char **argv)\r
 {\r
        int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};\r
@@ -407,7 +409,7 @@ main(int argc, char **argv)
                { "Version", 0, 0, 'V'},\r
                { "help", 0, 0, 'h'},\r
                { "usage", 0, 0, 'u'},\r
-               { }\r
+               { }\r
        };\r
 \r
        argv0 = argv[0];\r
diff --git a/tools/infiniband_diags/src/ibroute/SOURCES b/tools/infiniband_diags/src/ibroute/SOURCES
new file mode 100644 (file)
index 0000000..d3c07c6
--- /dev/null
@@ -0,0 +1,38 @@
+TARGETNAME = ibroute\r
+TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
+TARGETTYPE = PROGRAM\r
+\r
+UMTYPE = console\r
+UMENTRY = main\r
+\r
+USE_MSVCRT = 1\r
+USE_STL = 1\r
+USE_NATIVE_EH = 1\r
+USE_IOSTREAM = 1\r
+\r
+SOURCES = ibroute.rc   \\r
+       ..\ibroute.c            \\r
+       ..\ibdiag_common.c      \\r
+       ..\cl_nodenamemap.c     \\r
+       ..\ibdiag_osd.c\r
+       \r
+INCLUDES = ..;..\..\include;..\..\..\..\ulp\opensm\user\include;..\..\include\Infiniband;..\..\..\..\ulp\libibmad\include;..\..\..\..\ulp\libibumad\include;..\..\..\..\inc;..\..\..\..\inc\user;\r
+\r
+TARGETLIBS =   \\r
+       $(SDK_LIB_PATH)\kernel32.lib    \\r
+       $(SDK_LIB_PATH)\advapi32.lib    \\r
+       $(SDK_LIB_PATH)\user32.lib              \\r
+       $(SDK_LIB_PATH)\ole32.lib               \\r
+       $(SDK_LIB_PATH)\ws2_32.lib              \\r
+!if $(FREEBUILD)\r
+       $(TARGETPATH)\*\libibmad.lib    \\r
+       $(TARGETPATH)\*\libibumad.lib   \\r
+       $(TARGETPATH)\*\complib.lib             \\r
+       $(TARGETPATH)\*\ibal.lib\r
+!else\r
+       $(TARGETPATH)\*\libibmadd.lib   \\r
+       $(TARGETPATH)\*\libibumadd.lib  \\r
+       $(TARGETPATH)\*\complibd.lib    \\r
+       $(TARGETPATH)\*\ibald.lib\r
+!endif\r
+\r
diff --git a/tools/infiniband_diags/src/ibroute/ibroute.rc b/tools/infiniband_diags/src/ibroute/ibroute.rc
new file mode 100644 (file)
index 0000000..89b7515
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright (c) 2009 Intel Corporation.  All rights reserved.\r
+ *\r
+ * This software is available to you under the OpenIB.org BSD license\r
+ * below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ * $Id$\r
+ */\r
+\r
+\r
+#include <oib_ver.h>\r
+\r
+#define VER_FILETYPE                   VFT_APP\r
+#define VER_FILESUBTYPE                        VFT2_UNKNOWN\r
+\r
+#ifdef DBG\r
+#define VER_FILEDESCRIPTION_STR        "InfiniBand Route (Debug)"\r
+#else\r
+#define VER_FILEDESCRIPTION_STR        "InfiniBand Route"\r
+#endif\r
+\r
+#define VER_INTERNALNAME_STR           "ibroute.exe"\r
+#define VER_ORIGINALFILENAME_STR       "ibroute.exe"\r
+\r
+#include <common.ver>\r
diff --git a/tools/infiniband_diags/src/ibroute/makefile b/tools/infiniband_diags/src/ibroute/makefile
new file mode 100644 (file)
index 0000000..a0c0627
--- /dev/null
@@ -0,0 +1,7 @@
+#\r
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source\r
+# file to this component.  This file merely indirects to the real make file\r
+# that is shared by all the driver components of the OpenIB Windows project.\r
+#\r
+\r
+!INCLUDE ..\..\..\..\inc\openib.def\r
index 724ac80..f0894e8 100644 (file)
 #include <stdarg.h>\r
 #include <ctype.h>\r
 #include <getopt.h>\r
+#if defined(_WIN32)\r
+#else\r
 #include <netinet/in.h>\r
 #include <inttypes.h>\r
+#endif\r
 #include <errno.h>\r
 \r
-#include <infiniband/common.h>\r
 #include <infiniband/umad.h>\r
 #include <infiniband/mad.h>\r
 #include <infiniband/complib/cl_nodenamemap.h>\r
@@ -186,7 +188,7 @@ extend_dpath(ib_dr_path_t *path, int nextport)
        if (path->cnt+2 >= sizeof(path->p))\r
                return -1;\r
        ++path->cnt;\r
-       path->p[path->cnt] = nextport;\r
+       path->p[path->cnt] = (uint8_t)nextport;\r
        return path->cnt;\r
 }\r
 \r
@@ -710,7 +712,7 @@ usage(void)
        exit(-1);\r
 }\r
 \r
-int\r
+int _CDECL\r
 main(int argc, char **argv)\r
 {\r
        int mgmt_classes[3] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS, IB_SA_CLASS};\r
@@ -741,7 +743,7 @@ main(int argc, char **argv)
                { "help", 0, 0, 'h'},\r
                { "usage", 0, 0, 'u'},\r
                { "node-name-map", 1, 0, 1},\r
-               { }\r
+               { }\r
        };\r
 \r
        argv0 = argv[0];\r
diff --git a/tools/infiniband_diags/src/ibtracert/SOURCES b/tools/infiniband_diags/src/ibtracert/SOURCES
new file mode 100644 (file)
index 0000000..a363871
--- /dev/null
@@ -0,0 +1,38 @@
+TARGETNAME = ibtracert\r
+TARGETPATH = ..\..\..\..\bin\user\obj$(BUILD_ALT_DIR)\r
+TARGETTYPE = PROGRAM\r
+\r
+UMTYPE = console\r
+UMENTRY = main\r
+\r
+USE_MSVCRT = 1\r
+USE_STL = 1\r
+USE_NATIVE_EH = 1\r
+USE_IOSTREAM = 1\r
+\r
+SOURCES = ibtracert.rc \\r
+       ..\ibtracert.c          \\r
+       ..\ibdiag_common.c      \\r
+       ..\cl_nodenamemap.c     \\r
+       ..\ibdiag_osd.c\r
+       \r
+INCLUDES = ..;..\..\include;..\..\..\..\ulp\opensm\user\include;..\..\include\Infiniband;..\..\..\..\ulp\libibmad\include;..\..\..\..\ulp\libibumad\include;..\..\..\..\inc;..\..\..\..\inc\user;\r
+\r
+TARGETLIBS =   \\r
+       $(SDK_LIB_PATH)\kernel32.lib    \\r
+       $(SDK_LIB_PATH)\advapi32.lib    \\r
+       $(SDK_LIB_PATH)\user32.lib              \\r
+       $(SDK_LIB_PATH)\ole32.lib               \\r
+       $(SDK_LIB_PATH)\ws2_32.lib              \\r
+!if $(FREEBUILD)\r
+       $(TARGETPATH)\*\libibmad.lib    \\r
+       $(TARGETPATH)\*\libibumad.lib   \\r
+       $(TARGETPATH)\*\complib.lib             \\r
+       $(TARGETPATH)\*\ibal.lib\r
+!else\r
+       $(TARGETPATH)\*\libibmadd.lib   \\r
+       $(TARGETPATH)\*\libibumadd.lib  \\r
+       $(TARGETPATH)\*\complibd.lib    \\r
+       $(TARGETPATH)\*\ibald.lib\r
+!endif\r
+\r
diff --git a/tools/infiniband_diags/src/ibtracert/ibtracert.rc b/tools/infiniband_diags/src/ibtracert/ibtracert.rc
new file mode 100644 (file)
index 0000000..b470bef
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright (c) 2009 Intel Corporation.  All rights reserved.\r
+ *\r
+ * This software is available to you under the OpenIB.org BSD license\r
+ * below:\r
+ *\r
+ *     Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *      - Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *\r
+ *      - Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ *\r
+ * $Id$\r
+ */\r
+\r
+\r
+#include <oib_ver.h>\r
+\r
+#define VER_FILETYPE                   VFT_APP\r
+#define VER_FILESUBTYPE                        VFT2_UNKNOWN\r
+\r
+#ifdef DBG\r
+#define VER_FILEDESCRIPTION_STR        "InfiniBand Trace Route (Debug)"\r
+#else\r
+#define VER_FILEDESCRIPTION_STR        "InfiniBand Trace Route"\r
+#endif\r
+\r
+#define VER_INTERNALNAME_STR           "ibtracert.exe"\r
+#define VER_ORIGINALFILENAME_STR       "ibtracert.exe"\r
+\r
+#include <common.ver>\r
diff --git a/tools/infiniband_diags/src/ibtracert/makefile b/tools/infiniband_diags/src/ibtracert/makefile
new file mode 100644 (file)
index 0000000..a0c0627
--- /dev/null
@@ -0,0 +1,7 @@
+#\r
+# DO NOT EDIT THIS FILE!!!  Edit .\sources. if you want to add a new source\r
+# file to this component.  This file merely indirects to the real make file\r
+# that is shared by all the driver components of the OpenIB Windows project.\r
+#\r
+\r
+!INCLUDE ..\..\..\..\inc\openib.def\r