00001 /** 00002 * @file ccn/header.h 00003 * 00004 * Part of the CCNx C Library. 00005 * 00006 * Copyright (C) 2009 Palo Alto Research Center, Inc. 00007 * 00008 * This library is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU Lesser General Public License version 2.1 00010 * as published by the Free Software Foundation. 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. You should have received 00015 * a copy of the GNU Lesser General Public License along with this library; 00016 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, 00017 * Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 #ifndef CCN_HEADER_DEFINED 00021 #define CCN_HEADER_DEFINED 00022 00023 #include <stddef.h> 00024 #include <ccn/charbuf.h> 00025 00026 struct ccn_header { 00027 uintmax_t start; 00028 uintmax_t count; 00029 uintmax_t block_size; 00030 uintmax_t length; 00031 struct ccn_charbuf *root_digest; 00032 struct ccn_charbuf *content_digest; 00033 }; 00034 00035 struct ccn_header *ccn_header_parse(const unsigned char *, size_t); 00036 00037 void ccn_header_destroy(struct ccn_header **); 00038 00039 int ccnb_append_header(struct ccn_charbuf *, const struct ccn_header *); 00040 00041 struct ccn_header *ccn_get_header(struct ccn *, struct ccn_charbuf *, int); 00042 00043 #endif