| George,
Yes I am afraid the code is wrong, but your customer cannot guess !
ilv_get on an AES datatype require the descriptor to be set to a null
buffer : mcc_a_pointer set to MCC_K_NULL_PTR, curlen and maxstrlen set to 0
Please make them replace
>
> The following code segment shows how the ILV call is made:
>
>
> if (status == MCC_S_NORMAL) /* create AES struct*/
> status = mcc_aes_create(&a_aes_struct,
> &MCC_K_CLASS_KNOWN,
> /* He don't know the class, but what to use?*/
> a_aes_struct,
> &MCC_K_AES_NOT_WILD);
>
>
> if (status == MCC_S_NORMAL) /* create AES struct*/
> status = mcc_desframe_create_descriptor (
> &(*p_context)->alloc_mem_list, /* Memory Allocation */
> &ilv_buffer, /* Descriptor Pointer */
> &128, /* Don't know length so
> go for a large value */
> &MCC_K_DT_FULL_ENTITY, /* Data type */
> &a_aes_struct, /* Initial Value */
> &MCC_K_MEMBERENTITY, /* ID */
> &DSC_K_DTYPE_Z); /* Initial Value */
>
> if (status == MCC_S_NORMAL) /* create AES struct*/
> status = mcc_ilv_list_get_datatype(&req_ilv_ctx, &data_type);
> /* Data_type = 55 */
>
> if (status == MCC_S_NORMAL) /* create AES struct*/
> status = mcc_ilv_get(&req_ilv_ctx, ilv_buffer, &reason_code);
> /* status returned is
> MCC-E-INV_ENTITY */
>
by (simpler)
> if (status == MCC_S_NORMAL)
> status = mcc_desframe_create_descriptor (
> &(*p_context)->alloc_mem_list, /* Memory Allocation */
> &ilv_buffer, /* Descriptor Pointer */
> &0, /* Don't know length so
> go for a large value */
> &MCC_K_DT_FULL_ENTITY, /* Data type */
> &MCC_K_NULL_PTR, /* Initial Value */
> &MCC_K_MEMBERENTITY, /* ID */
> &DSC_K_DTYPE_Z); /* Initial Value */
>
> if (status == MCC_S_NORMAL) /* create AES struct*/
> status = mcc_ilv_list_get_datatype(&req_ilv_ctx, &data_type);
> /* Data_type = 55 */
>
> if (status == MCC_S_NORMAL) /* create AES struct*/
> status = mcc_ilv_get(&req_ilv_ctx, ilv_buffer, &reason_code);
but then need after that to delete the AES allocated by mcc_ilv_get, via
status = mcc_aes_delete( (MCC_A_AES *) &ilv_buffer->mcc_a_pointer);
Hope this helps.
Regards.
Pierre.
|
| Hi Pierre,
Thank you for prompt response and suggestion.
Customer followed your example but status returned was invalid argument.
He tried to set the length to 128, it got thru but stop at mcc_ilv_get
with status returned MCC-E-INV_ENTITY.
Any comment/suggestions?
Thanks and regards,
George.
Result 1
========
if (status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor (
&(*p_context)->alloc_mem_list, /* Memory Allocation */
&ilv_buffer, /* Descriptor Pointer */
&0, /* Don't know length so
go for a large value */
&MCC_K_DT_FULL_ENTITY, /* Data type */
&MCC_K_NULL_PTR, /* Initial Value */
&MCC_K_MEMBERENTITY, /* ID */
&DSC_K_DTYPE_Z); /* Initial Value */
/* status returned is
Invalid argument */
Result 2
========
if (status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor (
&(*p_context)->alloc_mem_list, /* Memory Allocation */
&ilv_buffer, /* Descriptor Pointer */
&128, /* Don't know length so
go for a large value */
&MCC_K_DT_FULL_ENTITY, /* Data type */
&MCC_K_NULL_PTR, /* Initial Value */
&MCC_K_MEMBERENTITY, /* ID */
&DSC_K_DTYPE_Z); /* Initial Value */
/* it pass thru */
if (status == MCC_S_NORMAL) /* create AES struct*/
status = mcc_ilv_list_get_datatype(&req_ilv_ctx, &data_type);
/* Data_type = 55 */
if (status == MCC_S_NORMAL) /* create AES struct*/
status = mcc_ilv_get(&req_ilv_ctx, ilv_buffer, &reason_code);
/* status returned is
MCC-E-INV_ENTITY */
|
| George.
I am afraid I made a mistake in my example : the create_descriptor
call I proposed was wrong :
>
> if (status == MCC_S_NORMAL)
> status = mcc_desframe_create_descriptor (
> &(*p_context)->alloc_mem_list, /* Memory Allocation */
> &ilv_buffer, /* Descriptor Pointer */
> &0, /* Don't know length so
> go for a large value */
> &MCC_K_DT_FULL_ENTITY, /* Data type */
> &MCC_K_NULL_PTR, /* Initial Value */
> &MCC_K_MEMBERENTITY, /* ID */
> &DSC_K_DTYPE_Z); /* Initial Value */
> /* status returned is
> Invalid argument */
has to be replaced by :
if (status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor (
&(*p_context)->alloc_mem_list, /* Memory Allocation */
&ilv_buffer, /* Descriptor Pointer */
&0, /* Don't know length so
go for a large value */
&MCC_K_DT_FULL_ENTITY, /* Data type */
--> MCC_K_NULL_PTR, /* Initial Value */
&MCC_K_MEMBERENTITY, /* ID */
&DSC_K_DTYPE_Z); /* Initial Value */
/* status returned is
Invalid argument */
The descriptor has to have a mcc_a_pointer value equal to 0
along with mcc_w_curlen and mcc_w_maxstrlen.
Hope it is correct now !
Regards.
Pierre.
|