coap_asn1_internal.h
Go to the documentation of this file.
/*
* coap_asn1_internal.h -- ASN.1 functions for libcoap
*
* Copyright (C) 2020 Jon Shallow <supjps-libcoap@jpshallow.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
#ifndef COAP_ASN1_INTERNAL_H_
#define COAP_ASN1_INTERNAL_H_
typedef enum {
COAP_ASN1_NONE = 0,
COAP_ASN1_INTEGER = 2,
COAP_ASN1_BITSTRING = 3,
COAP_ASN1_OCTETSTRING = 4,
COAP_ASN1_IDENTIFIER = 6,
} coap_asn1_tag_t;
typedef int (*asn1_validate)(const uint8_t *data, size_t size);
size_t asn1_len(const uint8_t **ptr);
coap_asn1_tag_t asn1_tag_c(const uint8_t **ptr, int *constructed, int *class);
coap_binary_t *get_asn1_tag(coap_asn1_tag_t ltag, const uint8_t *ptr,
size_t tlen, asn1_validate validate);
#endif /* COAP_ASN1_INTERNAL_H_ */
asn1_tag_c
coap_asn1_tag_t asn1_tag_c(const uint8_t **ptr, int *constructed, int *class)
Get the asn1 tag from the current ptr.
Definition: coap_asn1.c:35
asn1_len
size_t asn1_len(const uint8_t **ptr)
Get the asn1 length from the current ptr.
Definition: coap_asn1.c:14
coap_asn1_tag_t
coap_asn1_tag_t
Definition: coap_asn1_internal.h:28
get_asn1_tag
coap_binary_t * get_asn1_tag(coap_asn1_tag_t ltag, const uint8_t *ptr, size_t tlen, asn1_validate validate)
Get the asn1 tag and data from the current ptr.
Definition: coap_asn1.c:63
asn1_validate
int(* asn1_validate)(const uint8_t *data, size_t size)
Callback to validate the asn1 tag and data.
Definition: coap_asn1_internal.h:46
COAP_ASN1_NONE
@ COAP_ASN1_NONE
Definition: coap_asn1_internal.h:29
COAP_ASN1_OCTETSTRING
@ COAP_ASN1_OCTETSTRING
Definition: coap_asn1_internal.h:32
COAP_ASN1_INTEGER
@ COAP_ASN1_INTEGER
Definition: coap_asn1_internal.h:30
COAP_ASN1_BITSTRING
@ COAP_ASN1_BITSTRING
Definition: coap_asn1_internal.h:31
COAP_ASN1_IDENTIFIER
@ COAP_ASN1_IDENTIFIER
Definition: coap_asn1_internal.h:33
coap_binary_t
CoAP binary data definition.
Definition: str.h:50