2 * Copyright (C) 2000-2014 Free Software Foundation, Inc.
4 * This file is part of LIBTASN1.
6 * The LIBTASN1 library is free software; you can redistribute it
7 * and/or modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 /***************************************/
26 /* Functions used by ASN.1 parser */
27 /***************************************/
28 asn1_node _asn1_add_static_node (unsigned int type);
31 _asn1_set_value (asn1_node node, const void *value, unsigned int len);
33 asn1_node _asn1_set_value_m (asn1_node node, void *value, unsigned int len);
36 _asn1_set_value_lv (asn1_node node, const void *value, unsigned int len);
39 _asn1_append_value (asn1_node node, const void *value, unsigned int len);
41 asn1_node _asn1_set_name (asn1_node node, const char *name);
43 asn1_node _asn1_cpy_name (asn1_node dst, asn1_node src);
45 asn1_node _asn1_set_right (asn1_node node, asn1_node right);
47 asn1_node _asn1_get_last_right (asn1_node node);
49 void _asn1_remove_node (asn1_node node, unsigned int flags);
51 void _asn1_delete_list (void);
53 void _asn1_delete_list_and_nodes (void);
55 #define LTOSTR_MAX_SIZE 20
56 char *_asn1_ltostr (long v, char *str);
58 asn1_node _asn1_find_up (asn1_node node);
60 inline static asn1_node _asn1_get_up(asn1_node node)
65 return _asn1_find_up(node);
68 int _asn1_change_integer_value (asn1_node node);
70 int _asn1_expand_object_id (asn1_node node);
72 int _asn1_type_set_config (asn1_node node);
74 int _asn1_check_identifier (asn1_node node);
76 int _asn1_set_default_tag (asn1_node node);
78 /******************************************************************/
79 /* Function : _asn1_get_right */
80 /* Description: returns the element pointed by the RIGHT field of */
81 /* a NODE_ASN element. */
83 /* node: NODE_ASN element pointer. */
84 /* Return: field RIGHT of NODE. */
85 /******************************************************************/
86 inline static asn1_node
87 _asn1_get_right (asn1_node node)
94 /******************************************************************/
95 /* Function : _asn1_set_down */
96 /* Description: sets the field DOWN in a NODE_ASN element. */
98 /* node: element pointer. */
99 /* down: pointer to a NODE_ASN element that you want be pointed */
101 /* Return: pointer to *NODE. */
102 /******************************************************************/
103 inline static asn1_node
104 _asn1_set_down (asn1_node node, asn1_node down)
117 /******************************************************************/
118 /* Function : _asn1_get_down */
119 /* Description: returns the element pointed by the DOWN field of */
120 /* a NODE_ASN element. */
122 /* node: NODE_ASN element pointer. */
123 /* Return: field DOWN of NODE. */
124 /******************************************************************/
125 inline static asn1_node
126 _asn1_get_down (asn1_node node)
133 /******************************************************************/
134 /* Function : _asn1_get_name */
135 /* Description: returns the name of a NODE_ASN element. */
137 /* node: NODE_ASN element pointer. */
138 /* Return: a null terminated string. */
139 /******************************************************************/
141 _asn1_get_name (asn1_node node)
148 /******************************************************************/
149 /* Function : _asn1_mod_type */
150 /* Description: change the field TYPE of an NODE_ASN element. */
151 /* The new value is the old one | (bitwise or) the */
152 /* paramener VALUE. */
154 /* node: NODE_ASN element pointer. */
155 /* value: the integer value that must be or-ed with the current */
156 /* value of field TYPE. */
157 /* Return: NODE pointer. */
158 /******************************************************************/
159 inline static asn1_node
160 _asn1_mod_type (asn1_node node, unsigned int value)