Skip to content

Commit

Permalink
Matched prefix's length available through match_number function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-datcu committed Sep 9, 2014
1 parent aa1fdf1 commit 5e87d43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/drouting/dr_api.h
Expand Up @@ -39,7 +39,7 @@ typedef struct _dr_head_t {
} dr_head_t, *dr_head_p; /*Easier to spot outside dr */

typedef rt_info_t* (*match_number_f) (dr_head_p partition, unsigned int gr_id,
const str *number);
const str *number, unsigned int *matched_len);

typedef dr_head_p (*create_head_f) (void);
typedef void (*free_head_f)(dr_head_p partition);
Expand Down
10 changes: 5 additions & 5 deletions modules/drouting/dr_api_internal.c
Expand Up @@ -31,8 +31,8 @@

#include "../../str.h"

static rt_info_t* match_number (dr_head_t *partition, unsigned int grp_id,
const str *number);
static rt_info_t *match_number (dr_head_p partition, unsigned int grp_id,
const str *number, unsigned int *matched_len);
static dr_head_p create_dr_head(void);
static void free_dr_head(dr_head_p partition);
static int add_rule_api(dr_head_p partition, unsigned int rid,
Expand Down Expand Up @@ -72,12 +72,12 @@ int load_dr (struct dr_binds *drb)
}

/* Function which will try to match a number and return the rule id */
static rt_info_t *match_number (dr_head_p partition, unsigned int grp_id, const str *number)
static rt_info_t *match_number (dr_head_p partition, unsigned int grp_id,
const str *number, unsigned int *matched_len)
{
unsigned int matched_len;

return find_rule_by_prefix_unsafe(partition->pt, &(partition->noprefix),
*number, grp_id, &matched_len);
*number, grp_id, matched_len);
}

static dr_head_p create_dr_head(void)
Expand Down

0 comments on commit 5e87d43

Please sign in to comment.