[Date Prev][Date Next] [Chronological] [Thread] [Top]

Support for ordering matching rules in extensible match filters?



Hi,

why doesn't slapd support ordering matching rules in extensible match filters?

Does the small code enhancement for slapd's generalizedTimeOrderingMatch() would make sense into the direction to support ordering matching in extensible filters (in this particular case)?

Thanks a lot!

Cheers
Daniel



static int
generalizedTimeOrderingMatch(
   int *matchp,
   slap_mask_t flags,
   Syntax *syntax,
   MatchingRule *mr,
   struct berval *value,
   void *assertedValue )
{
   struct berval *asserted = (struct berval *) assertedValue;
   ber_len_t v_len  = value->bv_len;
   ber_len_t av_len = asserted->bv_len;

   /* ignore trailing 'Z' when comparing */
   int match = memcmp( value->bv_val, asserted->bv_val,
       (v_len < av_len ? v_len : av_len) - 1 );

   Debug( LDAP_DEBUG_TRACE, "gTOM1: %s %s %d\n",
       value->bv_val, asserted->bv_val, match);

   if ( flags & SLAP_MR_EXT ) {
       Debug( LDAP_DEBUG_TRACE,
           "gTOM: MR => SLAP_MR_EXT (%ld) [%d %d]\n", flags, 0, 0);
       if ( match == -1 ) match = 0;
       else if ( match == 0 ) match = 1;
   } else {
       Debug( LDAP_DEBUG_TRACE,
           "gTOM: MR => ? (%ld) [%d %d]\n", flags, 0, 0);
       if ( match == 0 ) match = v_len - av_len;
   }

   Debug( LDAP_DEBUG_TRACE, "gTOM2: %s %s %d\n",
       value->bv_val, asserted->bv_val, match);

   *matchp = match;
   return LDAP_SUCCESS;
}