return 0;
}
-static OicSecPdAcl_t* InputPdACL()
-{
- int ret;
- char *temp_rsc, *temp_pms;
-
- printf("******************************************************************************\n");
- printf("-Set ACL policy for target DP device\n");
- printf("******************************************************************************\n");
-
- OicSecPdAcl_t *acl = (OicSecPdAcl_t *)OICCalloc(1,sizeof(OicSecPdAcl_t));
- if (NULL == acl)
- {
- OIC_LOG(ERROR, TAG, "Error while memory allocation");
- return NULL;
- }
-
- //Set Resource.
- printf("Num. of Resource : ");
- ret = scanf("%" PRIuPTR, &acl->resourcesLen);
- if ((1 != ret) || (acl->resourcesLen <= 0 || acl->resourcesLen > 50))
- {
- printf("Error while input\n");
- OICFree(acl);
- return NULL;
- }
- printf("-URI of resource\n");
- printf("ex)/oic/sh/temp/0 (Max_URI_Length: %d Byte )\n", MAX_URI_LENGTH);
- acl->resources = (char **)OICCalloc(acl->resourcesLen, sizeof(char *));
- if (NULL == acl->resources)
- {
- OIC_LOG(ERROR, TAG, "Error while memory allocation");
- OICFree(acl);
- return NULL;
- }
- for (size_t i = 0; i < acl->resourcesLen; i++)
- {
- printf("[%" PRIuPTR "]Resource : ", i + 1);
- ret = scanf("%64ms", &temp_rsc);
- if (1 != ret)
- {
- printf("Error while input\n");
- OICFree(acl->resources);
- OICFree(acl);
- return NULL;
- }
-
- acl->resources[i] = OICStrdup(temp_rsc);
- OICFree(temp_rsc);
- if (NULL == acl->resources[i])
- {
- OIC_LOG(ERROR, TAG, "Error while memory allocation");
- OICFree(acl->resources);
- OICFree(acl);
- return NULL;
- }
- }
-
- // Set Permission
- do
- {
- printf("-Set the permission(C,R,U,D,N)\n");
- printf("ex) CRUDN, CRU_N,..(5 Charaters)\n");
- printf("Permission : ");
- ret = scanf("%5ms", &temp_pms);
- if (1 != ret)
- {
- printf("Error while input\n");
- OICFree(acl->resources);
- OICFree(acl);
- return NULL;
- }
- ret = CalculateAclPermission(temp_pms, &(acl->permission));
- OICFree(temp_pms);
- } while (0 != ret );
-
- return acl;
-}
-
OCStackResult displayMutualVerifNumCB(uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN])
{
OC_UNUSED(mutualVerifNum);