Returns configuration information about a device.
X.25 Communications Library (libx25s.a)
struct cb_dev_info_struct *x25_device_query(link_name) struct cb_link_name_struct *link_name;
The x25_device_query subroutine returns information about the X.25 adapter in the cb_dev_info_struct structure.
The information entered when the adapter was configured is returned. Changes made to a particular switched virtual circuit (SVC) by requests entered in the facilities fields of X.25 API structures are not reflected by this subroutine; these values can be obtained using the x25_circuit_query subroutine.
link_name | Specifies a pointer to the cb_link_name_struct structure, which gives the name of the X.25 port. |
If successful, the x25_device_query subroutine returns a pointer to cb_dev_info_struct, structure containing the information. The storage for this structure is allocated by the API; it is the responsibility of the application to free it. If an error occurs, the x25_device_query subroutine returns a null value and sets the x25_errno global variable to one of the error codes shown below.
On failure, the x25_errno global variable is set to one of the following values:
If the x25_errno global variable is set to the X25SYSERR value, the errno global variable is set to ENOMEM.
The following code sample prints out the number of PVCs and the default and maximum packet sizes for an X.25 port:
struct cb_dev_info_struct *dev_ptr; dev_ptr = x25_device_query(&link_name); if (dev_ptr == NULL) (void)printf("Error %d from x25_device_query.",x25_errno); else { if (dev_ptr -> flags & X25FLG_NUA) { (void)printf("NUA : %s\n",dev_ptr -> nua); free(dev_ptr -> nua); } if (dev_ptr -> flags & X25FLG_NO_OF_VCS) (void)printf("Number of PVCs : %d\n",dev_ptr -> no_of_vcs); if (dev_ptr -> flags & X25FLG_MAX_RX_PACKET_SIZE) (void)printf("Max receive pkt size : %d\n", dev_ptr -> max_rx_packet_size); if (dev_ptr -> flags & X25FLG_MAX_TX_PACKET_SIZE) (void)printf("Max transmit pkt size : %d\n", dev-ptr -> max_tx_packet_size); if (dev_ptr -> flags & X25FLG_DEFAULT_SVC_RX_PACKET_SIZE) (void)printf("Default receive pkt size : %d\n", dev_ptr -> default_svc_rx_packet_size); if (dev_ptr -> flags & X25FLG_DEFAULT_SVC_TX_PACKET_SIZE) (void)printf("Default transmit pkt size : %d\n", dev_ptr -> default_svc_tx_packet_size); free(dev_ptr); }
This subroutine is part of X.25 Application in Base Operating System (BOS) Extensions 2.
The x25_circuit_query subroutine, x25_link_query subroutine.
Processing Calls with the X.25 API, Using the X.25 Structures and Flags, in AIX Version 4.3 Communications Programming Concepts.