2013-10-28 10:25:17 +01:00
|
|
|
/*
|
|
|
|
* @f ccnl-riot.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013, Christian Mehlis, Freie Universität Berlin
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2013-11-07 03:51:59 +01:00
|
|
|
/**
|
|
|
|
* @defgroup ccnl CCN lite
|
|
|
|
* @ingroup net
|
|
|
|
* @brief CCN-lite, a lightweight implementation of the Content Centric
|
|
|
|
* Networking Protocol of XEROX Parc
|
|
|
|
*
|
|
|
|
* @see <a href="http://www.ccnx.org/releases/latest/doc/technical/CCNxProtocol.html">
|
|
|
|
* CCNx Protocol
|
|
|
|
* </a>
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
* @file
|
|
|
|
* @brief CCN lite interface
|
2014-01-27 20:43:54 +01:00
|
|
|
* @author Christian Mehlis <mehlis@inf.fu-berlin.de>
|
2013-11-07 03:51:59 +01:00
|
|
|
*/
|
2013-10-28 10:25:17 +01:00
|
|
|
#ifndef RIOT_CCN_COMPAT_H_
|
|
|
|
#define RIOT_CCN_COMPAT_H_
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include "transceiver.h"
|
|
|
|
|
2014-04-10 22:36:58 +02:00
|
|
|
#define TRANSCEIVER TRANSCEIVER_DEFAULT
|
2013-10-28 10:25:17 +01:00
|
|
|
|
|
|
|
#define CCNL_RIOT_EVENT_NUMBER_OFFSET (1 << 8)
|
|
|
|
typedef enum ccnl_riot_event {
|
|
|
|
CCNL_RIOT_MSG = CCNL_RIOT_EVENT_NUMBER_OFFSET + 1,
|
|
|
|
CCNL_RIOT_HALT,
|
|
|
|
CCNL_RIOT_POPULATE,
|
2013-12-04 01:12:19 +01:00
|
|
|
CCNL_RIOT_PRINT_STAT,
|
2013-12-03 23:30:23 +01:00
|
|
|
CCNL_RIOT_TIMEOUT,
|
2013-12-18 19:31:38 +01:00
|
|
|
CCNL_RIOT_NACK,
|
2013-10-28 10:25:17 +01:00
|
|
|
|
|
|
|
CCNL_RIOT_RESERVED
|
|
|
|
} ccnl_riot_event_t;
|
|
|
|
|
2013-11-21 10:18:41 +01:00
|
|
|
#define CCNL_HEADER_SIZE (40)
|
|
|
|
|
|
|
|
#ifdef MODULE_NATIVENET
|
|
|
|
/*
|
|
|
|
* static content for testing ccn get has this chunk size
|
|
|
|
* this test (populate + interest /riot/text) current works
|
|
|
|
* only on transceiver which can handle ~130 bytes
|
|
|
|
*/
|
|
|
|
# define CCNL_RIOT_CHUNK_SIZE (90)
|
|
|
|
#else
|
|
|
|
# define CCNL_RIOT_CHUNK_SIZE (PAYLOAD_SIZE - CCNL_HEADER_SIZE)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2013-10-28 10:25:17 +01:00
|
|
|
|
|
|
|
/**
|
2013-11-07 03:51:59 +01:00
|
|
|
* @brief starts the ccnl relay
|
2013-10-28 10:25:17 +01:00
|
|
|
*
|
2013-11-07 03:51:59 +01:00
|
|
|
* @note to stop the relay send msg "RIOT_HALT" to this thread
|
2013-11-27 17:02:06 +01:00
|
|
|
*
|
|
|
|
* @param max_cache_entries number of slots in the CS
|
2013-11-29 22:42:56 +01:00
|
|
|
* @param fib_threshold_prefix conservative value how long a common prefix is (elemnts from behind)
|
|
|
|
* @param fib_threshold_aggregate optimistic value how long a common prefix is (elemnts from front)
|
2013-10-28 10:25:17 +01:00
|
|
|
*/
|
2013-11-29 22:42:56 +01:00
|
|
|
void ccnl_riot_relay_start(int max_cache_entries, int fib_threshold_prefix, int fib_threshold_aggregate);
|
2013-10-28 10:25:17 +01:00
|
|
|
|
|
|
|
/**
|
2013-11-07 03:51:59 +01:00
|
|
|
* @brief starts an appication server, which can repy to ccn interests
|
2013-10-28 10:25:17 +01:00
|
|
|
*
|
|
|
|
* @param relay_pid the pid of the relay
|
|
|
|
*/
|
|
|
|
void ccnl_riot_appserver_start(int relay_pid);
|
|
|
|
|
2013-11-07 03:51:59 +01:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
2013-10-28 10:25:17 +01:00
|
|
|
#endif /* RIOT_CCN_COMPAT_H_ */
|