Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-5935 lnet: Fixes to make lnetctl function as expected.
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
nidstrings.c
diff --git
a/libcfs/libcfs/nidstrings.c
b/libcfs/libcfs/nidstrings.c
index
d5830f3
..
b11cc9c
100644
(file)
--- a/
libcfs/libcfs/nidstrings.c
+++ b/
libcfs/libcfs/nidstrings.c
@@
-27,7
+27,7
@@
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 201
2
, Intel Corporation.
+ * Copyright (c) 2011, 201
4
, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-41,13
+41,16
@@
#define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
#define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
-#include <lnet/
lnet
.h>
+#include <lnet/
nidstr
.h>
#ifndef __KERNEL__
#ifdef HAVE_GETHOSTBYNAME
# include <netdb.h>
#endif
#endif
#ifndef __KERNEL__
#ifdef HAVE_GETHOSTBYNAME
# include <netdb.h>
#endif
#endif
+/* max value for numeric network address */
+#define MAX_NUMERIC_VALUE 0xffffffff
+
#define IPSTRING_LENGTH 16
/* CAVEAT VENDITOR! Keep the canonical string representation of nets/nids
#define IPSTRING_LENGTH 16
/* CAVEAT VENDITOR! Keep the canonical string representation of nets/nids
@@
-275,16
+278,17
@@
static struct netstrfns libcfs_netstrfns[] = {
{/* .nf_type */ -1},
};
{/* .nf_type */ -1},
};
-const int libcfs_nnetstrfns = sizeof(libcfs_netstrfns)/sizeof(libcfs_netstrfns[0]);
+static const int libcfs_nnetstrfns =
+ sizeof(libcfs_netstrfns)/sizeof(libcfs_netstrfns[0]);
-int
+
static
int
libcfs_lo_str2addr(const char *str, int nob, __u32 *addr)
{
*addr = 0;
return 1;
}
libcfs_lo_str2addr(const char *str, int nob, __u32 *addr)
{
*addr = 0;
return 1;
}
-void
+
static
void
libcfs_ip_addr2str(__u32 addr, char *str)
{
#if 0 /* never lookup */
libcfs_ip_addr2str(__u32 addr, char *str)
{
#if 0 /* never lookup */
@@
-310,7
+314,7
@@
libcfs_ip_addr2str(__u32 addr, char *str)
* fine, if it doesn't, then the scan ended at the end of the string, which is
* fine too :) */
* fine, if it doesn't, then the scan ended at the end of the string, which is
* fine too :) */
-int
+
static
int
libcfs_ip_str2addr(const char *str, int nob, __u32 *addr)
{
unsigned int a;
libcfs_ip_str2addr(const char *str, int nob, __u32 *addr)
{
unsigned int a;
@@
-357,19
+361,19
@@
libcfs_ip_str2addr(const char *str, int nob, __u32 *addr)
return 0;
}
return 0;
}
-void
+
static
void
libcfs_decnum_addr2str(__u32 addr, char *str)
{
snprintf(str, LNET_NIDSTR_SIZE, "%u", addr);
}
libcfs_decnum_addr2str(__u32 addr, char *str)
{
snprintf(str, LNET_NIDSTR_SIZE, "%u", addr);
}
-void
+
static
void
libcfs_hexnum_addr2str(__u32 addr, char *str)
{
snprintf(str, LNET_NIDSTR_SIZE, "0x%x", addr);
}
libcfs_hexnum_addr2str(__u32 addr, char *str)
{
snprintf(str, LNET_NIDSTR_SIZE, "0x%x", addr);
}
-int
+
static
int
libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
{
int n;
libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
{
int n;
@@
-389,7
+393,7
@@
libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
return 0;
}
return 0;
}
-struct netstrfns *
+st
atic st
ruct netstrfns *
libcfs_lnd2netstrfns(int lnd)
{
int i;
libcfs_lnd2netstrfns(int lnd)
{
int i;
@@
-402,7
+406,7
@@
libcfs_lnd2netstrfns(int lnd)
return NULL;
}
return NULL;
}
-struct netstrfns *
+st
atic st
ruct netstrfns *
libcfs_namenum2netstrfns(const char *name)
{
struct netstrfns *nf;
libcfs_namenum2netstrfns(const char *name)
{
struct netstrfns *nf;
@@
-417,7
+421,7
@@
libcfs_namenum2netstrfns(const char *name)
return NULL;
}
return NULL;
}
-struct netstrfns *
+st
atic st
ruct netstrfns *
libcfs_name2netstrfns(const char *name)
{
int i;
libcfs_name2netstrfns(const char *name)
{
int i;