Attribution of correct type depending on version and pdu_type

def dispatch_hook(cls, _pkt=None, *args, **kargs):
        '''
          Attribution of correct type depending on version and pdu_type
        '''
        if _pkt and len(_pkt) >= 2:
            version = orb(_pkt[0])
            pdu_type = orb(_pkt[1])
            if version == 0:
                return PDU_CLASS_VERSION_0[pdu_type]
            elif version == 1:
                return PDU_CLASS_VERSION_1[pdu_type]
        return Raw