15#include "IEEE802_11.h"
16#include "IEEE802_11_Phy.h"
18int fn_NetSim_802_11_MeshBSS_Init(NETSIM_ID nDeviceId,NETSIM_ID nInterfaceId)
20 int nConnectedDeviceCount;
21 NETSIM_ID nDevId, nIntefId;
22 PIEEE802_11_MAC_VAR mac=IEEE802_11_MAC(nDeviceId,nInterfaceId);
23 PIEEE802_11_PHY_VAR phy=IEEE802_11_PHY(nDeviceId,nInterfaceId);
26 NetSim_LINKS* pstruLink;
27 pstruLink = DEVICE_PHYLAYER(nDeviceId,nInterfaceId)->pstruNetSimLinks;
28 nDevId=pstruLink->puniDevList.pstruMP2MP.anDevIds[0];
29 nIntefId=pstruLink->puniDevList.pstruMP2MP.anDevInterfaceIds[0];
31 nConnectedDeviceCount = pstruLink->puniDevList.pstruMP2MP.nConnectedDeviceCount;
34 mac->BSSId= DEVICE_HWADDRESS(nDevId,nIntefId);
36 mac->nAPInterfaceId= nIntefId;
37 mac->devIdsinBSS=(NETSIM_ID*)calloc(nConnectedDeviceCount,
sizeof* mac->devIdsinBSS);
38 mac->devIfinBSS=(NETSIM_ID*)calloc(nConnectedDeviceCount,
sizeof* mac->devIfinBSS);
39 mac->devIdsinBSS[0]=nDevId;
40 mac->devIfinBSS[0]=nIntefId;
41 memcpy(mac->devIdsinBSS,pstruLink->puniDevList.pstruMP2MP.anDevIds,
42 nConnectedDeviceCount*
sizeof(NETSIM_ID));
43 memcpy(mac->devIfinBSS,pstruLink->puniDevList.pstruMP2MP.anDevInterfaceIds,
44 nConnectedDeviceCount*
sizeof(NETSIM_ID));
48void fn_NetSim_802_11_MeshBSS_UpdateReceiver(NetSim_PACKET* packet)
50 if (isBroadcastPacket(packet))
52 if (isMulticastPacket(packet))
54 if(packet->nReceiverId)
58 packet->nReceiverId = fn_NetSim_Stack_GetDeviceId_asIP(packet->pstruNetworkData->szNextHopIp,
62bool isPacketforsameMeshBSS(PIEEE802_11_MAC_VAR mac,NetSim_PACKET* packet)