The TNetbuf Structure
You use aTNetbufstructure to specify the location and size of a buffer that contains an address, option information, or user data. Provider functions useTNetbufstructures both as input parameters and output parameters. If you are using aTNetbufstructure as an input parameter, you use it to specify the location and size of a buffer containing information you want to send. If you are using aTNetbufstructure as an output parameter, you use it to specify the location and the maximum size of the buffer used to hold information when the function returns.The
TNetbufstructure is defined by theTNetbufdata type.
struct TNetbuf { UInt32 maxlen; UInt32 len; UInt8* buf; };
Field Description
maxlen- The size (in bytes) of the buffer to which the
buffield points. You must set themaxlenfield before passing aTNetbufstructure to a provider function as an output parameter. Open Transport ignores this field if you pass theTNetbufstructure as an input parameter.len- The actual length (in bytes) of the information in the buffer to which the
buffield points. If you are using theTNetbufstructure as an input parameter, you must set this field.- If you pass the
TNetbufstructure as an output parameter, on return, the provider function sets this field to the number of bytes the function has actually placed in the buffer referenced by thebuffield.buf- A pointer to a buffer. You must make sure that the
buffield points to a valid buffer and that the buffer is large enough to store the information for which it is intended.