/*****************************************************************/
/**                                                             **/
/**             (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 sccsid_cmpP_oid[] = "@(#)cmpP_oid.c	1.7 10/19/92 13:52:56  LLNL ";

/*
	Embedded Language for Remote Operations Services
	ELROS

	AUTHOR:		James A. Guse
			Network Systems Division

	DATE WRITTEN:	9/14/90

	ROUTINES:	__ROr_cmpP_ObjectIdentifier

PURPOSE:
	Compare two object-identifiers in ELROS structures.


IN:
	value1 - lhs OID
	value2 - rhs OID
	maxlength - maximum length.
	maxlength2 - maximum length aux.

OUT:
	RETURNs a boolean comparison flag


CALLED ROUTINES:
	

	
MODIFICATION HISTORY:


*/

#include <elros/instance.h>

 
int __ROr_cmpP_ObjectIdentifier(value1, value2, maxlength, maxlength2)

   struct __RO_oid_skeleton *value1;
   struct __RO_oid_skeleton *value2;
   unsigned long *	maxlength;
   unsigned long *	maxlength2;

{
   int i;
   unsigned long *comp1, *comp2;

   if (*maxlength && (value1->size > *maxlength || value2->size > *maxlength))
      return(0);

   if (value1->size != value2->size)
      return(0);

   if (*maxlength) {
      comp1 = value1->comp;
      comp2 = value2->comp;
   }
   else {
      comp1 = ((struct __RO_oid_indef *)value1)->comp;
      comp2 = ((struct __RO_oid_indef *)value2)->comp;
   }

   for (i=0; i<value1->size; i++)
      if (comp1[i] != comp2[i])
         return(0);

   return(1);
}


