Skip to content

Commit

Permalink
Added pset_get_active to get the active status of a pset node.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadfisher committed Aug 12, 2010
1 parent 2ab1e22 commit f39b700
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions vrr_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,26 @@ int pset_lookup_mac(mac_addr mac, u32 *node)
return ret;
}

int pset_get_active(u32 node)
{
pset_list_t *tmp;
struct list_head *pos;
unsigned long flags;
int ret = 0;

spin_lock_irqsave(&vrr_pset_lock, flags);
list_for_each(pos, &pset.list) {
tmp = list_entry(pos, pset_list_t, list);
if (tmp->node == node) {
ret = tmp->active;
goto out;
}
}
out:
spin_unlock_irqrestore(&vrr_pset_lock, flags);
return ret;
}

int pset_get_mac(u_int node, mac_addr mac)
{
pset_list_t * tmp;
Expand Down
1 change: 1 addition & 0 deletions vrr_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ int pset_remove(u_int node);
u_int pset_get_status(u_int node);
int pset_lookup_mac(mac_addr mac, u32 *node);
int pset_get_mac(u_int node, mac_addr mac);
int pset_get_status(u32 node);
int pset_update_status(u_int node, u_int new_status, u_int active);
int pset_inc_fail_count(struct pset_list *node);
int pset_reset_fail_count(u_int node);
Expand Down

0 comments on commit f39b700

Please sign in to comment.