@staticmethod
def _get_opcode_value_from_flags(flags: int) ->int:
    """
        Retrieve the opcode value from flags.

        :param flags: an integer representing the flags of a dns message
        :return: value of the opcode field as int
        """
    return (flags & int.from_bytes(b'\x00\x00x\x00', 'big')) >> 11
