hpimdm/InterfaceHPIM.py
def _receive(self, raw_bytes, ancdata, src_addr):
        """
        Interface received a new control packet
        """
        if raw_bytes:
            packet = ReceivedPacket(raw_bytes, self)
            if self.is_security_enabled():
                received_security_id = packet.payload.security_id
                if received_security_id != self.security_id:
                    return

                received_security_len = packet.payload.security_length
                if received_security_len != self.security_len:
                    return

                received_security_value = packet.payload.security_value
                received_ip_header = packet.ip_header

                packet.payload.security_value = b''
                calculated_security_value = hmac.new(self.get_security_key(),
                                                     socket.inet_pton(self._get_address_family(), received_ip_header.ip_src) +
                                                     socket.inet_pton(self._get_address_family(), received_ip_header.ip_dst) +
                                                     packet.bytes(), digestmod=self.hash_function).digest()
                if received_security_value != calculated_security_value:
                    return

            self.PKT_FUNCTIONS[packet.payload.get_pim_type()](self, packet)

        Interface received a new control packet
        
Interface received a new control packet
Interface received a new control packet
def _receive(self, raw_bytes, ancdata, src_addr):
        if raw_bytes:
            packet = ReceivedPacket(raw_bytes, self)
            if self.is_security_enabled():
                received_security_id = packet.payload.security_id
                if received_security_id != self.security_id:
                    return
                received_security_len = packet.payload.security_length
                if received_security_len != self.security_len:
                    return
                received_security_value = packet.payload.security_value
                received_ip_header = packet.ip_header
                packet.payload.security_value = b''
                calculated_security_value = hmac.new(self.get_security_key(),
                                                     socket.inet_pton(self._get_address_family(), received_ip_header.ip_src) +
                                                     socket.inet_pton(self._get_address_family(), received_ip_header.ip_dst) +
                                                     packet.bytes(), digestmod=self.hash_function).digest()
                if received_security_value != calculated_security_value:
                    return
            self.PKT_FUNCTIONS[packet.payload.get_pim_type()](self, packet)
def _receive ( self , raw_bytes , ancdata , src_addr ) : if raw_bytes : packet = ReceivedPacket ( raw_bytes , self ) if self . is_security_enabled ( ) : received_security_id = packet . payload . security_id if received_security_id != self . security_id : return received_security_len = packet . payload . security_length if received_security_len != self . security_len : return received_security_value = packet . payload . security_value received_ip_header = packet . ip_header packet . payload . security_value = b'' calculated_security_value = hmac . new ( self . get_security_key ( ) , socket . inet_pton ( self . _get_address_family ( ) , received_ip_header . ip_src ) + socket . inet_pton ( self . _get_address_family ( ) , received_ip_header . ip_dst ) + packet . bytes ( ) , digestmod = self . hash_function ) . digest ( ) if received_security_value != calculated_security_value : return self . PKT_FUNCTIONS [ packet . payload . get_pim_type ( ) ] ( self , packet )
Interface received a new control packet
Interface received a new control packet
"""
        Interface received a new control packet
        """
self
raw_bytes
ancdata
src_addr