def _frame_structure_check(structure_description):
        """
        check if the structure of the frame is conform to the basic
        frame structure defined by the standard
        :param structure_description: string-list reflecting LLDP-msg structure
        """

        standard_frame_structure = [LLDPDUChassisID.__name__,
                                    LLDPDUPortID.__name__,
                                    LLDPDUTimeToLive.__name__,
                                    '<...>',
                                    LLDPDUEndOfLLDPDU.__name__]

        if len(structure_description) < 4:
            raise LLDPInvalidFrameStructure(
                'Invalid frame structure.\ngot: {}\nexpected: '
                '{}'.format(' '.join(structure_description),
                            ' '.join(standard_frame_structure)))

        for idx, layer_name in enumerate(standard_frame_structure):

            if layer_name == '<...>':
                break
            if layer_name != structure_description[idx]:
                raise LLDPInvalidFrameStructure(
                    'Invalid frame structure.\ngot: {}\nexpected: '
                    '{}'.format(' '.join(structure_description),
                                ' '.join(standard_frame_structure)))

        if structure_description[-1] != standard_frame_structure[-1]:
            raise LLDPInvalidFrameStructure(
                'Invalid frame structure.\ngot: {}\nexpected: '
                '{}'.format(' '.join(structure_description),
                            ' '.join(standard_frame_structure)))
def _frame_structure_check ( structure_description ) : standard_frame_structure = [ LLDPDUChassisID . __name__ , LLDPDUPortID . __name__ , LLDPDUTimeToLive . __name__ , '<...>' , LLDPDUEndOfLLDPDU . __name__ ] if len ( structure_description ) < 4 : raise LLDPInvalidFrameStructure ( 'Invalid frame structure.\ngot: {}\nexpected: ' '{}' . format ( ' ' . join ( structure_description ) , ' ' . join ( standard_frame_structure ) ) ) for idx , layer_name in enumerate ( standard_frame_structure ) : if layer_name == '<...>' : break if layer_name != structure_description [ idx ] : raise LLDPInvalidFrameStructure ( 'Invalid frame structure.\ngot: {}\nexpected: ' '{}' . format ( ' ' . join ( structure_description ) , ' ' . join ( standard_frame_structure ) ) ) if structure_description [ - 1 ] != standard_frame_structure [ - 1 ] : raise LLDPInvalidFrameStructure ( 'Invalid frame structure.\ngot: {}\nexpected: ' '{}' . format ( ' ' . join ( structure_description ) , ' ' . join ( standard_frame_structure ) ) )
check if the structure of the frame is conform to the basic
        frame structure defined by the standard
        :param structure_description: string-list reflecting LLDP-msg structure