This procedure shown in this example sends IP datagrams
of the given protocol number. The entire packet, including the IP
header, must be in the buffer. The TCP/IP address space uses the total
length field of the IP header to determine where each packet ends.
Subsequent packets begin at the next doubleword (eight-byte) boundary
within the buffer.
The packets in your buffer are transmitted unchanged with
the following exceptions:
- They can be fragmented; the fragment offset and flag fields in
the header are filled.
- The version field in the header is filled.
- The checksum field in the header is filled.
- The source address field in the header is filled.
You get the return code NOsuchCONNECTION if the client
is not handling the protocol, or if a packet in the buffer has another
protocol. The return code BADlengthARGUMENT is received when:
- The DataLength is fewer than 40 bytes, or greater than 65535 bytes.
- NumPackets is 0.
- All packets do not fit into DataLength.
A ReturnCode value of NObufferSPACE indicates that the
data is rejected, because TCP/IP is out of buffers. When buffer space
is available, the notification RAWIPspaceAVAILABLE is sent to the
client.
Figure 1. RawIpSend example procedure RawIpSend
(
ProtocolNo: integer;
Buffer: Address31Type;
DataLength: integer;
NumPackets: integers;
var ReturnCode: integer
);
external;
- Parameter
- Description
- ProtocolNo
- The number of the Internet protocol.
- Buffer
- The address of your buffer containing
packets to send.
- DataLength
- The total length of data in your buffer.
- NumPackets
- The number of packets in your buffer.
- ReturnCode
- Indicates the success or failure
of a call. Possible return values are:
- OK
- BADlengthARGUMENT
- NObufferSPACE
- NOsuchCONNECTION
- NOTyetBEGUN
- SOFTWAREerror
- TCPipSHUTDOWN
- UNAUTHORIZEDuser
- INVALIDvirtualADDRESS
Note: If your buffer contains multiple packets waiting to
be sent, some of the packets might have been sent even if ReturnCode
is not OK.
For a description of Pascal return codes, see Table 1.