#1471 Handling of unknown Hytera packet messages. (#1483)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2023-03-11 06:04:06 -05:00
committed by GitHub
parent ba7b616f88
commit d69ad46c10
3 changed files with 84 additions and 1 deletions

View File

@@ -75,6 +75,7 @@ import io.github.dsheirer.module.decode.dmr.message.voice.VoiceMessage;
import io.github.dsheirer.module.decode.event.DecodeEvent;
import io.github.dsheirer.module.decode.event.DecodeEventType;
import io.github.dsheirer.module.decode.event.PlottableDecodeEvent;
import io.github.dsheirer.module.decode.ip.hytera.sds.HyteraUnknownPacket;
import io.github.dsheirer.module.decode.ip.hytera.sms.HyteraSmsPacket;
import io.github.dsheirer.protocol.Protocol;
import io.github.dsheirer.source.tuner.channel.rotation.AddChannelRotationActiveStateRequest;
@@ -318,6 +319,19 @@ public class DMRDecoderState extends TimeslotDecoderState
.build();
broadcast(smsEvent);
}
//Unknown Hytera Long Data Service Token Message
else if(packet.getPacket() instanceof HyteraUnknownPacket hyteraUnknownPacket)
{
MutableIdentifierCollection mic = new MutableIdentifierCollection(packet.getIdentifiers());
DecodeEvent unknownTokenEvent = DMRDecodeEvent.builder(packet.getTimestamp())
.eventDescription(DecodeEventType.UNKNOWN_PACKET.name())
.identifiers(mic)
.timeslot(packet.getTimeslot())
.details("HYTERA UNK TOKEN MSG:" + hyteraUnknownPacket.getHeader().toString())
.build();
broadcast(unknownTokenEvent);
}
else
{
DecodeEvent packetEvent = DMRDecodeEvent.builder(packet.getTimestamp())

View File

@@ -32,6 +32,7 @@ import io.github.dsheirer.module.decode.dmr.message.data.header.motorola.MNISPro
import io.github.dsheirer.module.decode.dmr.message.type.ApplicationType;
import io.github.dsheirer.module.decode.ip.UnknownPacket;
import io.github.dsheirer.module.decode.ip.hytera.sds.HyteraTokenHeader;
import io.github.dsheirer.module.decode.ip.hytera.sds.HyteraUnknownPacket;
import io.github.dsheirer.module.decode.ip.hytera.sms.HyteraSmsPacket;
import io.github.dsheirer.module.decode.ip.ipv4.IPV4Header;
import io.github.dsheirer.module.decode.ip.ipv4.IPV4Packet;
@@ -175,7 +176,7 @@ public class PacketSequenceMessageFactory
}
else
{
return new DMRPacketMessage(packetSequence, new UnknownPacket(packet, 0), packet,
return new DMRPacketMessage(packetSequence, new HyteraUnknownPacket(hyteraTokenHeader), packet,
packetSequence.getTimeslot(), packetSequence.getPacketSequenceHeader().getTimestamp());
}
}

View File

@@ -0,0 +1,68 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.ip.hytera.sds;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.ip.IPacket;
import java.util.Collections;
import java.util.List;
/**
* Hytera SDS Long Data Message with unknown encoded payload
*/
public class HyteraUnknownPacket implements IPacket
{
private HyteraTokenHeader mHeader;
/**
* Constructs a parser for a header contained within a binary message starting at the offset.
*
* @param header to the packet within the message
*/
public HyteraUnknownPacket(HyteraTokenHeader header)
{
mHeader = header;
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("HYTERA UNKNOWN LONG DATA SERVICE TOKEN MESSAGE:").append(getHeader().toString());
return sb.toString();
}
@Override
public HyteraTokenHeader getHeader()
{
return mHeader;
}
@Override
public IPacket getPayload() {return null;}
@Override
public boolean hasPayload() {return false;}
@Override
public List<Identifier> getIdentifiers()
{
return Collections.emptyList();
}
}