00001 /** 00002 * Copyright (C) 2009,2010 Palo Alto Research Center, Inc. 00003 * 00004 * This work is free software; you can redistribute it and/or modify it under 00005 * the terms of the GNU General Public License version 2 as published by the 00006 * Free Software Foundation. 00007 * This work is distributed in the hope that it will be useful, but WITHOUT ANY 00008 * WARRANTY; without even the implied warranty of MERCHANTABILITY or 00009 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00010 * for more details. You should have received a copy of the GNU General Public 00011 * License along with this program; if not, write to the 00012 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00013 * Boston, MA 02110-1301, USA. 00014 */ 00015 00016 /** 00017 * This module replaces ccnd_main on the android platform. It includes the 00018 * methods a JNI interface would use to start ccnd. 00019 */ 00020 00021 #include <stdarg.h> 00022 #include <android/log.h> 00023 #include <ccnd_private.h> 00024 00025 static int 00026 logger(void *loggerdata, const char *format, va_list ap) 00027 { 00028 __android_log_vprint(ANDROID_LOG_INFO, "CCND", format, ap); 00029 } 00030 00031 int 00032 start_ccnd(void) 00033 { 00034 struct ccnd_handle *h = NULL; 00035 00036 h = ccnd_create("ccnd", &logger, NULL); 00037 ccnd_msg(h, "ccnd_create h=%p", h); 00038 ccnd_run(h); 00039 ccnd_msg(h, "exiting."); 00040 }