[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

5170.0. "Register FM and DECdns" by AEOENG::TUAUX (EIC Annecy - dtn 887 4121) Wed Jun 09 1993 07:06

Hi,

I have registered a SNMP entity using the FM REGISTER.

From a program, I would like to read back the attributs stored by the 
FM Register in the DECdns server.
I'm using the mcc_dns routine:

	stat = mcc_dns_read_attr_data(p_in_entity, &attr_id,
                                           &read_dsc, &dns_stat);

and I get the following error: stat = %MCC-E-DNSERROR, unknown DNS error
		               dns_stat = %DNS-E-INVALIDNAME, Invalid name

I think that the routine access to  the right entity entry in DECdns but cannot 
find the specified attribute.

I tried several attributes like 
MCC_K_ATTR_PRT_IDENTIFIER, MCC_K ATTR_NAME, MCC_K_SNMP_ADDRESS....
and I got always the same error code.

What are the attributes codes stored by Register FM which I can put in attr_id ?

Thanks and regards

Sylviane
T.RTitleUserPersonal
Name
DateLines
5170.1Check the p_in_entityTRM::KWAKWed Jun 09 1993 11:0920
    
    RE: .0
    
    The MCC Registration FM stores/retrieves "reference attributes" in DNS 
    using mcc_dns_read_attr_data(), and mcc_dns_write_attr_data().
    
>	stat = mcc_dns_read_attr_data(p_in_entity, &attr_id,
>                                           &read_dsc, &dns_stat);
    
    In the function call above, you need to have the attribute code
    in "attr_id".
    
    From the error message you got (%DNS-E_INVALIDNAME), it seems that the 
    entity spec is incorrect. Please add the following statement before 
    making the call:
    
        stat = mcc_aes_dump(p_in_entity);
    
    
    William    
5170.2You 're right but where is the bug ?AEOENG::TUAUXEIC Annecy - dtn 887 4121Wed Jun 09 1993 13:1935
I put mcc_aes_dump (p_in_entity) and the result is correct, I get back 
what I have initialize with the mcc_aes_create routine.

I try to run my program with a NODE4 entity. Error codes are nearly the same:
stat = %MCC-E-DNSERROR, unknown DNS error
dns_stat = %DNS-E-INVALID_ENTRYNA, Name of entry is not in...

So you are right, the problem comes from the entity spec.

I initialize the p_in_entity with the node name as following:

    instance.mcc_b_dtype = DSC_K_DTYPE_T;
    instance.mcc_b_class = DSC_K_CLASS_S;
    instance.mcc_a_pointer = &"AEO685";
    instance.mcc_w_maxstrlen = 6;
    instance.mcc_w_curlen = 6;
    instance.mcc_l_id = MCC_K_DN4_NI_NODE_REG_NAME;
    instance.mcc_l_dt = MCC_K_DT_FULL_NAME;
    instance.mcc_b_flags = 0;
    instance.mcc_b_ver = MCC_K_VER_DESCRIPTOR;
    instance.mcc_a_link = MCC_K_NULL_PTR;

    if (stat == MCC_S_NORMAL)  
      stat = mcc_aes_create (      
		&p_in_entity,
		 &MCC_K_CLASS_DECNET_NODE,
  		 &instance,
		&MCC_K_AES_NOT_WILD);

Can you see something wrong ?

Thanks for your help.

Sylviane
5170.3Fullname is not string typeTOOK::KWAKWed Jun 09 1993 14:1144
    
    RE: .2
    
    You need to get the 'opaque' fullname of your node4 entity.
    
    The datatype "MCC_T_DT_FULLNAME" is not string, but an 'opaque'
    name used by DNS. You need to call mcc_dns_opaque_fullname() to
    convert the string representation to the internal 'opaque' format
    before you call mcc_aes_create().
    
    Please refer MCC SRM (System Reference Manual) for details of the
    routine. The following is what is needed to build the correct AES.
    
    
    unsigned char *p_string,
    		  opaque_name[100];
    unsigned short	str_len, opaque_name_len = 0;
    
    p_string = "AEO685";
    str_len = strlen(p_string);
    stat = mcc_dns_opaque_fullname(p_string, &str_len,
    				opaque_name, &opaque_name_len, &dns_stat);
    
    instance.mcc_b_dtype = DSC_K_DTYPE_T;
    instance.mcc_b_class = DSC_K_CLASS_S;
    
    instance.mcc_a_pointer = opaque_name;
    instance.mcc_w_maxstrlen = sizeof (opaque_name);
    instance.mcc_w_curlen = opaque_name_len;
    
    instance.mcc_l_id = MCC_K_DN4_NI_NODE_REG_NAME;
    instance.mcc_l_dt = MCC_K_DT_FULL_NAME;
    instance.mcc_b_flags = 0;
    instance.mcc_b_ver = MCC_K_VER_DESCRIPTOR;
    instance.mcc_a_link = MCC_K_NULL_PTR;

    if (stat == MCC_S_NORMAL)  
      stat = mcc_aes_create (      
		&p_in_entity,
		 &MCC_K_CLASS_DECNET_NODE,
  		 &instance,
		&MCC_K_AES_NOT_WILD);

    
5170.4problem is not fixedAEOENG::TUAUXEIC Annecy - dtn 887 4121Thu Jun 10 1993 06:2117
Hello,

Still me with my DECdns problem !

I have done what you said, and now I get the following errors:


stat: %MCC-E-NOATTRIB, no such DNS attribute

And the mcc_aes_dump of p_in_entity is :

instance = �...Z� .�:?.......AEO685..

Have you any idea ?

Sylviane
5170.5The attribute you want does not exist in DNS.TOOK::KWAKThu Jun 10 1993 10:2224
    
    RE:.4
    
    "%MCC-E-NOATTRIB" means the attribute you're looking for does not
    exist in DECdns.
    
    As I said in .1, the Registration FM stores Reference attributes
    in DNS, which can be read using mcc_dns_read_attr_data().
    
    Suppose you wish to read reference attribute of registered entity
    (snmp YOURS_NS:.ipfoo), do the following:
    	$ man/ent
        MCC> set snmp YOURS_NS:.ipfoo remarks = "Testing program"
    	MCC> show snmp YOURS_NS:.ipfoo remarks
    
        $! Now find the attribute code for the attribute "remarks"
    	$! and use is in 'attr_id' parameter.
    
    
    If you want to retrieve identifiers (e.g. IP address and IP name), 
    you need to call mcc_dns_get_identifiers(). 
    
    William
    
5170.6It works!AEOENG::TUAUXEIC Annecy - dtn 887 4121Thu Jun 10 1993 13:493
My program is working now, thanks for your help.

Sylviane