00001 /** 00002 * @file reg_mgmt.h 00003 * 00004 * Part of the CCNx C Library. 00005 * 00006 * Copyright (C) 2009-2011 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_REG_MGMT_DEFINED 00021 #define CCN_REG_MGMT_DEFINED 00022 00023 #include <stddef.h> 00024 #include <ccn/charbuf.h> 00025 00026 struct ccn_forwarding_entry { 00027 const char *action; 00028 struct ccn_charbuf *name_prefix; 00029 const unsigned char *ccnd_id; 00030 size_t ccnd_id_size; 00031 unsigned faceid; 00032 int flags; 00033 int lifetime; 00034 unsigned char store[48]; 00035 }; 00036 00037 /** Refer to doc/technical/Registration.txt for the meaning of these flags */ 00038 #define CCN_FORW_ACTIVE 1 00039 #define CCN_FORW_CHILD_INHERIT 2 00040 #define CCN_FORW_ADVERTISE 4 00041 #define CCN_FORW_LAST 8 00042 #define CCN_FORW_CAPTURE 16 00043 #define CCN_FORW_LOCAL 32 00044 #define CCN_FORW_TAP 64 00045 #define CCN_FORW_CAPTURE_OK 128 00046 #define CCN_FORW_PUBMASK (CCN_FORW_ACTIVE | \ 00047 CCN_FORW_CHILD_INHERIT | \ 00048 CCN_FORW_ADVERTISE | \ 00049 CCN_FORW_LAST | \ 00050 CCN_FORW_CAPTURE | \ 00051 CCN_FORW_LOCAL | \ 00052 CCN_FORW_TAP | \ 00053 CCN_FORW_CAPTURE_OK ) 00054 00055 struct ccn_forwarding_entry * 00056 ccn_forwarding_entry_parse(const unsigned char *p, size_t size); 00057 00058 void ccn_forwarding_entry_destroy(struct ccn_forwarding_entry**); 00059 00060 int ccnb_append_forwarding_entry(struct ccn_charbuf *, 00061 const struct ccn_forwarding_entry*); 00062 00063 00064 #endif