Lines Matching refs:token
62 coap_binary_t *token;
107 static char *pkcs11_pin = NULL; /* PKCS11 pin to unlock access to token */
209 track_new_token(size_t tokenlen, uint8_t *token) {
213 coap_log_info("Unable to track new token\n");
217 tracked_tokens[tracked_tokens_count].token = coap_new_binary(tokenlen);
218 if (!tracked_tokens[tracked_tokens_count].token)
220 memcpy(tracked_tokens[tracked_tokens_count].token->s, token, tokenlen);
226 track_check_token(coap_bin_const_t *token) {
230 if (coap_binary_equal(token, tracked_tokens[i].token)) {
238 track_flush_token(coap_bin_const_t *token, int force) {
242 if (coap_binary_equal(token, tracked_tokens[i].token)) {
245 coap_delete_binary(tracked_tokens[i].token);
267 uint8_t token[8];
277 * Create unique token for this request for handling unsolicited /
282 coap_session_new_token(session, &tokenlen, token);
283 /* Update the last part 8 bytes of the large token */
284 memcpy(&the_token.s[the_token.length - tokenlen], token, tokenlen);
290 coap_log_debug("cannot add token to request\n");
350 coap_bin_const_t token = coap_pdu_get_token(sent);
352 if (!track_check_token(&token)) {
353 coap_log_err("nack_handler: Unexpected token\n");
393 coap_bin_const_t token = coap_pdu_get_token(received);
401 if (!track_check_token(&token)) {
450 track_flush_token(&token, 0);
467 track_flush_token(&token, 1);
472 track_flush_token(&token, 0);
503 "\t\t[-T token] [-U] [-V num] [-X size]\n"
561 "\t-T token\tDefine the initial starting token (up to 24 characters)\n"
602 "\t-J pkcs11_pin\tThe user pin to unlock access to the PKCS11 token\n"
1860 * Prime the base token value, which coap_session_new_token() will increment
1861 * every time it is called to get an unique token.
1862 * [Option '-T token' is used to seed a different value]
1863 * Note that only the first 8 bytes of the token are used as the prime.
1912 (tracked_tokens_count || /* token not responded to or still observe */
1948 coap_cancel_observe(session, tracked_tokens[i].token, msgtype);
2021 coap_delete_binary(tracked_tokens[i].token);