BsServiceFlow* Mac802_16::CreateBsServiceFlow_link(int NodeID)
{
BsServiceFlow_link *tmp = new BsServiceFlow_link;
BsServiceFlow *tmp2 = new BsServiceFlow;
tmp->NodeID = NodeID;
if(!BsSF_link_head) {
tmp->BsSF_head = tmp->BsSF_tail = tmp2;
tmp2->next = NULL;
BsSF_link_head = BsSF_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
BsServiceFlow_link *pt = BsSF_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->BsSF_tail->next = tmp2;
pt->BsSF_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->BsSF_head = tmp->BsSF_tail = tmp2;
tmp2->next = NULL;
BsSF_link_tail->next = tmp;
BsSF_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}
沒有留言:
張貼留言