Returns information about the current status of an X.25 port.
X.25 Communications Library (libx25s.a)
int x25_link_query(link_name) struct cb_link_name_struct *link_name;
The x25_link_query subroutine returns the status of the X.25 port as an integer.
| link_name | Contains a pointer to the cb_link_name_struct structure, which gives the name of the X.25 port. |
If successful, the x25_link_query subroutine returns an integer that indicates a status of X25_LINK_CONNECTED, X25_LINK_DISCONNECTED, or X25_LINK_CONNECTING. If an error occurs, the x25_link_query subroutine returns a value of -1 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:
If the x25_errno global variable is set to the X25SYSERR value, the errno global variable is set to one of the following values:
To find out whether port x25s1 is connected, disconnected, or connecting, use this code sample:
struct cb_link_name_struct link_name; link_name.flags = X25FLG_LINK_NAME; link_name.link_name = "x25s1"; rc = x25_link_query(&link_name); switch (rc)
{
case X25_LINK_CONNECTED:
(void)printf("Link is connected\n");
break;
case X25_LINK_DISCONNECTED:
(void)printf("Link is disconnected\n");
break;
case X25_LINK_CONNECTING:
(void)printf("Link is connecting\n");
break;
case -1;
switch (x25_errno);
{
case X25SYSERR:
(void)printf("System error : errno = %d\n",errno);
perror();
break;
case X25NOCARD:
(void)printf("The X.25 adapter is either not\n");
(void)printf("installed or not functioning:");
(void)printf("Call your system administrator.\n");
break;
case X25NOTINIT:
(void)printf("The application has not initialized\n",
(void)printf("X.25 communications:");
(void)printf("Call your system administrator.\n");
break;
}
break;
}
This subroutine is part of X.25 Application in Base Operating System (BOS) Extensions 2.
The x25_circuit_query subroutine, x25_device_query subroutine.
Processing Calls with the X.25 API, Using the X.25 Structures and Flags, in AIX Version 4.3 Communications Programming Concepts.