head	1.1;
access;
symbols;
locks
	cbbrowne:1.1; strict;
comment	@ * @;


1.1
date	2000.07.17.05.29.20;	author cbbrowne;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@/*
 * This file was generated by orbit-idl - DO NOT EDIT!
 */

#include <string.h>
#include "security.h"

void
_ORBIT_SECURITY_USERAUTH_NOTAUTHENTICATED_marshal(GIOPSendBuffer *
						  _ORBIT_send_buffer,
						  CORBA_Environment * ev)
{
}

void
_ORBIT_skel_SECURITY_USERAUTH_login(POA_SECURITY_USERAUTH * _ORBIT_servant,
				    GIOPRecvBuffer * _ORBIT_recv_buffer,
				    CORBA_Environment * ev,
				    void (*_impl_login)
				    (PortableServer_Servant _servant,
				     const CORBA_char * user,
				     const CORBA_char * password,
				     CORBA_long * token,
				     CORBA_Environment * ev))
{
   CORBA_char *user;
   CORBA_char *password;
   CORBA_long token;

   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_4;
      CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;

      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 
	    (*((guint32 *) & (_ORBIT_tmpvar_5))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 user = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(user[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 password = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(password[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_5 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 user = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(user[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 password = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(password[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
      }
   }
   _impl_login(_ORBIT_servant, user, password, &(token), ev);
   {				/* marshalling */
      register GIOPSendBuffer *_ORBIT_send_buffer;

      _ORBIT_send_buffer =
	 giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->
				    connection, NULL,
				    _ORBIT_recv_buffer->message.u.request.
				    request_id, ev->_major);
      if (ev->_major == CORBA_NO_EXCEPTION) {
	 giop_message_buffer_do_alignment(GIOP_MESSAGE_BUFFER
					  (_ORBIT_send_buffer), 4);
	 giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER
					(_ORBIT_send_buffer), &(token),
					sizeof(token));
      } else if (ev->_major == CORBA_USER_EXCEPTION) {
	 static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] =
	    { {(const CORBA_TypeCode)
	       &TC_SECURITY_USERAUTH_NOTAUTHENTICATED_struct,
	       (gpointer) _ORBIT_SECURITY_USERAUTH_NOTAUTHENTICATED_marshal},
	    {CORBA_OBJECT_NIL, NULL} };

	 ORBit_send_user_exception(_ORBIT_send_buffer, ev,
				   _ORBIT_user_exceptions);
      } else
	 ORBit_send_system_exception(_ORBIT_send_buffer, ev);
      giop_send_buffer_write(_ORBIT_send_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
   }
}
void
_ORBIT_skel_SECURITY_USERAUTH_validate(POA_SECURITY_USERAUTH * _ORBIT_servant,
				       GIOPRecvBuffer * _ORBIT_recv_buffer,
				       CORBA_Environment * ev,
				       void (*_impl_validate)
				       (PortableServer_Servant _servant,
					const CORBA_char * user,
					const CORBA_char * capability,
					CORBA_Environment * ev))
{
   CORBA_char *user;
   CORBA_char *capability;

   {				/* demarshalling */
      guchar *_ORBIT_curptr;
      register CORBA_unsigned_long _ORBIT_tmpvar_4;
      CORBA_unsigned_long _ORBIT_tmpvar_5;
      register CORBA_unsigned_long _ORBIT_tmpvar_6;
      CORBA_unsigned_long _ORBIT_tmpvar_7;

      _ORBIT_curptr = GIOP_RECV_BUFFER(_ORBIT_recv_buffer)->cur;
      if (giop_msg_conversion_needed(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer))) {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 
	    (*((guint32 *) & (_ORBIT_tmpvar_5))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 user = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(user[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 
	    (*((guint32 *) & (_ORBIT_tmpvar_7))) =
	    GUINT32_SWAP_LE_BE(*((guint32 *) _ORBIT_curptr));
	 _ORBIT_curptr += 4;
	 capability = (void *) _ORBIT_curptr;
	 _ORBIT_curptr +=
	    sizeof(capability[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
      } else {
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_5 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 user = (void *) _ORBIT_curptr;
	 _ORBIT_curptr += sizeof(user[_ORBIT_tmpvar_4]) * _ORBIT_tmpvar_5;
	 _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 4);
	 _ORBIT_tmpvar_7 = *((CORBA_unsigned_long *) _ORBIT_curptr);
	 _ORBIT_curptr += 4;
	 capability = (void *) _ORBIT_curptr;
	 _ORBIT_curptr +=
	    sizeof(capability[_ORBIT_tmpvar_6]) * _ORBIT_tmpvar_7;
      }
   }
   _impl_validate(_ORBIT_servant, user, capability, ev);
   {				/* marshalling */
      register GIOPSendBuffer *_ORBIT_send_buffer;

      _ORBIT_send_buffer =
	 giop_send_reply_buffer_use(GIOP_MESSAGE_BUFFER(_ORBIT_recv_buffer)->
				    connection, NULL,
				    _ORBIT_recv_buffer->message.u.request.
				    request_id, ev->_major);
      if (ev->_major == CORBA_NO_EXCEPTION) {
      } else if (ev->_major == CORBA_USER_EXCEPTION) {
	 static const ORBit_exception_marshal_info _ORBIT_user_exceptions[] =
	    { {(const CORBA_TypeCode)
	       &TC_SECURITY_USERAUTH_NOTAUTHENTICATED_struct,
	       (gpointer) _ORBIT_SECURITY_USERAUTH_NOTAUTHENTICATED_marshal},
	    {CORBA_OBJECT_NIL, NULL} };

	 ORBit_send_user_exception(_ORBIT_send_buffer, ev,
				   _ORBIT_user_exceptions);
      } else
	 ORBit_send_system_exception(_ORBIT_send_buffer, ev);
      giop_send_buffer_write(_ORBIT_send_buffer);
      giop_send_buffer_unuse(_ORBIT_send_buffer);
   }
}
static ORBitSkeleton
get_skel_SECURITY_USERAUTH(POA_SECURITY_USERAUTH * servant,
			   GIOPRecvBuffer * _ORBIT_recv_buffer,
			   gpointer * impl)
{
   gchar *opname = _ORBIT_recv_buffer->message.u.request.operation;

   switch (opname[0]) {
     case 'l':
      if (strcmp((opname + 1), "ogin"))
	 break;
      *impl = (gpointer) servant->vepv->SECURITY_USERAUTH_epv->login;
      return (ORBitSkeleton) _ORBIT_skel_SECURITY_USERAUTH_login;
      break;
     case 'v':
      if (strcmp((opname + 1), "alidate"))
	 break;
      *impl = (gpointer) servant->vepv->SECURITY_USERAUTH_epv->validate;
      return (ORBitSkeleton) _ORBIT_skel_SECURITY_USERAUTH_validate;
      break;
     default:
      break;
   }
   return NULL;
}

static void
init_local_objref_SECURITY_USERAUTH(CORBA_Object obj,
				    POA_SECURITY_USERAUTH * servant)
{
   obj->vepv[SECURITY_USERAUTH__classid] =
      servant->vepv->SECURITY_USERAUTH_epv;
}

void
POA_SECURITY_USERAUTH__init(PortableServer_Servant servant,
			    CORBA_Environment * env)
{
   static const PortableServer_ClassInfo class_info =
      { (ORBit_impl_finder) & get_skel_SECURITY_USERAUTH,
	 "IDL:SECURITY/USERAUTH:1.0",
	 (ORBit_local_objref_init) & init_local_objref_SECURITY_USERAUTH };

   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
				    env);
   ORBIT_OBJECT_KEY(((PortableServer_ServantBase *) servant)->_private)->
      class_info = (PortableServer_ClassInfo *) & class_info;
   if (!SECURITY_USERAUTH__classid)
      SECURITY_USERAUTH__classid = ORBit_register_class(&class_info);
}

void
POA_SECURITY_USERAUTH__fini(PortableServer_Servant servant,
			    CORBA_Environment * env)
{
   PortableServer_ServantBase__fini(servant, env);
}
@
