if(packet instanceof DataToBase){
DataToBase dataToBase = (DataToBase) packet;
// verify hmac? (now it doesn't have hmac)
onDataToBase(dataToBase);
} else if(packet instanceof BeaconChildResponse){
BeaconChildResponse beaconChildResponse = (BeaconChildResponse) packet;
System.out.println("ricevuto BeaconChildResponse childNonce:"+beaconChildResponse.getChildNonce());
// TODO verify hmac with different tree baseNonces
beaconChildResponse.verifyHmac(newTree.baseNonce, srcMacAddress);
onBeaconChildResponse(beaconChildResponse, srcInterface, srcMacAddress);
} else if(packet instanceof BeaconParentResponse){
BeaconParentResponse beaconParentResponse = (BeaconParentResponse) packet;
System.out.println("ricevuto BeaconParentResponse parentNonce:"+beaconParentResponse.getParentNonce()+" childNonce:"+beaconParentResponse.getChildNonce());
// TODO verify hmac