t_optmgmt(3xti_ipx)


t_optmgmt -- manage protocol-specific options

Synopsis

#include "ipx_app.h" 

int t_optmgmt( int ipxFd, struct t_optmgmt *req, struct t_optmgmt *ret )

Parameters

(IN) ipxFd
Passes the file descriptor that was returned by t_open.

(IN) req
Passes a pointer to (or the address of) the structure that contains a pointer to an ipxAddr_t structure.

(IN) ret
Passes a pointer to (or the address of) the structure that will be initialized to the local IPX(TM) address.

(OUT) ret
Receives the local IPX address in the ipxAddr_t structure.

Return values

0
Successful

-1
Unsuccessful
Refer to t_optmgmt(3xti) for errors that may occur with this call.

Remarks

The t_optmgmt function enables the user to obtain the local IPX address. (IPX does not support any negotiable options.)

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.


NOTE: The local socket number is valid only if this local endpoint has already been bound.

Examples

   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"); ... }

State

The state follows the state diagram in ``State transitions''.

References

t_open(3xti_ipx), t_optmgmt(3xti)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.