merklepathasn1.h

Go to the documentation of this file.
00001 /**
00002  * @file ccn/merklepathasn1.h
00003  * 
00004  * ASN.1 support routines for dealing with the Merkle paths
00005  * encapsulated in the digest info.
00006  *
00007  * Copyright (C) 2009 Palo Alto Research Center, Inc.
00008  *
00009  * This library is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Lesser General Public License version 2.1
00011  * as published by the Free Software Foundation.
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015  * Lesser General Public License for more details. You should have received
00016  * a copy of the GNU Lesser General Public License along with this library;
00017  * if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
00018  * Fifth Floor, Boston, MA 02110-1301 USA.
00019  */
00020 
00021 #ifndef CCN_MERKLEPATHASN1_DEFINED
00022 #define CCN_MERKLEPATHASN1_DEFINED
00023 
00024 #include <openssl/asn1.h>
00025 #include <openssl/asn1t.h>
00026 #include <openssl/safestack.h>
00027 
00028 DECLARE_STACK_OF(ASN1_OCTET_STRING)
00029 /* 
00030  * we have to do this ourselves, since the OPENSSL code doesn't
00031  * use any stacks of ASN1_OCTET_STRING, so it is not predfined in safestack.h
00032  */
00033 #define sk_ASN1_OCTET_STRING_new(cmp) SKM_sk_new(ASN1_OCTET_STRING, (cmp))
00034 #define sk_ASN1_OCTET_STRING_new_null() SKM_sk_new_null(ASN1_OCTET_STRING)
00035 #define sk_ASN1_OCTET_STRING_free(st) SKM_sk_free(ASN1_OCTET_STRING, (st))
00036 #define sk_ASN1_OCTET_STRING_num(st) SKM_sk_num(ASN1_OCTET_STRING, (st))
00037 #define sk_ASN1_OCTET_STRING_value(st, i) SKM_sk_value(ASN1_OCTET_STRING, (st), (i))
00038 #define sk_ASN1_OCTET_STRING_set(st, i, val) SKM_sk_set(ASN1_OCTET_STRING, (st), (i), (val))
00039 #define sk_ASN1_OCTET_STRING_zero(st) SKM_sk_zero(ASN1_OCTET_STRING, (st))
00040 #define sk_ASN1_OCTET_STRING_push(st, val) SKM_sk_push(ASN1_OCTET_STRING, (st), (val))
00041 #define sk_ASN1_OCTET_STRING_unshift(st, val) SKM_sk_unshift(ASN1_OCTET_STRING, (st), (val))
00042 #define sk_ASN1_OCTET_STRING_find(st, val) SKM_sk_find(ASN1_OCTET_STRING, (st), (val))
00043 #define sk_ASN1_OCTET_STRING_find_ex(st, val) SKM_sk_find_ex(ASN1_OCTET_STRING, (st), (val))
00044 #define sk_ASN1_OCTET_STRING_delete(st, i) SKM_sk_delete(ASN1_OCTET_STRING, (st), (i))
00045 #define sk_ASN1_OCTET_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OCTET_STRING, (st), (ptr))
00046 #define sk_ASN1_OCTET_STRING_insert(st, val, i) SKM_sk_insert(ASN1_OCTET_STRING, (st), (val), (i))
00047 #define sk_ASN1_OCTET_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OCTET_STRING, (st), (cmp))
00048 #define sk_ASN1_OCTET_STRING_dup(st) SKM_sk_dup(ASN1_OCTET_STRING, st)
00049 #define sk_ASN1_OCTET_STRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OCTET_STRING, (st), (free_func))
00050 #define sk_ASN1_OCTET_STRING_shift(st) SKM_sk_shift(ASN1_OCTET_STRING, (st))
00051 #define sk_ASN1_OCTET_STRING_pop(st) SKM_sk_pop(ASN1_OCTET_STRING, (st))
00052 #define sk_ASN1_OCTET_STRING_sort(st) SKM_sk_sort(ASN1_OCTET_STRING, (st))
00053 #define sk_ASN1_OCTET_STRING_is_sorted(st) SKM_sk_is_sorted(ASN1_OCTET_STRING, (st))
00054 
00055 typedef struct MP_info_st {
00056     ASN1_INTEGER *node;
00057     STACK_OF(ASN1_OCTET_STRING) *hashes;
00058 } MP_info;
00059 
00060 DECLARE_ASN1_FUNCTIONS(MP_info)
00061 
00062 #endif
Generated on Fri May 13 16:27:02 2011 for Content-Centric Networking in C by  doxygen 1.6.3