def send(self, packet, recalculate_checksum=True):
if recalculate_checksum:<EOL><INDENT>packet.recalculate_checksums()<EOL><DEDENT>send_len = c_uint(<NUM_LIT:0>)<EOL>if PY2:<EOL><INDENT>buff = bytearray(packet.raw)<EOL><DEDENT>else:<EOL><INDENT>buff = packet.raw<EOL><DEDENT>buff = (c_char * len(packet.raw)).from_buffer(buff)<EOL>windivert_dll.WinDivertSend(self._handle, buff, len(packet.raw), byref(packet.wd_addr),<EOL>byref(send_len))<EOL>return send_len<EOL>
Injects a packet into the network stack.
Recalculates the checksum before sending unless recalculate_checksum=False is passed.

The injected packet may be one received from recv(), or a modified version, or a completely new packet.
Injected packets can be captured and diverted again by other WinDivert handles with lower priorities.

The remapped function is WinDivertSend::

    BOOL WinDivertSend(
        __in HANDLE handle,
        __in PVOID pPacket,
        __in UINT packetLen,
        __in PWINDIVERT_ADDRESS pAddr,
        __out_opt UINT *sendLen
    );

For more info on the C call visit: http://reqrypt.org/windivert-doc.html#divert_send

:return: The return value is the number of bytes actually sent.