QUERY_DIRECTORY_ENTRY

QUERY_DIRECTORY_ENTRY returns a list of LUs from the directory database. The information is returned as a list in one of two formats, either summary or detailed information. To obtain information about a specific LU, or to obtain the list information in several chunks, the resource_name and resource_type fields should be set. Otherwise (if the list_options field is set to AP_FIRST_IN_LIST), this field will be ignored. See Querying the Node for background on how the list formats are used.

When the local node is a network node, information is returned as follows:

1st Network Node
                        1st LU located at Network Node
                        2nd LU locate at Network Node
                        ...
                        nth LU located at Network Node
           1st End Node served by this Network Node
                        1st LU located at End Node(1)
                        2nd LU located at End Node(1)
                        ...
                        nth LU located at End Node(1)
            ...
            nth End Node served by this Network Node
                        1st LU located at End Node(n)
                        2nd LU located at End Node(n)
                        ...
2nd Network Node
           ...etc..    

When the Program is operating as an End Node the first entry returned in the first entry returned in the resource list is the EN CP. (No entry is returned for the End Node's Network Node server.)

This list of directory entries returned may be filtered by the parent name (and type). In this case, both the parent_name and parent_type fields should be set (otherwise these fields should be set to all zeros). Ordering is by name length first, and then by ASCII lexicographical ordering for names of the same length (in accordance with IBM's 6611 APPN® MIB ordering). If AP_LIST_FROM_NEXT is selected, the returned list starts from the next entry according to the defined ordering (whether the specified entry exists or not).

VCB Structure

Format 1
typedef struct query_directory_entry{
        unsigned short  opcode;              /* verb operation code         */
        unsigned char   reserv2;             /* reserved                    */
        unsigned char   format;              /* format                      */
        unsigned short  primary_rc;          /* primary return code         */
        unsigned long   secondary_rc;        /* secondary return code       */
        unsigned char   *buf_ptr;            /* pointer to buffer           */
        unsigned long   buf_size;            /* buffer size                 */
        unsigned long   total_buf_size;      /* total buffer size required  */
        unsigned short  num_entries;         /* number of entries           */
        unsigned short  total_num_entries;   /* total number of entries     */
        unsigned char   list_options;        /* listing options             */
        unsigned char   reserv3;             /* reserved                    */
        unsigned char   resource_name[17];   /* network qualified res name  */
        unsigned char   reserv4;             /* reserved                    */
        unsigned short  resource_type;       /* Resource type               */
        unsigned char   parent_name[17];     /* parent name filter          */
        unsigned char   reserv5;             /* reserved                    */
        unsigned short  parent_type;         /* parent type                 */
        unsigned char   reserv6[24];         /* reserved                    */
 } QUERY_DIRECTORY_ENTRY;
typedef struct directory_entry_summary
{
        unsigned short  overlay_size;        /* size of this entry           */
        unsigned char   resource_name[17];   /* network qualified res name   */
        unsigned char   reserve1;            /* reserved                     */
        unsigned short  resource_type;       /* Resource type                */
        unsigned char   description[RD_LEN]; /* resource description         */
        unsigned char   real_owning_cp_type; /* real owning CP type          */
        unsigned char   real_owning_cp_name[17];
                                             /* real owning CP name          */
} DIRECTORY_ENTRY_SUMMARY;
typedef struct directory_entry_detail
{
        unsigned short  overlay_size;        /* size of this entry          */
        unsigned char   resource_name[17];   /* network qualified res name  */
        unsigned char   reserv1a;            /* reserved                    */
        unsigned short  resource type;       /* Resource type               */
        unsigned char   description[RD_LEN]; /* resource description        */
        unsigned char   parent_name[17];     /* network qualified           */
                                             /* parent name                 */
        unsigned char   reserv1b;            /* reserved                    */
        unsigned short  parent_type;         /* parent resource type        */
        unsigned char   entry_type;          /* Type of the directory entry */
        unsigned char   location;            /* Resource location           */
        unsigned char   real_owning_cp_type; /* real owning CP type         */
        unsigned char   real_owning_cp_name[17];                            */
                                             /* real owning CP name         */
        unsigned char   reserva;             /* reserved                    */
} DIRECTORY_LU_DETAIL;

VCB Structure

Format 0 (back-level)
typedef struct query_directory_entry{
        unsigned short  opcode;              /* verb operation code         */
        unsigned char   reserv2;             /* reserved                    */
        unsigned char   format;              /* format                      */
        unsigned short  primary_rc;          /* primary return code         */
        unsigned long   secondary_rc;        /* secondary return code       */
        unsigned char   *buf_ptr;            /* pointer to buffer           */
        unsigned long   buf_size;            /* buffer size                 */
        unsigned long   total_buf_size;      /* total buffer size required  */
        unsigned short  num_entries;         /* number of entries           */
        unsigned short  total_num_entries;   /* total number of entries     */
        unsigned char   list_options;        /* listing options             */
        unsigned char   reserv3;             /* reserved                    */
        unsigned char   resource_name[17];   /* network qualified res name  */
        unsigned char   reserv4;             /* reserved                    */
        unsigned short  resource_type;       /* Resource type               */
        unsigned char   parent_name[17];     /* parent name filter          */
        unsigned char   reserv5;             /* reserved                    */
        unsigned short  parent_type;         /* parent type                 */
} QUERY_DIRECTORY_ENTRY;

Supplied Parameters

The application supplies the following parameters:
opcode
AP_QUERY_DIRECTORY_ENTRY
format
Identifies the format of the VCB. Set this field to zero to specify the version of the VCB listed above. In addition to affecting the format of the VCB, only format 1 returns resources of AP_DLUR_LU_RESOURCE.
buf_ptr
Pointer to a buffer into which list information can be written. The application can append data to the end of the VCB, in which case buf_ptr must be set to NULL.
buf_size
Size of buffer supplied. The data returned will not exceed this size.
num_entries
Maximum number of entries to return. The number of entries will not exceed this value. A value of zero means no limit.
list_options
This indicates what should be returned in the list information:
AP_SUMMARY
Returns summary information only.
AP_DETAIL
Returns detailed information.

The combination of the resource_name and resource_type specified (see the following parameters, resource_name and resource_type) represents an index value that is used to specify the starting point of the actual information to be returned.

AP_FIRST_IN_LIST
The index value is ignored, and the returned list starts from the first entry in the list.
AP_LIST_FROM_NEXT
The returned list starts from the next entry in the list after the one specified by the supplied index value.
AP_LIST_INCLUSIVE
The returned list starts from the entry specified by the index value.
resource_name
Network qualified resource name. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type-A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.) This field is ignored if list_options is set to AP_FIRST_IN_LIST.
resource_type
Resource type. See one of the following:

AP_NNCP_RESOURCE
AP_ENCP_RESOURCE
AP_LU_RESOURCE
AP_DLUR_LU_RESOURCE

This field is ignored if list_options is set to AP_FIRST_IN_LIST.

parent_name
Parent name filter. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type-A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.) If this field is set, then only directory entries belonging to the specified parent are returned (and in this case, the parent_name field must also be set). This field is if it is set to all zeros.
parent_type
The type of parent specified in the parent_name field. The type must be specified if the parent_name field is nonzero, otherwise this field should be set to zero. The can be set to one of the following:

AP_ENCP_RESOURCE
AP_NNCP_RESOURCE

This field is ignored if list_options is set to AP_FIRST_IN_LIST.

Returned Parameters

If the verb executes successfully, the Program returns the following parameters:
primary_rc
AP_OK
buf_size
Length of the information returned in the buffer.
total_buf_size
Returned value indicating the size of buffer that would have been required to return all the list information requested. This can be higher than buf_size.
num_entries
Number of directory entries returned.
total_num_entries
Total number of entries that could have been returned. This can be higher than num_entries.
directory_entry_summary.overlay_size
The number of bytes in this entry, and hence the offset to the next entry returned (if any).
directory_entry_summary.resource_name
Network qualified resource name. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type-A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.)
directory_entry_summary.resource_type
Resource type. This can be one of the following:

AP_NNCP_RESOURCE
AP_ENCP_RESOURCE
AP_LU_RESOURCE
AP_DLUR_LU_RESOURCE

(Not returned if format is set to zero.)
directory_entry_summary.description
Resource description as specified on:

DEFINE_LOCAL_LU
DEFINE_DIRECTORY_ENTRY
DEFINE_ADJACENT_LEN_NODE or
DEFINE_ADJACENT_NODE

directory_entry_summary.real_owning_cp_type
NN and BrNN only: Real owning CP type. This can be one of the following:
AP_NONE
The real owning CP is a parent resource.
AP_ENCP_RESOURCE
The real owning CP is not the parent resource and is an EN.

Other node types: This field is set to AP_NONE.

directory_entry_summary.real_owning_cp_name
NN and BrNN only: Fully qualified real owning CP name. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.)

If the real owning CP is the parent, this field is set to binary zeroes.

If the real owning CP is not the parent, then this field is set to the name of the real owning CP.

The real owning CP is not the parent in the directory of the NNS of a BrNN if the resource is owned by an EN in the domain of the BrNN. In this case, the real owning CP is the EN, but the parent is the BrNN.

Other node types: This field is set to binary zeroes.

directory_entry_detail.overlay_size
The number of bytes in this entry, and therefore the offset to the next entry returned (if any).
directory_entry_detail.resource_name
Network qualified resource name. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type-A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.)
directory_entry_detail.resource_type
Resource type. This can be one of the following:

AP_NNCP_RESOURCE
AP_ENCP_RESOURCE
AP_LU_RESOURCE

directory_entry_detail.description
Resource description as specified on:

DEFINE_LOCAL_LU
DEFINE_DIRECTORY_ENTRY
DEFINE_ADJACENT_LEN_NODE or
DEFINE_ADJACENT_NODE

directory_entry_detail.parent_name
Fully qualified parent name of the node serving the LU. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type-A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.)
directory_entry_detail.parent_type
Parent resource type. This can be one of the following:

AP_NNCP_RESOURCE
AP_ENCP_RESOURCE

directory_entry_detail.entry_type
Specifies the type of the directory entry. This can be one of the following values:
AP_HOME
Local resource.
AP_CACHE
Cached entry.
AP_REGISTER
Registered resource (NN only).
directory_entry_detail.location
Specifies the location of the resource, which can be one of the following values:
AP_LOCAL
The resource is at the local node.
AP_DOMAIN
The resource belongs to an attached end node.
AP_CROSS_DOMAIN
The resource is not within the domain of the local node.
directory_entry_detail.real_owning_cp_type
NN and BrNN only: Real owning CP type. This can be one of the following:
AP_NONE
The real owning CP is a parent resource.
AP_ENCP_RESOURCE
The real owning CP is not the parent resource and is an EN.

Other node types: This field is set to AP_NONE.

directory_entry_detail.real_owning_cp_name
NN and BrNN only: Fully qualified real owning CP name. This name is 17 bytes long and is right-padded with EBCDIC spaces. It is composed of two type A EBCDIC character strings concatenated by an EBCDIC dot. (Each name can have a maximum length of 8 bytes with no embedded spaces.)

If the real owning CP is the parent, this field is set to binary zeroes.

If the real owning CP is not the parent, then this field is set to the name of the real owning CP.

The real owning CP is not the parent in the directory of the NNS of a BrNN if the resource is owned by an EN in the domain of the BrNN. In this case, the real owning CP is the EN, but the parent is the BrNN.

Other node types: This field is set to binary zeroes.

If the verb does not execute because of a parameter error, the Program returns the following parameters:
primary_rc
AP_PARAMETER_CHECK
secondary_rc
AP_INVALID_RES_NAME

AP_INVALID_RES_TYPE
AP_INVALID_LIST_OPTION

If the verb does not execute because the node has not yet been started, the Program returns the following parameter:
primary_rc
AP_NODE_NOT_STARTED
If the verb does not execute because of a system error, the Program returns the following parameter:
primary_rc
AP_UNEXPECTED_SYSTEM_ERROR