Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

vipnsgethostbyname.c File Reference

#include <stdlib.h>
#include <string.h>
#include "vipl_priv.h"

Go to the source code of this file.

Functions

VIP_ENTRY_POINT VIP_RETURN VipNSGetHostByName (VIP_NIC_HANDLE NicHandle, VIP_CHAR *Name, VIP_NET_ADDRESS *Address, VIP_ULONG NameIndex)


Detailed Description

The VI-GM function VipNSGetHostByName implementation.

Definition in file vipnsgethostbyname.c.


Function Documentation

VIP_ENTRY_POINT VIP_RETURN VipNSGetHostByName VIP_NIC_HANDLE  NicHandle,
VIP_CHAR Name,
VIP_NET_ADDRESS Address,
VIP_ULONG  NameIndex
 

VipNSGetHostByName() maps string names to network addresses that are recognized by VipConnectRequest() and VipConnectPeerRequest() for connect operations. The name matching is case insensitive. The name service is queried and returns an address in the context of the specified VI NIC. If this operation completes successfully, a valid VIP_NET_ADDRESS structure is contained in the network address structure specified by Address. The Address structure must be allocated by the caller with the HostAddressLen field initialized.

The NameIndex is used to allow the name service to associate multiple NIC addresses with the same name on a SAN (as specified by the NicHandle parameter). For example, if a node on a single SAN has two NICs to allow for twice the bandwidth and number of VIs than a single NIC, the first call to this routine (with a NameIndex value of 0) returns one NIC address and the second call (with a NameIndex value of 1) returns the other NIC address. A call to this routine with the same name but with a NameIndex value of 2 or more returns a VIP_ERROR_NAMESERVICE.

Return values:
VIP_SUCCESS Operation completed successfully.
VIP_ERROR_NAMESERVICE The name specified was not found by the name service, the NameIndex for the given name is invalid or the name service was not initialized for the specified NIC context.
VIP_INVALID_PARAMETER One of the parameters was invalid.
VIP_ERROR_RESOURCE The operation failed due to insufficient resources.
Parameters:
NicHandle (IN) The VI NIC context in which to resolve the name.
Name (IN) The NULL terminated string that will be used to query the name service to find a matching address.
Address (IN/OUT) The VIP_NET_ADDRESS structure that will receive the NIC address of the specified host. The HostAddress field must be at least the size specified by the NICAddressLen field in the VI_NIC_ATTRIBUTES structure.
NameIndex (IN) The index of NIC address to return. If a node has multiple Myrinet NICs, the client application can start at a NameIndex of 0 and increment the index until an error is returned to fully enumerate all of the NIC addresses associated with a particular nodename.
See also:
VipNSInit VipNSShutdown VipNSGetHostByAddr
Author:
Patrick Geoffray
Version:
1.0

Definition at line 67 of file vipnsgethostbyname.c.

References VIP_NET_ADDRESS::HostAddress, VIP_NET_ADDRESS::HostAddressLen, VI_GM_MAC_ADDRESS_LEN, VIP_DEBUG, VIP_DEBUG_GM, VIP_DEBUG_LABEL, VIP_ENTER_IOCTL, VIP_ERROR_NAMESERVICE, VIP_ERROR_RESOURCE, VIP_EXIT_IOCTL, VIP_FALSE, VIP_INVALID_NIC_HANDLE, VIP_INVALID_PARAMETER, VIP_MUTEX_LOCK, VIP_MUTEX_UNLOCK, VIP_PROGRESSION, and VIP_SUCCESS.

VI-GM-1.3 by Myricom © 1997-2006. Documentation generated on 20 May 2006 by doxygen 1.4.4.