#include <rpc/rpcb_prot.h>
#endif
+#include "sockaddr.h"
#include "nfsrpc.h"
/*
struct netconfig *nconf;
struct protoent *proto;
+ /*
+ * IANA does not define a protocol number for rdma netids,
+ * since "rdma" is not an IP protocol.
+ */
+ if (strcmp(netid, "rdma") == 0) {
+ *family = AF_INET;
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ }
+ if (strcmp(netid, "rdma6") == 0) {
+ *family = AF_INET6;
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ }
+
nconf = getnetconfigent(netid);
if (nconf == NULL)
return 0;
{
struct protoent *proto;
+ /*
+ * IANA does not define a protocol number for rdma netids,
+ * since "rdma" is not an IP protocol.
+ */
+ if (strcmp(netid, "rdma") == 0) {
+ *family = AF_INET;
+ *protocol = NFSPROTO_RDMA;
+ return 1;
+ }
+
proto = getprotobyname(netid);
if (proto == NULL)
return 0;
const rpcprog_t program, const rpcvers_t version,
const unsigned short protocol, const struct timeval *timeout)
{
- struct sockaddr_storage address;
- struct sockaddr *saddr = (struct sockaddr *)&address;
+ union nfs_sockaddr address;
+ struct sockaddr *saddr = &address.sa;
CLIENT *client;
struct timeval tout = { -1, 0 };
int result = 0;
const rpcvers_t version,
const unsigned short protocol)
{
- struct sockaddr_storage address;
- struct sockaddr *saddr = (struct sockaddr *)&address;
+ union nfs_sockaddr address;
+ struct sockaddr *saddr = &address.sa;
struct timeval timeout = { -1, 0 };
unsigned short port = 0;
CLIENT *client;
}
if (port != 0) {
- struct sockaddr_storage address;
- struct sockaddr *saddr = (struct sockaddr *)&address;
+ union nfs_sockaddr address;
+ struct sockaddr *saddr = &address.sa;
memcpy(saddr, sap, (size_t)salen);
nfs_set_port(saddr, port);
const rpcvers_t version,
const unsigned short protocol)
{
- struct sockaddr_storage address;
- struct sockaddr *lb_addr = (struct sockaddr *)&address;
+ union nfs_sockaddr address;
+ struct sockaddr *lb_addr = &address.sa;
socklen_t lb_len = sizeof(*lb_addr);
unsigned short port = 0;
const unsigned short protocol,
const struct timeval *timeout)
{
- struct sockaddr_storage address;
- struct sockaddr *saddr = (struct sockaddr *)&address;
+ union nfs_sockaddr address;
+ struct sockaddr *saddr = &address.sa;
CLIENT *client;
struct rpcb parms;
struct timeval tout = { -1, 0 };