SetUserBytes:
PROC [b: Buffer, bodyBytes:
CARDINAL, optionsBytes:
CARDINAL ← 0];
Set the length of the datagram (fragment) body and options. The fixed part of the IP header isn't counted in bodyBytes, but the UDP or TCP header is.
Options may only be present in the first fragment of a chain.
SetNoFragmentation:
PROC [b: Buffers, inhibitFragmentation:
BOOL ←
TRUE];
Is it okay to fragment this packet in transmission?
SetUserBytes[b] implicitly does SetNoFragmentation[b, FALSE]; so to inhibit fragmentation you must call SetNoFragmentation[b] after calling SetUserBytes[b].
Send:
PROC [h: Handle, b: Buffers, dest: Arpa.Address, setChecksum: ChecksumProc ←
NIL, hint: RouteHint ←
NIL]
RETURNS [newHint: RouteHint];
Send chain of buffers. The length field must be correct in each fragment in the chain (set by SetUserBytes), and the options length must be 0 in all but the first fragment. Fragmentation control fields will be filled in automatically, and options from the first fragment will be copied to the remaining ones as appropriate.
If the destination address is Arpa.broadcastAddress, the datagram will be broadcast on all network interfaces.
The ChecksumProc is passed in by the client to compute a higher-level protocol checksum field. It is called once, after the datagram has been routed, so the IP header source address has been filled in properly before the checksum is computed. This ugly mechanism is necessary because of the "pseudo-header" in UPD and TCP checksums.
The hint / newHint is a performance hack for cacheing of routes. If you pass NIL (the default) it will recompute the route for each send, and return NIL. If you pass nullRouteHint, if will recompute the route and return a RouteHint that can be passed in on subsequent calls to avoid the overhead of the routing computation. Use this only if you're really worried about performance.
On return, the content of buffers is unmodified. Buffers aren't freed.
! Error[$nullDestination | $destUnreachable | $datagramTooLong | $clientFragmentationError]