|
@@ -64,7 +64,7 @@ static int compare_macs (const uint8_t *mac1, const uint8_t *mac2)
|
|
|
#include <structure/SAvl_impl.h>
|
|
#include <structure/SAvl_impl.h>
|
|
|
|
|
|
|
|
#include "FrameDecider_multicast_tree.h"
|
|
#include "FrameDecider_multicast_tree.h"
|
|
|
-#include <structure/CAvl_impl.h>
|
|
|
|
|
|
|
+#include <structure/SAvl_impl.h>
|
|
|
|
|
|
|
|
static void add_mac_to_peer (FrameDeciderPeer *o, uint8_t *mac)
|
|
static void add_mac_to_peer (FrameDeciderPeer *o, uint8_t *mac)
|
|
|
{
|
|
{
|
|
@@ -135,10 +135,9 @@ static void add_to_multicast (FrameDecider *d, struct _FrameDecider_group_entry
|
|
|
// compute sig
|
|
// compute sig
|
|
|
uint32_t sig = compute_sig_for_group(group_entry->group);
|
|
uint32_t sig = compute_sig_for_group(group_entry->group);
|
|
|
|
|
|
|
|
- FDMulticastTreeRef ref = FDMulticastTree_LookupExact(&d->multicast_tree, 0, sig);
|
|
|
|
|
- if (FDMulticastTreeIsValidRef(ref)) {
|
|
|
|
|
|
|
+ struct _FrameDecider_group_entry *master = FDMulticastTree_LookupExact(&d->multicast_tree, 0, sig);
|
|
|
|
|
+ if (master) {
|
|
|
// use existing master
|
|
// use existing master
|
|
|
- struct _FrameDecider_group_entry *master = ref.ptr;
|
|
|
|
|
ASSERT(master->is_master)
|
|
ASSERT(master->is_master)
|
|
|
|
|
|
|
|
// set not master
|
|
// set not master
|
|
@@ -156,7 +155,7 @@ static void add_to_multicast (FrameDecider *d, struct _FrameDecider_group_entry
|
|
|
group_entry->master.sig = sig;
|
|
group_entry->master.sig = sig;
|
|
|
|
|
|
|
|
// insert to multicast tree
|
|
// insert to multicast tree
|
|
|
- int res = FDMulticastTree_Insert(&d->multicast_tree, 0, FDMulticastTreeDeref(0, group_entry), NULL);
|
|
|
|
|
|
|
+ int res = FDMulticastTree_Insert(&d->multicast_tree, 0, group_entry, NULL);
|
|
|
ASSERT(res)
|
|
ASSERT(res)
|
|
|
|
|
|
|
|
// init list node
|
|
// init list node
|
|
@@ -171,7 +170,7 @@ static void remove_from_multicast (FrameDecider *d, struct _FrameDecider_group_e
|
|
|
|
|
|
|
|
if (group_entry->is_master) {
|
|
if (group_entry->is_master) {
|
|
|
// remove master from multicast tree
|
|
// remove master from multicast tree
|
|
|
- FDMulticastTree_Remove(&d->multicast_tree, 0, FDMulticastTreeDeref(0, group_entry));
|
|
|
|
|
|
|
+ FDMulticastTree_Remove(&d->multicast_tree, 0, group_entry);
|
|
|
|
|
|
|
|
if (!LinkedList3Node_IsLonely(&group_entry->sig_list_node)) {
|
|
if (!LinkedList3Node_IsLonely(&group_entry->sig_list_node)) {
|
|
|
// at least one more group entry for this sig; make another entry the master
|
|
// at least one more group entry for this sig; make another entry the master
|
|
@@ -188,7 +187,7 @@ static void remove_from_multicast (FrameDecider *d, struct _FrameDecider_group_e
|
|
|
newmaster->master.sig = sig;
|
|
newmaster->master.sig = sig;
|
|
|
|
|
|
|
|
// insert to multicast tree
|
|
// insert to multicast tree
|
|
|
- int res = FDMulticastTree_Insert(&d->multicast_tree, 0, FDMulticastTreeDeref(0, newmaster), NULL);
|
|
|
|
|
|
|
+ int res = FDMulticastTree_Insert(&d->multicast_tree, 0, newmaster, NULL);
|
|
|
ASSERT(res)
|
|
ASSERT(res)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -287,11 +286,10 @@ static void lower_group_timers_to_lmqt (FrameDecider *d, uint32_t group)
|
|
|
uint32_t sig = compute_sig_for_group(group);
|
|
uint32_t sig = compute_sig_for_group(group);
|
|
|
|
|
|
|
|
// look up the sig in multicast tree
|
|
// look up the sig in multicast tree
|
|
|
- FDMulticastTreeRef ref = FDMulticastTree_LookupExact(&d->multicast_tree, 0, sig);
|
|
|
|
|
- if (FDMulticastTreeIsNullRef(ref)) {
|
|
|
|
|
|
|
+ struct _FrameDecider_group_entry *master = FDMulticastTree_LookupExact(&d->multicast_tree, 0, sig);
|
|
|
|
|
+ if (!master) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- struct _FrameDecider_group_entry *master = ref.ptr;
|
|
|
|
|
ASSERT(master->is_master)
|
|
ASSERT(master->is_master)
|
|
|
|
|
|
|
|
// iterate all group entries with this sig
|
|
// iterate all group entries with this sig
|
|
@@ -479,9 +477,8 @@ out:;
|
|
|
uint32_t sig = compute_sig_for_mac(eh->dest);
|
|
uint32_t sig = compute_sig_for_mac(eh->dest);
|
|
|
|
|
|
|
|
// look up the sig in multicast tree
|
|
// look up the sig in multicast tree
|
|
|
- FDMulticastTreeRef ref = FDMulticastTree_LookupExact(&o->multicast_tree, 0, sig);
|
|
|
|
|
- if (FDMulticastTreeIsValidRef(ref)) {
|
|
|
|
|
- struct _FrameDecider_group_entry *master = ref.ptr;
|
|
|
|
|
|
|
+ struct _FrameDecider_group_entry *master = FDMulticastTree_LookupExact(&o->multicast_tree, 0, sig);
|
|
|
|
|
+ if (master) {
|
|
|
ASSERT(master->is_master)
|
|
ASSERT(master->is_master)
|
|
|
|
|
|
|
|
o->decide_state = DECIDE_STATE_MULTICAST;
|
|
o->decide_state = DECIDE_STATE_MULTICAST;
|