
/*
 * This file was generated by the SOM Compiler.
 * FileName: nbsock.xh.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.17
 *     SOM Emitter emitxh: 2.47
 */

/*
 *    COMPONENT_NAME: somu
 * 
 *    ORIGINS: 27
 * 
 * 
 *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,1996
 *    All Rights Reserved
 *    Licensed Materials - Property of IBM
 *    US Government Users Restricted Rights - Use, duplication or
 *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 * 
 */


#ifndef SOM_NBSockets_xh
#define SOM_NBSockets_xh

class NBSockets;

#define NBSockets_MajorVersion 2
#define NBSockets_MinorVersion 1

/* C++ SOM defs */
#include <somcls.xh>
#include <somcm.xh>

/* C++ parent defs */
#ifndef SOM_Sockets_xh
#include <somssock.xh>
#endif

/*
 * C++ metaclass def
 */
#include <snglicls.xh>

#ifndef NBSockets_API
#define NBSockets_API
/*
 * -- The Class API
 */

/*
 * Start of bindings for IDL types
 */

class SOMClass;
class SOMObject;

/*
 * End of bindings for IDL types.
 */

/* A procedure to create the NBSockets Class */
class SOMMSingleInstance;
SOMEXTERN SOMMSingleInstance * SOMLINK NBSocketsNewClass(
		integer4 majorVersion,
		integer4 minorVersion);

/* The API to the NBSockets class object, and the methods it introduces. */
SOMEXTERN struct NBSocketsClassDataStructure {
	SOMMSingleInstance *classObject;
} SOMDLINK NBSocketsClassData;
#define _NBSockets NBSocketsClassData.classObject

/* The API to parentMtabs for NBSockets, and the instance data it introduces. */
SOMEXTERN struct NBSocketsCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken              instanceDataToken;
} SOMDLINK NBSocketsCClassData;

/*
 * -- Typedefs for NBSockets Method Procedures
 */
SOMEXTERN {

/*
 * -- Typedefs for Reintroduced Wrapper Methods
 */
typedef long   SOMLINK somTP_NBSockets_somsAccept(NBSockets *somSelf, Environment *ev, 
		long s, 
		sockaddr* name, 
		long* namelen);
typedef somTP_NBSockets_somsAccept *somTD_NBSockets_somsAccept;
typedef long   SOMLINK somTP_NBSockets_somsBind(NBSockets *somSelf, Environment *ev, 
		long s, 
		sockaddr* name, 
		long namelen);
typedef somTP_NBSockets_somsBind *somTD_NBSockets_somsBind;
typedef long   SOMLINK somTP_NBSockets_somsConnect(NBSockets *somSelf, Environment *ev, 
		long s, 
		sockaddr* name, 
		long namelen);
typedef somTP_NBSockets_somsConnect *somTD_NBSockets_somsConnect;
typedef hostent*   SOMLINK somTP_NBSockets_somsGethostbyaddr(NBSockets *somSelf, Environment *ev, 
		char* addr, 
		long addrlen, 
		long domain);
typedef somTP_NBSockets_somsGethostbyaddr *somTD_NBSockets_somsGethostbyaddr;
typedef hostent*   SOMLINK somTP_NBSockets_somsGethostbyname(NBSockets *somSelf, Environment *ev, 
		string name);
typedef somTP_NBSockets_somsGethostbyname *somTD_NBSockets_somsGethostbyname;
typedef hostent*   SOMLINK somTP_NBSockets_somsGethostent(NBSockets *somSelf, Environment *ev);
typedef somTP_NBSockets_somsGethostent *somTD_NBSockets_somsGethostent;
typedef unsigned long   SOMLINK somTP_NBSockets_somsGethostid(NBSockets *somSelf, Environment *ev);
typedef somTP_NBSockets_somsGethostid *somTD_NBSockets_somsGethostid;
typedef long   SOMLINK somTP_NBSockets_somsGethostname(NBSockets *somSelf, Environment *ev, 
		string name, 
		long namelength);
typedef somTP_NBSockets_somsGethostname *somTD_NBSockets_somsGethostname;
typedef long   SOMLINK somTP_NBSockets_somsGetpeername(NBSockets *somSelf, Environment *ev, 
		long s, 
		sockaddr* name, 
		long* namelen);
typedef somTP_NBSockets_somsGetpeername *somTD_NBSockets_somsGetpeername;
typedef servent*   SOMLINK somTP_NBSockets_somsGetservbyname(NBSockets *somSelf, Environment *ev, 
		string name, 
		string protocol);
typedef somTP_NBSockets_somsGetservbyname *somTD_NBSockets_somsGetservbyname;
typedef long   SOMLINK somTP_NBSockets_somsGetsockname(NBSockets *somSelf, Environment *ev, 
		long s, 
		sockaddr* name, 
		long* namelen);
typedef somTP_NBSockets_somsGetsockname *somTD_NBSockets_somsGetsockname;
typedef long   SOMLINK somTP_NBSockets_somsGetsockopt(NBSockets *somSelf, Environment *ev, 
		long s, 
		long level, 
		long optname, 
		char* optval, 
		long* option);
typedef somTP_NBSockets_somsGetsockopt *somTD_NBSockets_somsGetsockopt;
typedef unsigned long   SOMLINK somTP_NBSockets_somsHtonl(NBSockets *somSelf, Environment *ev, 
		unsigned long a);
typedef somTP_NBSockets_somsHtonl *somTD_NBSockets_somsHtonl;
typedef unsigned short   SOMLINK somTP_NBSockets_somsHtons(NBSockets *somSelf, Environment *ev, 
		unsigned short a);
typedef somTP_NBSockets_somsHtons *somTD_NBSockets_somsHtons;
typedef long   SOMLINK somTP_NBSockets_somsIoctl(NBSockets *somSelf, Environment *ev, 
		long s, 
		long cmd, 
		char* data, 
		long length);
typedef somTP_NBSockets_somsIoctl *somTD_NBSockets_somsIoctl;
typedef unsigned long   SOMLINK somTP_NBSockets_somsInet_addr(NBSockets *somSelf, Environment *ev, 
		string cp);
typedef somTP_NBSockets_somsInet_addr *somTD_NBSockets_somsInet_addr;
typedef unsigned long   SOMLINK somTP_NBSockets_somsInet_lnaof(NBSockets *somSelf, Environment *ev, 
		in_addr* addr);
typedef somTP_NBSockets_somsInet_lnaof *somTD_NBSockets_somsInet_lnaof;
typedef in_addr   SOMLINK somTP_NBSockets_somsInet_makeaddr(NBSockets *somSelf, Environment *ev, 
		unsigned long net, 
		unsigned long lna);
typedef somTP_NBSockets_somsInet_makeaddr *somTD_NBSockets_somsInet_makeaddr;
typedef unsigned long   SOMLINK somTP_NBSockets_somsInet_netof(NBSockets *somSelf, Environment *ev, 
		in_addr* addr);
typedef somTP_NBSockets_somsInet_netof *somTD_NBSockets_somsInet_netof;
typedef unsigned long   SOMLINK somTP_NBSockets_somsInet_network(NBSockets *somSelf, Environment *ev, 
		string cp);
typedef somTP_NBSockets_somsInet_network *somTD_NBSockets_somsInet_network;
typedef string   SOMLINK somTP_NBSockets_somsInet_ntoa(NBSockets *somSelf, Environment *ev, 
		in_addr* addr);
typedef somTP_NBSockets_somsInet_ntoa *somTD_NBSockets_somsInet_ntoa;
typedef long   SOMLINK somTP_NBSockets_somsListen(NBSockets *somSelf, Environment *ev, 
		long s, 
		long backlog);
typedef somTP_NBSockets_somsListen *somTD_NBSockets_somsListen;
typedef unsigned long   SOMLINK somTP_NBSockets_somsNtohl(NBSockets *somSelf, Environment *ev, 
		unsigned long a);
typedef somTP_NBSockets_somsNtohl *somTD_NBSockets_somsNtohl;
typedef unsigned short   SOMLINK somTP_NBSockets_somsNtohs(NBSockets *somSelf, Environment *ev, 
		unsigned short a);
typedef somTP_NBSockets_somsNtohs *somTD_NBSockets_somsNtohs;
typedef long   SOMLINK somTP_NBSockets_somsReadv(NBSockets *somSelf, Environment *ev, 
		long s, 
		iovec* iov, 
		long iovcnt);
typedef somTP_NBSockets_somsReadv *somTD_NBSockets_somsReadv;
typedef long   SOMLINK somTP_NBSockets_somsRecv(NBSockets *somSelf, Environment *ev, 
		long s, 
		char* buf, 
		long len, 
		long flags);
typedef somTP_NBSockets_somsRecv *somTD_NBSockets_somsRecv;
typedef long   SOMLINK somTP_NBSockets_somsRecvfrom(NBSockets *somSelf, Environment *ev, 
		long s, 
		char* buf, 
		long len, 
		long flags, 
		sockaddr* name, 
		long* namelen);
typedef somTP_NBSockets_somsRecvfrom *somTD_NBSockets_somsRecvfrom;
typedef long   SOMLINK somTP_NBSockets_somsRecvmsg(NBSockets *somSelf, Environment *ev, 
		long s, 
		msghdr* msg, 
		long flags);
typedef somTP_NBSockets_somsRecvmsg *somTD_NBSockets_somsRecvmsg;
typedef long   SOMLINK somTP_NBSockets_somsSelect(NBSockets *somSelf, Environment *ev, 
		long nfds, 
		fd_set* readfds, 
		fd_set* writefds, 
		fd_set* exceptfds, 
		timeval* timeout);
typedef somTP_NBSockets_somsSelect *somTD_NBSockets_somsSelect;
typedef long   SOMLINK somTP_NBSockets_somsSend(NBSockets *somSelf, Environment *ev, 
		long s, 
		char* msg, 
		long len, 
		long flags);
typedef somTP_NBSockets_somsSend *somTD_NBSockets_somsSend;
typedef long   SOMLINK somTP_NBSockets_somsSendmsg(NBSockets *somSelf, Environment *ev, 
		long s, 
		msghdr* msg, 
		long flags);
typedef somTP_NBSockets_somsSendmsg *somTD_NBSockets_somsSendmsg;
typedef long   SOMLINK somTP_NBSockets_somsSendto(NBSockets *somSelf, Environment *ev, 
		long s, 
		char* msg, 
		long len, 
		long flags, 
		sockaddr* to, 
		long tolen);
typedef somTP_NBSockets_somsSendto *somTD_NBSockets_somsSendto;
typedef long   SOMLINK somTP_NBSockets_somsSetsockopt(NBSockets *somSelf, Environment *ev, 
		long s, 
		long level, 
		long optname, 
		char* optval, 
		long optlen);
typedef somTP_NBSockets_somsSetsockopt *somTD_NBSockets_somsSetsockopt;
typedef long   SOMLINK somTP_NBSockets_somsShutdown(NBSockets *somSelf, Environment *ev, 
		long s, 
		long how);
typedef somTP_NBSockets_somsShutdown *somTD_NBSockets_somsShutdown;
typedef long   SOMLINK somTP_NBSockets_somsSocket(NBSockets *somSelf, Environment *ev, 
		long domain, 
		long type, 
		long protocol);
typedef somTP_NBSockets_somsSocket *somTD_NBSockets_somsSocket;
typedef long   SOMLINK somTP_NBSockets_somsSoclose(NBSockets *somSelf, Environment *ev, 
		long s);
typedef somTP_NBSockets_somsSoclose *somTD_NBSockets_somsSoclose;
typedef long   SOMLINK somTP_NBSockets_somsWritev(NBSockets *somSelf, Environment *ev, 
		long s, 
		iovec* iov, 
		long iovcnt);
typedef somTP_NBSockets_somsWritev *somTD_NBSockets_somsWritev;
typedef long   SOMLINK somTP_NBSockets__get_serrno(NBSockets *somSelf, Environment *ev);
typedef somTP_NBSockets__get_serrno *somTD_NBSockets__get_serrno;
typedef void   SOMLINK somTP_NBSockets__set_serrno(NBSockets *somSelf, Environment *ev, 
		long serrno);
typedef somTP_NBSockets__set_serrno *somTD_NBSockets__set_serrno;
typedef void   SOMLINK somTP_NBSockets_somDefaultInit(NBSockets *somSelf, 
		som3InitCtrl* ctrl);
typedef somTP_NBSockets_somDefaultInit *somTD_NBSockets_somDefaultInit;
typedef void   SOMLINK somTP_NBSockets_somDestruct(NBSockets *somSelf, 
		octet doFree, 
		som3DestructCtrl* ctrl);
typedef somTP_NBSockets_somDestruct *somTD_NBSockets_somDestruct;
typedef void   SOMLINK somTP_NBSockets_somDefaultCopyInit(NBSockets *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultCopyInit *somTD_NBSockets_somDefaultCopyInit;
typedef NBSockets*   SOMLINK somTP_NBSockets_somDefaultAssign(NBSockets *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultAssign *somTD_NBSockets_somDefaultAssign;
typedef void   SOMLINK somTP_NBSockets_somDefaultConstCopyInit(NBSockets *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultConstCopyInit *somTD_NBSockets_somDefaultConstCopyInit;
typedef void   SOMLINK somTP_NBSockets_somDefaultVCopyInit(NBSockets *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultVCopyInit *somTD_NBSockets_somDefaultVCopyInit;
typedef void   SOMLINK somTP_NBSockets_somDefaultConstVCopyInit(NBSockets *somSelf, 
		som3InitCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultConstVCopyInit *somTD_NBSockets_somDefaultConstVCopyInit;
typedef NBSockets*   SOMLINK somTP_NBSockets_somDefaultConstAssign(NBSockets *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultConstAssign *somTD_NBSockets_somDefaultConstAssign;
typedef NBSockets*   SOMLINK somTP_NBSockets_somDefaultVAssign(NBSockets *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultVAssign *somTD_NBSockets_somDefaultVAssign;
typedef NBSockets*   SOMLINK somTP_NBSockets_somDefaultConstVAssign(NBSockets *somSelf, 
		som3AssignCtrl* ctrl, 
		SOMObject* fromObj);
typedef somTP_NBSockets_somDefaultConstVAssign *somTD_NBSockets_somDefaultConstVAssign;
typedef void   SOMLINK somTP_NBSockets_somInit(NBSockets *somSelf);
typedef somTP_NBSockets_somInit *somTD_NBSockets_somInit;
typedef void   SOMLINK somTP_NBSockets_somFree(NBSockets *somSelf);
typedef somTP_NBSockets_somFree *somTD_NBSockets_somFree;
typedef void   SOMLINK somTP_NBSockets_somUninit(NBSockets *somSelf);
typedef somTP_NBSockets_somUninit *somTD_NBSockets_somUninit;
typedef SOMMSingleInstance*   SOMLINK somTP_NBSockets_somGetClass(NBSockets *somSelf);
typedef somTP_NBSockets_somGetClass *somTD_NBSockets_somGetClass;
typedef string   SOMLINK somTP_NBSockets_somGetClassName(NBSockets *somSelf);
typedef somTP_NBSockets_somGetClassName *somTD_NBSockets_somGetClassName;
typedef long   SOMLINK somTP_NBSockets_somGetSize(NBSockets *somSelf);
typedef somTP_NBSockets_somGetSize *somTD_NBSockets_somGetSize;
typedef boolean   SOMLINK somTP_NBSockets_somIsA(NBSockets *somSelf, 
		SOMClass* aClassObj);
typedef somTP_NBSockets_somIsA *somTD_NBSockets_somIsA;
typedef boolean   SOMLINK somTP_NBSockets_somIsInstanceOf(NBSockets *somSelf, 
		SOMClass* aClassObj);
typedef somTP_NBSockets_somIsInstanceOf *somTD_NBSockets_somIsInstanceOf;
typedef boolean   SOMLINK somTP_NBSockets_somRespondsTo(NBSockets *somSelf, 
		somId mId);
typedef somTP_NBSockets_somRespondsTo *somTD_NBSockets_somRespondsTo;
typedef boolean   SOMLINK somTP_NBSockets_somDispatch(NBSockets *somSelf, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_NBSockets_somDispatch *somTD_NBSockets_somDispatch;
typedef boolean   SOMLINK somTP_NBSockets_somClassDispatch(NBSockets *somSelf, 
		SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap);
typedef somTP_NBSockets_somClassDispatch *somTD_NBSockets_somClassDispatch;
typedef boolean   SOMLINK somTP_NBSockets_somCastObj(NBSockets *somSelf, 
		SOMClass* cls);
typedef somTP_NBSockets_somCastObj *somTD_NBSockets_somCastObj;
typedef boolean   SOMLINK somTP_NBSockets_somResetObj(NBSockets *somSelf);
typedef somTP_NBSockets_somResetObj *somTD_NBSockets_somResetObj;
typedef void   SOMLINK somTP_NBSockets_somDispatchV(NBSockets *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_NBSockets_somDispatchV *somTD_NBSockets_somDispatchV;
typedef long   SOMLINK somTP_NBSockets_somDispatchL(NBSockets *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_NBSockets_somDispatchL *somTD_NBSockets_somDispatchL;
typedef void*   SOMLINK somTP_NBSockets_somDispatchA(NBSockets *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_NBSockets_somDispatchA *somTD_NBSockets_somDispatchA;
typedef double   SOMLINK somTP_NBSockets_somDispatchD(NBSockets *somSelf, 
		somId methodId, 
		somId descriptor, 
		va_list ap);
typedef somTP_NBSockets_somDispatchD *somTD_NBSockets_somDispatchD;
typedef SOMObject*   SOMLINK somTP_NBSockets_somPrintSelf(NBSockets *somSelf);
typedef somTP_NBSockets_somPrintSelf *somTD_NBSockets_somPrintSelf;
typedef void   SOMLINK somTP_NBSockets_somDumpSelf(NBSockets *somSelf, 
		long level);
typedef somTP_NBSockets_somDumpSelf *somTD_NBSockets_somDumpSelf;
typedef void   SOMLINK somTP_NBSockets_somDumpSelfInt(NBSockets *somSelf, 
		long level);
typedef somTP_NBSockets_somDumpSelfInt *somTD_NBSockets_somDumpSelfInt;
}

#endif /* NBSockets_API */


/*
 * -- This emitter treats Method Tokens as Thunks by default.
 * -- Use the sc modifier "nothunks" to change this default
 */
#undef somresolve_
#define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))

/*
 * -- The C++ Wrapper Class for NBSockets
 */
class NBSockets : public Sockets
{
public:

// NBSockets::new creates the class object if necessary, and then uses somNewNoInit
// to allocate memory and create the object. Initialization is in ctors.
void *operator new(size_t)
{
   if (!_NBSockets) NBSocketsNewClass(NBSockets_MajorVersion,NBSockets_MinorVersion);
   return (void*)
      SOM_Resolve(_NBSockets,SOMClass,somNewNoInit)
         ((SOMClass *)((void*)_NBSockets));
}

// NBSockets::delete uses somDestruct.
void operator delete(void * obj)
{
   if (obj && *(void**)obj) {
      SOM_Resolve(obj,SOMObject,somFree)
         ((SOMObject*)obj);
   }
}

NBSockets& operator=(NBSockets& fromObj)
{
   this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
   return *this;
}

NBSockets()
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (NBSocketsCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultInit(0);
}

NBSockets(NBSockets* fromObj)
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (NBSocketsCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
}

#ifdef __IBMCPP__
#pragma info(nocnv,nopar)
#endif
NBSockets(const NBSockets* fromObj)
{
   if (*(void**)this != 
       ((somParentMtabStructPtr)
        (NBSocketsCClassData.parentMtab))->mtab)
      return;
   ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
}
#ifdef __IBMCPP__
#pragma info(restore)
#endif


/*
 * Reintroduce inherited methods
 */

/* method: somsAccept */
long   somsAccept(Environment *ev, 
		long s, 
		sockaddr* name, 
		long* namelen)
{
/*
 *  Accept a connection request from a client.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsAccept)
	(this, ev,s,name,namelen);
}


/* method: somsBind */
long   somsBind(Environment *ev, 
		long s, 
		sockaddr* name, 
		long namelen)
{
/*
 *  Binds a unique local name to the socket with descriptor s.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsBind)
	(this, ev,s,name,namelen);
}


/* method: somsConnect */
long   somsConnect(Environment *ev, 
		long s, 
		sockaddr* name, 
		long namelen)
{
/*
 *  For streams sockets, attempts to establish a connection between
 *  two sockets.  For datagram sockets, specifies the socket's peer.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsConnect)
	(this, ev,s,name,namelen);
}


/* method: somsGethostbyaddr */
hostent*   somsGethostbyaddr(Environment *ev, 
		char* addr, 
		long addrlen, 
		long domain)
{
/*
 *  Returns a hostent structure for the host address specified on
 *  the call.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGethostbyaddr)
	(this, ev,addr,addrlen,domain);
}


/* method: somsGethostbyname */
hostent*   somsGethostbyname(Environment *ev, 
		string name)
{
/*
 *  Returns a hostent structure for the host name specified on
 *  the call.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGethostbyname)
	(this, ev,name);
}


/* method: somsGethostent */
hostent*   somsGethostent(Environment *ev)
{
/*
 *  Returns a pointer to the next entry in the hosts file.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGethostent)
	(this, ev);
}


/* method: somsGethostid */
unsigned long   somsGethostid(Environment *ev)
{
/*
 *  Returns the unique identifier for the current host.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGethostid)
	(this, ev);
}


/* method: somsGethostname */
long   somsGethostname(Environment *ev, 
		string name, 
		long namelength)
{
/*
 *  Retrieves the standard host name of the local host.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGethostname)
	(this, ev,name,namelength);
}


/* method: somsGetpeername */
long   somsGetpeername(Environment *ev, 
		long s, 
		sockaddr* name, 
		long* namelen)
{
/*
 *  Gets the name of the peer connected to socket s.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGetpeername)
	(this, ev,s,name,namelen);
}


/* method: somsGetservbyname */
servent*   somsGetservbyname(Environment *ev, 
		string name, 
		string protocol)
{
/*
 *  Retrieves an entry from the /etc/services file using the service
 *  name as a search key.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGetservbyname)
	(this, ev,name,protocol);
}


/* method: somsGetsockname */
long   somsGetsockname(Environment *ev, 
		long s, 
		sockaddr* name, 
		long* namelen)
{
/*
 *  Stores the current name for the socket specified by the s
 *  parameter into the structure pointed to by the name parameter.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGetsockname)
	(this, ev,s,name,namelen);
}


/* method: somsGetsockopt */
long   somsGetsockopt(Environment *ev, 
		long s, 
		long level, 
		long optname, 
		char* optval, 
		long* option)
{
/*
 *  Returns the values of socket options at various protocol levels.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsGetsockopt)
	(this, ev,s,level,optname,optval,option);
}


/* method: somsHtonl */
unsigned long   somsHtonl(Environment *ev, 
		unsigned long a)
{
/*
 *  Translates an unsigned long integer from host-byte order to
 *  network-byte order.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsHtonl)
	(this, ev,a);
}


/* method: somsHtons */
unsigned short   somsHtons(Environment *ev, 
		unsigned short a)
{
/*
 *  Translates an unsigned short integer from host-byte order to
 *  network-byte order.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsHtons)
	(this, ev,a);
}


/* method: somsIoctl */
long   somsIoctl(Environment *ev, 
		long s, 
		long cmd, 
		char* data, 
		long length)
{
/*
 *  Controls the operating characteristics of sockets.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsIoctl)
	(this, ev,s,cmd,data,length);
}


/* method: somsInet_addr */
unsigned long   somsInet_addr(Environment *ev, 
		string cp)
{
/*
 *  Interprets character strings representing numbers expressed in
 *  standard '.' notation and returns numbers suitable for use as
 *  internet addresses.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsInet_addr)
	(this, ev,cp);
}


/* method: somsInet_lnaof */
unsigned long   somsInet_lnaof(Environment *ev, 
		in_addr* addr)
{
/*
 *  Breaks apart the internet address and returns the local network
 *  address portion.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsInet_lnaof)
	(this, ev,addr);
}


/* method: somsInet_makeaddr */
in_addr   somsInet_makeaddr(Environment *ev, 
		unsigned long net, 
		unsigned long lna)
{
/*
 *  Takes a network number and a local network address and constructs
 *  an internet address.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsInet_makeaddr)
	(this, ev,net,lna);
}


/* method: somsInet_netof */
unsigned long   somsInet_netof(Environment *ev, 
		in_addr* addr)
{
/*
 *  Returns the network number portion of the given internet address.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsInet_netof)
	(this, ev,addr);
}


/* method: somsInet_network */
unsigned long   somsInet_network(Environment *ev, 
		string cp)
{
/*
 *  Interprets character strings representing numbers expressed in
 *  standard '.' notation and returns numbers suitable for use as
 *  network numbers.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsInet_network)
	(this, ev,cp);
}


/* method: somsInet_ntoa */
string   somsInet_ntoa(Environment *ev, 
		in_addr* addr)
{
/*
 *  Returns a pointer to a string expressed in the dotted-decimal
 *  notation.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsInet_ntoa)
	(this, ev,addr);
}


/* method: somsListen */
long   somsListen(Environment *ev, 
		long s, 
		long backlog)
{
/*
 *  Creates a connection request queue of length backlog to queue
 *  incoming connection requests, and then waits for incoming
 *  connection requests.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsListen)
	(this, ev,s,backlog);
}


/* method: somsNtohl */
unsigned long   somsNtohl(Environment *ev, 
		unsigned long a)
{
/*
 *  Translates an unsigned long integer from network-byte order
 *  to host-byte order.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsNtohl)
	(this, ev,a);
}


/* method: somsNtohs */
unsigned short   somsNtohs(Environment *ev, 
		unsigned short a)
{
/*
 *  Translates an unsigned short integer from network-byte order
 *  to host-byte order.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsNtohs)
	(this, ev,a);
}


/* method: somsReadv */
long   somsReadv(Environment *ev, 
		long s, 
		iovec* iov, 
		long iovcnt)
{
/*
 *  Reads data on socket s and stores it in a set of buffers
 *  described by iov.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsReadv)
	(this, ev,s,iov,iovcnt);
}


/* method: somsRecv */
long   somsRecv(Environment *ev, 
		long s, 
		char* buf, 
		long len, 
		long flags)
{
/*
 *  Receives data on streams socket s and stores it in buf.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsRecv)
	(this, ev,s,buf,len,flags);
}


/* method: somsRecvfrom */
long   somsRecvfrom(Environment *ev, 
		long s, 
		char* buf, 
		long len, 
		long flags, 
		sockaddr* name, 
		long* namelen)
{
/*
 *  Receives data on datagram socket s and stores it in buf.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsRecvfrom)
	(this, ev,s,buf,len,flags,name,namelen);
}


/* method: somsRecvmsg */
long   somsRecvmsg(Environment *ev, 
		long s, 
		msghdr* msg, 
		long flags)
{
/*
 *  Receives messages on a socket with descriptor s and stores them
 *  in an array of message headers.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsRecvmsg)
	(this, ev,s,msg,flags);
}


/* method: somsSelect */
long   somsSelect(Environment *ev, 
		long nfds, 
		fd_set* readfds, 
		fd_set* writefds, 
		fd_set* exceptfds, 
		timeval* timeout)
{
/*
 *  Monitors activity on a set of different sockets until a timeout
 *  expires, to see if any sockets are ready for reading or writing,
 *  or if an exceptional condition is pending.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSelect)
	(this, ev,nfds,readfds,writefds,exceptfds,timeout);
}


/* method: somsSend */
long   somsSend(Environment *ev, 
		long s, 
		char* msg, 
		long len, 
		long flags)
{
/*
 *  Sends msg on streams socket s.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSend)
	(this, ev,s,msg,len,flags);
}


/* method: somsSendmsg */
long   somsSendmsg(Environment *ev, 
		long s, 
		msghdr* msg, 
		long flags)
{
/*
 *  Sends messages passed in an array of message headers on a socket
 *  with descriptor s.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSendmsg)
	(this, ev,s,msg,flags);
}


/* method: somsSendto */
long   somsSendto(Environment *ev, 
		long s, 
		char* msg, 
		long len, 
		long flags, 
		sockaddr* to, 
		long tolen)
{
/*
 *  Sends msg on datagram socket s.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSendto)
	(this, ev,s,msg,len,flags,to,tolen);
}


/* method: somsSetsockopt */
long   somsSetsockopt(Environment *ev, 
		long s, 
		long level, 
		long optname, 
		char* optval, 
		long optlen)
{
/*
 *  Sets options associated with a socket.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSetsockopt)
	(this, ev,s,level,optname,optval,optlen);
}


/* method: somsShutdown */
long   somsShutdown(Environment *ev, 
		long s, 
		long how)
{
/*
 *  Shuts down all or part of a full-duplex connection.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsShutdown)
	(this, ev,s,how);
}


/* method: somsSocket */
long   somsSocket(Environment *ev, 
		long domain, 
		long type, 
		long protocol)
{
/*
 *  Creates an endpoint for communication and returns a socket
 *  descriptor representing the endpoint.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSocket)
	(this, ev,domain,type,protocol);
}


/* method: somsSoclose */
long   somsSoclose(Environment *ev, 
		long s)
{
/*
 *  Shuts down socket s and frees resources allocated to the socket.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsSoclose)
	(this, ev,s);
}


/* method: somsWritev */
long   somsWritev(Environment *ev, 
		long s, 
		iovec* iov, 
		long iovcnt)
{
/*
 *  Writes data on socket s.  The data is gathered from the buffers
 *  described by iov.
 */
   return SOM_ResolveD(this,NBSockets,Sockets,somsWritev)
	(this, ev,s,iov,iovcnt);
}


/* method: _get_serrno */
long   _get_serrno(Environment *ev)
{
/*
 * Method from the IDL attribute statement:
 * "attribute long serrno"
 */
   return SOM_ResolveD(this,NBSockets,Sockets,_get_serrno)
	(this, ev);
}


/* method: _set_serrno */
void   _set_serrno(Environment *ev, 
		long serrno)
{
/*
 * Method from the IDL attribute statement:
 * "attribute long serrno"
 */
   SOM_ResolveD(this,NBSockets,Sockets,_set_serrno)
	(this, ev,serrno);
}


/* initializer method: somDefaultInit */
void   somDefaultInit(som3InitCtrl* ctrl)
{
/*
 *  A default initializer for a SOM object. Passing a null ctrl
 *  indicates to the receiver that its class is the class of the
 *  object being initialized, whereby the initializer will determine
 *  an appropriate control structure.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDefaultInit)
	(this,ctrl);
}


/* method: somDestruct */
void   somDestruct(octet doFree, 
		som3DestructCtrl* ctrl)
{
/*
 *  The default destructor for a SOM object. A nonzero <doFree>
 *  indicates that the object storage should be freed by the
 *  object's class (via somDeallocate) after uninitialization.
 *  As with somDefaultInit, a null ctrl can be passed.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDestruct)
	(this,doFree,ctrl);
}


/* initializer method: somDefaultCopyInit */
void   somDefaultCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor. Use this to make copies of objects for
 *  calling methods with "by-value" argument semantics.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDefaultCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultAssign */
NBSockets*  somDefaultAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator. Use this to "assign" the state of one
 *  object to another.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somDefaultAssign)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultConstCopyInit */
void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const fromObj.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDefaultConstCopyInit)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultVCopyInit */
void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a volatile fromObj.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDefaultVCopyInit)
	(this,ctrl,fromObj);
}


/* initializer method: somDefaultConstVCopyInit */
void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default copy constructor that uses a const volatile fromObj.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDefaultConstVCopyInit)
	(this,ctrl,fromObj);
}


/* method: somDefaultConstAssign */
NBSockets*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const fromObj.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somDefaultConstAssign)
	(this,ctrl,fromObj);
}


/* method: somDefaultVAssign */
NBSockets*  somDefaultVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a volatile fromObj.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somDefaultVAssign)
	(this,ctrl,fromObj);
}


/* method: somDefaultConstVAssign */
NBSockets*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
		SOMObject* fromObj)
{
/*
 *  A default assignment operator that uses a const volatile fromObj.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somDefaultConstVAssign)
	(this,ctrl,fromObj);
}


/* method: somInit */
void   somInit()
{
/*
 *  Obsolete but still supported. Override somDefaultInit instead of somInit.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somInit)
	(this);
}


/* method: somFree */
void   somFree()
{
/*
 *  Use as directed by framework implementations.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somFree)
	(this);
}


/* method: somUninit */
void   somUninit()
{
/*
 *  Obsolete but still supported. Override somDestruct instead of somUninit.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somUninit)
	(this);
}


/* method: somGetClass */
SOMMSingleInstance*  somGetClass()
{
/*
 *  Return the receiver's class.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somGetClass)
	(this);
}


/* method: somGetClassName */
string   somGetClassName()
{
/*
 *  Return the name of the receiver's class.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somGetClassName)
	(this);
}


/* method: somGetSize */
long   somGetSize()
{
/*
 *  Return the size of the receiver.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somGetSize)
	(this);
}


/* method: somIsA */
boolean   somIsA(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver responds to methods
 *  introduced by <aClassObj>, and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somIsA)
	(this,aClassObj);
}


/* method: somIsInstanceOf */
boolean   somIsInstanceOf(SOMClass* aClassObj)
{
/*
 *  Returns 1 (true) if the receiver is an instance of
 *  <aClassObj> and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somIsInstanceOf)
	(this,aClassObj);
}


/* method: somRespondsTo */
boolean   somRespondsTo(somId mId)
{
/*
 *  Returns 1 (true) if the indicated method can be invoked
 *  on the receiver and 0 (false) otherwise.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somRespondsTo)
	(this,mId);
}


/* va_list method: somDispatch */

/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 */
/* the va_list invocation form */
boolean   NBSockets_somDispatch(somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,NBSockets,SOMObject,somDispatch)
	(this,retValue,methodId,ap);
}

/* the varargs invocation form */
boolean   somDispatch(somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  This method provides a generic, class-specific dispatch mechanism.
 *  It accepts as input <retValue> a pointer to the memory area to be
 *  loaded with the result of dispatching the method indicated by
 *  <methodId> using the arguments in <ap>. <ap> contains the object
 *  on which the method is to be invoked as the first argument.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      SOM_ResolveD(this,NBSockets,SOMObject,somDispatch)
	(this,retValue,methodId,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somClassDispatch */

/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
/* the va_list invocation form */
boolean   NBSockets_somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		va_list ap)
{return SOM_ResolveD(this,NBSockets,SOMObject,somClassDispatch)
	(this,clsObj,retValue,methodId,ap);
}

/* the varargs invocation form */
boolean   somClassDispatch(SOMClass* clsObj, 
		somToken* retValue, 
		somId methodId, 
		...)
{
/*
 *  Like somDispatch, but method resolution for static methods is done
 *  according to the clsObj instance method table.
 */
   va_list ap;
   va_start(ap, methodId);
   boolean __somResult = 
      SOM_ResolveD(this,NBSockets,SOMObject,somClassDispatch)
	(this,clsObj,retValue,methodId,ap);
   va_end(ap);
   return __somResult;
}


/* method: somCastObj */
boolean   somCastObj(SOMClass* cls)
{
/*
 *  cast the receiving object to cls (which must be an ancestor of the
 *  objects true class. Returns true on success.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somCastObj)
	(this,cls);
}


/* method: somResetObj */
boolean   somResetObj()
{
/*
 *  reset an object to its true class. Returns true always.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somResetObj)
	(this);
}


/* va_list method: somDispatchV */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void   NBSockets_somDispatchV(somId methodId, 
		somId descriptor, 
		va_list ap)
{   SOM_ResolveD(this,NBSockets,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
void   somDispatchV(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   SOM_ResolveD(this,NBSockets,SOMObject,somDispatchV)
	(this,methodId,descriptor,ap);
   va_end(ap);
}


/* va_list method: somDispatchL */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
long   NBSockets_somDispatchL(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,NBSockets,SOMObject,somDispatchL)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
long   somDispatchL(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   long __somResult = 
      SOM_ResolveD(this,NBSockets,SOMObject,somDispatchL)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somDispatchA */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
void*   NBSockets_somDispatchA(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,NBSockets,SOMObject,somDispatchA)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
void*   somDispatchA(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   void* __somResult = 
      SOM_ResolveD(this,NBSockets,SOMObject,somDispatchA)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* va_list method: somDispatchD */

/*
 *  Obsolete. Use somDispatch instead.
 */
/* the va_list invocation form */
double   NBSockets_somDispatchD(somId methodId, 
		somId descriptor, 
		va_list ap)
{return SOM_ResolveD(this,NBSockets,SOMObject,somDispatchD)
	(this,methodId,descriptor,ap);
}

/* the varargs invocation form */
double   somDispatchD(somId methodId, 
		somId descriptor, 
		...)
{
/*
 *  Obsolete. Use somDispatch instead.
 */
   va_list ap;
   va_start(ap, descriptor);
   double __somResult = 
      SOM_ResolveD(this,NBSockets,SOMObject,somDispatchD)
	(this,methodId,descriptor,ap);
   va_end(ap);
   return __somResult;
}


/* method: somPrintSelf */
SOMObject*   somPrintSelf()
{
/*
 *  Uses <SOMOutCharRoutine> to write a brief string with identifying
 *  information about this object.  The default implementation just gives
 *  the object's class name and its address in memory.
 *  <self> is returned.
 */
   return SOM_ResolveD(this,NBSockets,SOMObject,somPrintSelf)
	(this);
}


/* method: somDumpSelf */
void   somDumpSelf(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write a detailed description of this object
 *  and its current state.
 * 
 *  <level> indicates the nesting level for describing compound objects
 *  it must be greater than or equal to zero.  All lines in the
 *  description will be preceeded by <2*level> spaces.
 * 
 *  This routine only actually writes the data that concerns the object
 *  as a whole, such as class, and uses <somDumpSelfInt> to describe
 *  the object's current state.  This approach allows readable
 *  descriptions of compound objects to be constructed.
 * 
 *  Generally it is not necessary to override this method, if it is
 *  overriden it generally must be completely replaced.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDumpSelf)
	(this,level);
}


/* method: somDumpSelfInt */
void   somDumpSelfInt(long level)
{
/*
 *  Uses <SOMOutCharRoutine> to write in the current state of this object.
 *  Generally this method will need to be overridden.  When overriding
 *  it, begin by calling the parent class form of this method and then
 *  write in a description of your class's instance data. This will
 *  result in a description of all the object's instance data going
 *  from its root ancestor class to its specific class.
 */
   SOM_ResolveD(this,NBSockets,SOMObject,somDumpSelfInt)
	(this,level);
}



};   /* NBSockets */



#endif       /* SOM_NBSockets_xh */
