Whamcloud - gitweb
LU-8769 lnet: removal of obsolete LNDs
[fs/lustre-release.git] / lustre / utils / gss / lsupport.c
index ca964ff..744fc27 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -47,6 +43,7 @@
 #include <sys/ipc.h>
 #include <sys/sem.h>
 
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <pwd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <assert.h>
-#ifdef HAVE_GETHOSTBYNAME
+#ifdef HAVE_NETDB_H
 # include <netdb.h>
 #endif
-
+#include <lnet/nidstr.h>
 #ifdef _NEW_BUILD_
 # include "lgss_utils.h"
 #else
@@ -71,8 +68,9 @@
 #endif
 #include "lsupport.h"
 
-const char * lustre_svc_name[] = 
+const char * lustre_svc_name[] =
 {
+        [LUSTRE_GSS_SVC_MGS]    = "MGS",
         [LUSTRE_GSS_SVC_MDS]    = "MDS",
         [LUSTRE_GSS_SVC_OSS]    = "OSS",
 };
@@ -259,7 +257,7 @@ int external_nid2hostname(char *lnd, uint32_t net, uint32_t addr,
                 head++;
 
         tail = head + strlen(head);
-        if (tail <= head) {
+       if (tail <= head) {
                 printerr(0, "no output from %s\n", gethostname_ex);
                 return -1;
         }
@@ -295,18 +293,10 @@ struct convert_struct {
 
 static struct convert_struct converter[] = {
         [0]             = { "UNUSED0",  NULL},
-        [QSWLND]        = { "QSWLND",   external_nid2hostname},
         [SOCKLND]       = { "SOCKLND",  ipv4_nid2hostname },
-        [GMLND]         = { "GMLND",    external_nid2hostname},
-        [PTLLND]        = { "PTLLND",   external_nid2hostname },
         [O2IBLND]       = { "O2IBLND",  ipv4_nid2hostname },
-        [CIBLND]        = { "CIBLND",   external_nid2hostname },
-        [OPENIBLND]     = { "OPENIBLND",external_nid2hostname },
-        [IIBLND]        = { "IIBLND",   external_nid2hostname },
         [LOLND]         = { "LOLND",    lolnd_nid2hostname },
-        [RALND]         = { "RALND",    external_nid2hostname },
-        [VIBLND]        = { "VIBLND",   external_nid2hostname },
-        [MXLND]         = { "MXLND",    external_nid2hostname },
+       [PTL4LND]       = { "PTL4LND",  external_nid2hostname },
 };
 
 #define LND_MAX         (sizeof(converter) / sizeof(converter[0]))
@@ -439,12 +429,6 @@ static int read_mapping_db(void)
         while ((line = fgets(linebuf, MAX_LINE_LEN, f)) != NULL) {
                 char *name;
 
-                if (strlen(line) >= MAX_LINE_LEN) {
-                        printerr(0, "invalid mapping db: line too long (%d)\n",
-                                 strlen(line));
-                        continue;
-                }
-
                 if (sscanf(line, "%s %s %s", princ, nid_str, dest) != 3) {
                         printerr(0, "mapping db: syntax error\n");
                         continue;