/* dissect_packetid is a utility function which calculates the packets Packet ID from the data. Packet ID is a field located in the datagram header. */
static guint32 dissect_packetid(tvbuff_t *buffer, int offset, proto_tree *tree)
/* dissect_packetid is a utility function which calculates the packets Packet ID from the data. Packet ID is a field located in the datagram header. */
static guint32 dissect_packetid(tvbuff_t *buffer, int offset, proto_tree *tree)
{
    guint32 packetid;
    packetid  = tvb_get_guint8(buffer, offset+2) << 14;
    packetid += tvb_get_guint8(buffer, offset+1) << 6;
    packetid += tvb_get_guint8(buffer, offset) & 63;
    proto_tree_add_uint(tree, hf_knet_packetid, buffer, 0, 3, packetid);
    return packetid;
}