[ Previous | Next | Contents | Search ]
AIXLink/X.25 1.1 for AIX: Guide and Reference

x25_link_query Subroutine


Returns information about the current status of an X.25 port.


X.25 Communications Library (libx25s.a)

C Syntax

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.

Return Values

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.

Error Codes

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)
    (void)printf("Link is connected\n");
    (void)printf("Link is disconnected\n");
    (void)printf("Link is connecting\n");
    case -1;
      switch (x25_errno);
        case X25SYSERR:
          (void)printf("System error : errno = %d\n",errno);
        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");
        case X25NOTINIT:
          (void)printf("The application has not initialized\n",
          (void)printf("X.25 communications:");
          (void)printf("Call your system administrator.\n");

Implementation Specifics

This subroutine is part of X.25 Application in Base Operating System (BOS) Extensions 2.

Related Information

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.

[ Previous | Next | Contents | Search ]