• Home
  • Raw
  • Download

Lines Matching refs:rd

88   rd_t *rd;  in rd_new()  local
89 rd = (rd_t *)coap_malloc(sizeof(rd_t)); in rd_new()
90 if (rd) in rd_new()
91 memset(rd, 0, sizeof(rd_t)); in rd_new()
93 return rd; in rd_new()
97 rd_delete(rd_t *rd) { in rd_delete() argument
98 if (rd) { in rd_delete()
99 coap_free(rd->data.s); in rd_delete()
100 coap_free(rd); in rd_delete()
123 rd_t *rd = coap_resource_get_userdata(resource); in hnd_get_resource() local
134 if (rd && rd->etag_len) in hnd_get_resource()
135 coap_add_option(response, COAP_OPTION_ETAG, rd->etag_len, rd->etag); in hnd_get_resource()
137 if (rd && rd->data.s) in hnd_get_resource()
138 coap_add_data(response, rd->data.length, rd->data.s); in hnd_get_resource()
156 rd_t *rd = NULL; in hnd_put_resource()
161 HASH_FIND(hh, resources, resource->uri_path.s, resource->uri_path.length, rd); in hnd_put_resource()
162 if (rd) { in hnd_put_resource()
165 if (!etag || (COAP_OPT_LENGTH(etag) != rd->etag_len) in hnd_put_resource()
166 || memcmp(COAP_OPT_VALUE(etag), rd->etag, rd->etag_len) != 0) { in hnd_put_resource()
178 coap_free(rd->data.s); in hnd_put_resource()
179 rd->data.s = tmp.s; in hnd_put_resource()
180 rd->data.length = tmp.length; in hnd_put_resource()
181 memcpy(rd->data.s, data, rd->data.length); in hnd_put_resource()
186 rd->etag_len = min(COAP_OPT_LENGTH(etag), sizeof(rd->etag)); in hnd_put_resource()
187 memcpy(rd->etag, COAP_OPT_VALUE(etag), rd->etag_len); in hnd_put_resource()
224 rd_t *rd = coap_resource_get_userdata(resource); in hnd_delete_resource() local
226 if (rd) { in hnd_delete_resource()
227 rd_delete(rd); in hnd_delete_resource()
369 rd_t *rd; in make_rd() local
374 rd = rd_new(); in make_rd()
376 if (!rd) { in make_rd()
381 if (coap_get_data(pdu, &rd->data.length, &data)) { in make_rd()
382 rd->data.s = (unsigned char *)coap_malloc(rd->data.length); in make_rd()
383 if (!rd->data.s) { in make_rd()
385 rd_delete(rd); in make_rd()
388 memcpy(rd->data.s, data, rd->data.length); in make_rd()
393 rd->etag_len = min(coap_opt_length(etag), sizeof(rd->etag)); in make_rd()
394 memcpy(rd->etag, coap_opt_value(etag), rd->etag_len); in make_rd()
397 return rd; in make_rd()
516 rd_t *rd; in hnd_post_rd() local
517 rd = make_rd(request); in hnd_post_rd()
518 if (rd) { in hnd_post_rd()
519 coap_resource_set_userdata(r, rd); in hnd_post_rd()