/*****************************************************************/
/**                                                             **/
/**             (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           **/
/**                                                             **/
/*****************************************************************/
 
Interface sample; 
 
   Invoke ike 52 
	Integer(2); 
 
   Invoke jfk 60 
	Integer(4),Integer(3); 

End; 
  

main(argc,argv) 
   int argc; 
   char *argv[]; 
{ 
   static struct {  
      Integer(2) i2; 
      Integer(2) j2; 
   } is = {75,2010};  
   Integer(4) tmp = -17,*i4 = &tmp; 
   Integer(3) i3; 
   Integer(2) r4096; 
   Integer(4) r1,r2; 
 
   Control (sample) inst; 
  
   i3 = 1451132; 
 
   if (argc != 2) 
      exit(1);    
  
/***************** send it out ************************/

   Bind_STUB(inst,argv[1],"w",Asn_1_ber); 

   Give inst ike(is.j2); 

   Give inst 
   { 
      ike(4096); 
      jfk(*i4,i3); 
   } 
 
   Unbind(inst); 
  
/***************** receive it back ********************/

   Bind_STUB(inst,argv[1],"r",Asn_1_ber); 

   Accept inst 
   { 
      On ike(is.i2) 
       { 
	if (is.i2 != is.j2) 
	   printf("### gave %d, accepted %d\n",is.j2,is.i2); 
      }  
   } 
 
   Accept inst 
   { 
      On ike(r4096) 
       { 
	if (r4096 != 4096) 
	   printf("###Didn't accept 4096\n"); 
      }  
 
   } 

   Accept inst 
   { 
      On jfk(r1,r2) 
       { 
	if (r1 != *i4 || r2 != i3) 
	   printf("###jfk wrong\n"); 
      }  
   } 
 
   Unbind(inst); 
 
   printf("test completed\n");
   return(0); 
} 
