#include "ipx_app.h"int t_optmgmt( int ipxFd, struct t_optmgmt *req, struct t_optmgmt *ret )
This call is supported as documented in t_optmgmt(3xti) and ``Programming with the X/Open Transport Interface (XTI)'' except that it returns the local address instead of negotiating options.
The t_optmgmt structure has the following format:
struct t_optmgmt { struct netbuf opt; long flags; };IPX does not use the flags field. It should be set to zero.
The netbuf structure has the following format:
struct netbuf { unsigned int maxlen; unsigned int len; char *buf; };The
len
and maxlen
fields must be initialized to the size of an ipxAddr_t structure. The buf field returns all the local information about this transport endpoint: source network address, source node address, and source socket number.
The req.buf
and ret.buf
fields must point to a structure large enough to hold an ipxAddr_t (12 bytes). Upon successful completion, ret.buf
contains the source information.
The first four bytes are the local network address; the next six bytes, the node address; and the last two bytes, the local socket number. All these address numbers are in hi-lo byte order.
struct t_optmgmt optionsRequest; ipxAddr_t localIpxAddress;optionsRequest.opt.maxlen = sizeof(ipxAddr_t); optionsRequest.opt.len = sizeof(ipxAddr_t); optionsRequest.opt.buf = (char *)&localIpxAddress;
/* flags are not used with the IPX options request */
optionsRequest.flags = 0;
/* ipxFd is the file descriptor of an opened IPX device */
if( t_optmgmt( ipxFd, &optionsRequest, &optionsRequest )<0) { t_error( "t_optmgmt failed"); ... }