|
Let's see if I can help...
1) mcc_dict_build_spec :
What is the meaning of the mcc_l_id (MCC class ID code)
,optional class parameter in this context.
When is this parameter required ?
Is it when we are not working at the global entity class level but
at a sub-level ?
leave the l_id field as 0 when using the AES spec to access the dictionary;
at least that is what I do and it works fine.
2) The main problem now is the ...get_def_info routine.
I got the MCC_S_INSUFBUF_OUT_P cvr, but I have allocated 10kB RAM space,
and I did not get MCC_S_INSVIRMEM.
I tried to set the mcc_l_dt = 0. then I tried to set it to OCTET_STRING, but
nothing happened.
If you are getting the mem/size problems you are probably not setting up the
instance (output) buffer with the right datatype for the type of data your
are trying to get at. If you are trying to pick up the attribute_list
definition then you want to set the l_dt to UNSIGNED32.
The last instance of the dict spec:
p_dict_instance = calloc(1, MCC_S_DESCRIPTOR);
id_buffer = MCC_K_DD_ATTRIBUTE_LIST; /* set to definition being
p_dict_instance->mcc_b_ver = 1; /* the value 1 is required
p_dict_instance->mcc_b_dtype = DSC_K_DTYPE_LU; /* set up for get by code
p_dict_instance->mcc_b_class = DSC_K_CLASS_S; /*
p_dict_instance->mcc_w_maxstrlen = sizeof(unsigned long);
p_dict_instance->mcc_w_curlen = p_dict_instance->mcc_w_maxstrlen;
p_dict_instance->mcc_a_pointer = &id_buffer; /* pass in the id_buffer fo
p_dict_instance->mcc_l_dt = MCC_K_DT_UNSIGNED32;/* id is an unsigned long
(which I then append to the AES spec, p_temp_spec, that was previousl created)
The return buffer for the attribute list:
def_buffer.def_r_value_desc.mcc_b_dtype = DSC_K_DTYPE_T;
def_buffer.def_r_value_desc.mcc_b_ver = 1;
def_buffer.def_r_value_desc.mcc_w_curlen = BUFFER_SIZE;
def_buffer.def_r_value_desc.mcc_w_maxstrlen = BUFFER_SIZE;
def_buffer.def_r_value_desc.mcc_b_class = DSC_K_CLASS_S;
def_buffer.def_r_value_desc.mcc_a_pointer = &def_data[0];
def_buffer.def_r_value_desc.mcc_a_link = MCC_K_NULL_PTR;
(def_data is just a large char buffer)
The call:
class = MCC_K_DICT_DEFINITION; /* looking for a definition
status = mcc_dict_get_def_info (p_temp_spec, p_ret_buffer);
count = def_buffer.def_w_count;
3) How do I get the information corresponding to the man/tool/dict command:
show class sample Attribute_Partition CHARACTERISTICS Definition ATTRIBUTE_LIST
Can I use the mcc_aes_create to add the Attribute_Partition into the AES?
To get it you want an AES dictionary spec containing:
MCC_K_DICT_CLASS your class
MCC_K_DICT_SUBCLASS your subclass(es)
MCC_K_DICT_ATTR_PARTITION partition of interest
MCC_K_DICT_DEFINITION MCC_K_DD_ATTRIBUTE_LIST
hope this is what you were looking for.
|