snprintf(str, size, "%u", addr);
}
-static void
-libcfs_hexnum_addr2str(__u32 addr, char *str, size_t size)
-{
- snprintf(str, size, "0x%x", addr);
-}
-
static int
libcfs_num_str2addr(const char *str, int nob, __u32 *addr)
{
.nf_min_max = cfs_ip_min_max
},
{
- .nf_type = CIBLND,
- .nf_name = "cib",
- .nf_modname = "kciblnd",
- .nf_addr2str = libcfs_ip_addr2str,
- .nf_str2addr = libcfs_ip_str2addr,
- .nf_parse_addrlist = cfs_ip_addr_parse,
- .nf_print_addrlist = libcfs_ip_addr_range_print,
- .nf_match_addr = cfs_ip_addr_match,
- .nf_is_contiguous = cfs_ip_is_contiguous,
- .nf_min_max = cfs_ip_min_max
- },
- {
- .nf_type = OPENIBLND,
- .nf_name = "openib",
- .nf_modname = "kopeniblnd",
- .nf_addr2str = libcfs_ip_addr2str,
- .nf_str2addr = libcfs_ip_str2addr,
- .nf_parse_addrlist = cfs_ip_addr_parse,
- .nf_print_addrlist = libcfs_ip_addr_range_print,
- .nf_match_addr = cfs_ip_addr_match,
- .nf_is_contiguous = cfs_ip_is_contiguous,
- .nf_min_max = cfs_ip_min_max
- },
- {
- .nf_type = IIBLND,
- .nf_name = "iib",
- .nf_modname = "kiiblnd",
- .nf_addr2str = libcfs_ip_addr2str,
- .nf_str2addr = libcfs_ip_str2addr,
- .nf_parse_addrlist = cfs_ip_addr_parse,
- .nf_print_addrlist = libcfs_ip_addr_range_print,
- .nf_match_addr = cfs_ip_addr_match,
- .nf_is_contiguous = cfs_ip_is_contiguous,
- .nf_min_max = cfs_ip_min_max
- },
- {
- .nf_type = VIBLND,
- .nf_name = "vib",
- .nf_modname = "kviblnd",
- .nf_addr2str = libcfs_ip_addr2str,
- .nf_str2addr = libcfs_ip_str2addr,
- .nf_parse_addrlist = cfs_ip_addr_parse,
- .nf_print_addrlist = libcfs_ip_addr_range_print,
- .nf_match_addr = cfs_ip_addr_match,
- .nf_is_contiguous = cfs_ip_is_contiguous,
- .nf_min_max = cfs_ip_min_max
- },
- {
- .nf_type = RALND,
- .nf_name = "ra",
- .nf_modname = "kralnd",
- .nf_addr2str = libcfs_ip_addr2str,
- .nf_str2addr = libcfs_ip_str2addr,
- .nf_parse_addrlist = cfs_ip_addr_parse,
- .nf_print_addrlist = libcfs_ip_addr_range_print,
- .nf_match_addr = cfs_ip_addr_match,
- .nf_is_contiguous = cfs_ip_is_contiguous,
- .nf_min_max = cfs_ip_min_max
- },
- {
- .nf_type = QSWLND,
- .nf_name = "elan",
- .nf_modname = "kqswlnd",
- .nf_addr2str = libcfs_decnum_addr2str,
- .nf_str2addr = libcfs_num_str2addr,
- .nf_parse_addrlist = libcfs_num_parse,
- .nf_print_addrlist = libcfs_num_addr_range_print,
- .nf_match_addr = libcfs_num_match,
- .nf_is_contiguous = cfs_num_is_contiguous,
- .nf_min_max = cfs_num_min_max
- },
- {
- .nf_type = GMLND,
- .nf_name = "gm",
- .nf_modname = "kgmlnd",
- .nf_addr2str = libcfs_hexnum_addr2str,
- .nf_str2addr = libcfs_num_str2addr,
- .nf_parse_addrlist = libcfs_num_parse,
- .nf_print_addrlist = libcfs_num_addr_range_print,
- .nf_match_addr = libcfs_num_match,
- .nf_is_contiguous = cfs_num_is_contiguous,
- .nf_min_max = cfs_num_min_max
- },
- {
- .nf_type = MXLND,
- .nf_name = "mx",
- .nf_modname = "kmxlnd",
- .nf_addr2str = libcfs_ip_addr2str,
- .nf_str2addr = libcfs_ip_str2addr,
- .nf_parse_addrlist = cfs_ip_addr_parse,
- .nf_print_addrlist = libcfs_ip_addr_range_print,
- .nf_match_addr = cfs_ip_addr_match,
- .nf_is_contiguous = cfs_ip_is_contiguous,
- .nf_min_max = cfs_ip_min_max
- },
- {
- .nf_type = PTLLND,
- .nf_name = "ptl",
- .nf_modname = "kptllnd",
- .nf_addr2str = libcfs_decnum_addr2str,
- .nf_str2addr = libcfs_num_str2addr,
- .nf_parse_addrlist = libcfs_num_parse,
- .nf_print_addrlist = libcfs_num_addr_range_print,
- .nf_match_addr = libcfs_num_match,
- .nf_is_contiguous = cfs_num_is_contiguous,
- .nf_min_max = cfs_num_min_max
- },
- {
.nf_type = GNILND,
.nf_name = "gni",
.nf_modname = "kgnilnd",
goto out;
}
- if (LNET_NETTYP(net) == CIBLND ||
- LNET_NETTYP(net) == OPENIBLND ||
- LNET_NETTYP(net) == IIBLND ||
- LNET_NETTYP(net) == VIBLND) {
- snprintf(err_str,
- sizeof(err_str),
- "\"obselete LNet type '%s'\"", libcfs_lnd2str(net));
- rc = LUSTRE_CFG_RC_BAD_PARAM;
- goto out;
- }
-
gateway_nid = libcfs_str2nid(gw);
if (gateway_nid == LNET_NID_ANY) {
snprintf(err_str,
goto out;
}
- if (LNET_NETTYP(net) == CIBLND ||
- LNET_NETTYP(net) == OPENIBLND ||
- LNET_NETTYP(net) == IIBLND ||
- LNET_NETTYP(net) == VIBLND) {
- snprintf(err_str,
- sizeof(err_str),
- "\"obselete LNet type '%s'\"", libcfs_lnd2str(net));
- rc = LUSTRE_CFG_RC_BAD_PARAM;
- goto out;
- }
-
gateway_nid = libcfs_str2nid(gw);
if (gateway_nid == LNET_NID_ANY) {
snprintf(err_str,
goto out;
}
- if (LNET_NETTYP(net) == CIBLND ||
- LNET_NETTYP(net) == OPENIBLND ||
- LNET_NETTYP(net) == IIBLND ||
- LNET_NETTYP(net) == VIBLND) {
- snprintf(err_str,
- sizeof(err_str),
- "\"obsolete LNet type '%s'\"",
- libcfs_lnd2str(net));
- rc = LUSTRE_CFG_RC_BAD_PARAM;
- goto out;
- }
} else {
/* show all routes without filtering on net */
net = LNET_NIDNET(LNET_NID_ANY);
head++;
tail = head + strlen(head);
- if (tail <= head) {
+ if (tail <= head) {
printerr(0, "no output from %s\n", gethostname_ex);
return -1;
}
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 },
[LOLND] = { "LOLND", lolnd_nid2hostname },
- [RALND] = { "RALND", external_nid2hostname },
- [MXLND] = { "MXLND", external_nid2hostname },
[PTL4LND] = { "PTL4LND", external_nid2hostname },
};