| Jean,
Below you will find to files: one is complete source code and another is the
.COM file which I use to compile and link this program.
This program will prompt you for area and local address.
If you enter for them something reasonable, say 55 and 837 as for SWORD1,
you will receive nice dump of identifier attributes.
If you enter 0 and 0, you will receive the specialized exception 372 -
"Cluster Alias Not Supported", and the address of the node on which you have
used this program, assuming that it is the PhaseIV node.
If you enter 0 and anything between 1 and 1023, responce will depend on the
values in your local database on god knows what else, but so far I have got
the following (for different local address values):
%SYSTEM-F-ACCVIO, access violation.
EXCEPTION Invalid Login Information= 307 :
SYMBOL = DN4_INVAL_LOGIN,
TEXT = "Access control information invalid at Node",
EXCEPTION Not Currently Reachable = 320 :
SYMBOL = DN4_NOT_CURR_REACH,
TEXT = "Node not currently accessible.",
It seems to me that access violation will occur when you do have perfectly
valid entry in you local database and you are able to access such node without
any problem if you supply area value.
Best regards,
Gene
#include <stdio.h>
#include <mcc_descrip.h>
#include <mcc_vea_def.h>
#include <mcc_interface_def.h>
#include <mcc_msg.h>
#include <mcc_dna4_am_node4_svc_if.h>
main()
{
#define OUT_P_SIZE 1024
int area;
int loc_addr;
int step;
MCC_T_CVR status;
MCC_T_UNSLONG wildtype;
MCC_T_UNSLONG time_dt;
MCC_T_Phase4Address phase4_address;
MCC_T_UNSLONG verb = MCC_K_VERB_SHOW;
MCC_T_UNSLONG attribute = MCC_K_ATTR_PRT_IDENTIFIER;
MCC_T_IDCode class;
char out_p_buffer[OUT_P_SIZE];
MCC_T_Descriptor desc;
MCC_A_AES p_in_entity;
MCC_A_AES p_out_entity;
MCC_T_Descriptor *p_time_stamp;
MCC_A_HANDLE p_handle;
#define MAXSTEP 5
printf("Enter area: ");
fscanf(stdin, "%d", &area);
printf("Enter local address: ");
fscanf(stdin, "%d", &loc_addr);
phase4_address.p4a_r_fill_0.p4a_W_Phase4Address =
(unsigned short) (area * 1024 + loc_addr);
desc.mcc_w_maxstrlen = sizeof(MCC_T_Phase4Address);
desc.mcc_b_dtype = DSC_K_DTYPE_WU;
desc.mcc_b_class = DSC_K_CLASS_S;
desc.mcc_a_pointer = (unsigned char *) (&phase4_address);
desc.mcc_w_curlen = desc.mcc_w_maxstrlen;
desc.mcc_b_flags = 0;
desc.mcc_b_ver = MCC_K_VER_DESCRIPTOR;
desc.mcc_l_id = MCC_K_DN4_NI_NODE_ADDR;
desc.mcc_l_dt = MCC_K_DT_PHASE4ADDRESS;
desc.mcc_a_link = MCC_K_NULL_PTR;
step = 1;
do switch (step++) {
case 1:
p_in_entity = MCC_K_NULL_PTR;
class = MCC_K_CLASS_DECNET_NODE;
wildtype = MCC_K_AES_NOT_WILD;
status = mcc_aes_create(&p_in_entity, &class, &desc, &wildtype);
break;
case 2:
p_out_entity = MCC_K_NULL_PTR;
status = mcc_aes_create(&p_out_entity, &class, &desc, &wildtype);
break;
case 3:
p_time_stamp = MCC_K_NULL_PTR;
time_dt = MCC_K_DT_BIN_ABS_TIM;
status = mcc_time_create(&p_time_stamp, &time_dt,
MCC_K_NULL_PTR, /* init_time_len */
MCC_K_NULL_PTR); /* init_time_val */
break;
case 4:
p_handle = MCC_K_NULL_PTR;
status = mcc_ahs_create(&p_handle);
break;
case 5:
desc.mcc_w_maxstrlen = OUT_P_SIZE;
desc.mcc_b_dtype = DSC_K_DTYPE_T;
desc.mcc_b_class = DSC_K_CLASS_S;
desc.mcc_a_pointer = (unsigned char *) out_p_buffer;
desc.mcc_w_curlen = desc.mcc_w_maxstrlen;
desc.mcc_b_flags = 0;
desc.mcc_b_ver = MCC_K_VER_DESCRIPTOR;
desc.mcc_l_id = 0;
desc.mcc_l_dt = MCC_K_DT_ILV;
desc.mcc_a_link = MCC_K_NULL_PTR;
status = mcc_call_access(&verb,
p_in_entity,
&attribute,
MCC_K_NULL_PTR, /* time_spec: do it NOW */
MCC_K_NULL_PTR, /* p_in_q */
MCC_K_NULL_PTR, /* p_in_p */
p_handle,
p_out_entity,
p_time_stamp,
&desc, /* out_p */
MCC_K_NULL_PTR); /* out_q_p */
if ((status == MCC_S_RESPONSE) ||
(status = MCC_S_COMMON_EXCEPTION) ||
(status = MCC_S_SPECIALIZED_EXCEPTION) )
status = mcc_ilv_dump(&desc); /* dump out_p */
} while ((step <= MAXSTEP) && (status == MCC_S_NORMAL));
if (status != MCC_S_NORMAL)
printf("\nBad status %d on step %d", status, step-1);
exit(1);
}
$ cc/list/show=inc/stan=port/debug/noopt 'P1'
$ LINK /deb 'P1', SYS$INPUT/OPTIONS
sys$library:MCC_KERNEL_INIT.OBJ
SYS$SHARE:VAXCRTL/SHARE
SYS$SHARE:MCC_KERNEL_SHR/SHARE
$ EXIT
|