/*****************************************************************/
/**                                                             **/
/**             (C) Copyright 1992 the Regents of the           **/
/**        University of California.  All Rights Reserved.      **/
/**                                                             **/
/**        This work was produced under the sponsorship of      **/
/**         the U.S. Department of Energy.  The Government      **/
/**                retains certain rights therein.              **/
/**                                                             **/
/**                         Written by                          **/
/**         Distributed Programming Environments Project        **/
/**           Computer Software and Networking Division,        **/
/**                   Livermore Computer Center,                **/
/**            Lawrence Livermore National Laboratory           **/
/**                                                             **/
/*****************************************************************/

static char sccs_STDflush[] = "@(#)STDflush.c	1.4 10/19/92 13:47:35 LLNL ";

/*
	Embedded Language for Remote Operations Services
	ELROS

	AUTHOR:		James A. Guse
			Network Systems Division

	DATE WRITTEN:	10/12/90

	ROUTINE:	flush_instance
	Version:	STDflush_instance

PURPOSE:
	This routine sends the PPDU trailer

IN:
	instance -

OUT:


CALLED ROUTINES:
	

	
MODIFICATION HISTORY:


*/

#include <elros/instance.h>

int __ROr_STDflush_instance(instance)

	__RO_Instance_Record *instance;

{
   int nesting_temp = instance->sending_nesting;  /* save the old value */


	/* Decision was to act as a NOOP, rather than raise an exception,
 	   when called and sending_nesting is 0 */

   if (instance->sending_nesting < 0)
      __RO_RETURN_RUNTIME(instance,__ROx_SEND_NSENDINGNESTING)
   else if (instance->sending_nesting == 0)
      return(SUCCESS);
   else
      instance->sending_nesting = 1;


   if ((instance->sendPPDU_end)(instance))
      return(EXCEPTION);
   instance->sending_flushed = 1;

   instance->sending_nesting = nesting_temp;
   return(SUCCESS);
}


