def init_send(self):
        """
        Generates the first (IKE_INIT) packet for Initiator

        :return: bytes() containing a valid IKE_INIT packet
        """
        packet = Packet()
        self.packets.append(packet)
        packet.add_payload(payloads.SA())
        packet.add_payload(payloads.KE(diffie_hellman=self.diffie_hellman))
        packet.add_payload(payloads.Nonce(nonce=self.Ni))
        packet.iSPI = self.iSPI = packet.payloads[0].spi
        self.state = State.INIT
        return bytes(packet)
def init_send ( self ) : packet = Packet ( ) self . packets . append ( packet ) packet . add_payload ( payloads . SA ( ) ) packet . add_payload ( payloads . KE ( diffie_hellman = self . diffie_hellman ) ) packet . add_payload ( payloads . Nonce ( nonce = self . Ni ) ) packet . iSPI = self . iSPI = packet . payloads [ 0 ] . spi self . state = State . INIT return bytes ( packet )
Generates the first (IKE_INIT) packet for Initiator

        :return: bytes() containing a valid IKE_INIT packet