Lines Matching refs:payload
99 coap_add_payload(const coap_key_t key, coap_payload_t *payload, in coap_add_payload() argument
101 assert(payload); in coap_add_payload()
103 memcpy(payload->resource_key, key, sizeof(coap_key_t)); in coap_add_payload()
104 HASH_ADD(hh, test_resources, resource_key, sizeof(coap_key_t), payload); in coap_add_payload()
113 coap_delete_payload(coap_payload_t *payload) { in coap_delete_payload() argument
114 if (payload) { in coap_delete_payload()
117 payload->resource_key, sizeof(coap_key_t), uri); in coap_delete_payload()
124 HASH_DELETE(hh, test_resources, payload); in coap_delete_payload()
125 coap_free(payload); in coap_delete_payload()
226 coap_payload_t *payload; in hnd_delete_resource() local
228 payload = coap_find_payload(resource->key); in hnd_delete_resource()
230 if (payload) in hnd_delete_resource()
231 coap_delete_payload(payload); in hnd_delete_resource()
310 coap_payload_t *payload; in hnd_put_test() local
318 payload = coap_find_payload(resource->key); in hnd_put_test()
319 if (payload && payload->max_data < len) { /* need more storage */ in hnd_put_test()
320 coap_delete_payload(payload); in hnd_put_test()
321 payload = NULL; in hnd_put_test()
326 if (!payload) { /* create new payload */ in hnd_put_test()
327 payload = coap_new_payload(len); in hnd_put_test()
328 if (!payload) in hnd_put_test()
331 coap_add_payload(resource->key, payload, NULL); in hnd_put_test()
333 payload->length = len; in hnd_put_test()
334 memcpy(payload->data, data, len); in hnd_put_test()
339 payload->media_type = in hnd_put_test()
343 payload->media_type = COAP_MEDIATYPE_TEXT_PLAIN; in hnd_put_test()
361 coap_payload_t *payload; in hnd_delete_test()
362 payload = coap_find_payload(resource->key); in hnd_delete_test()
364 if (payload) in hnd_delete_test()
365 payload->length = 0; in hnd_delete_test()
500 coap_payload_t *payload; in make_large() local
513 payload = coap_new_payload(statbuf.st_size); in make_large()
514 if (!payload) in make_large()
520 coap_free(payload); in make_large()
524 payload->length = fread(payload->data, 1, statbuf.st_size, inputfile); in make_large()
525 payload->media_type = 41; in make_large()
529 return payload; in make_large()