From cf828486ae511a6e6599f1a1b14d63c7d13fd845 Mon Sep 17 00:00:00 2001 From: Christopher Scherb Date: Thu, 6 Feb 2014 15:54:44 +0100 Subject: [PATCH] Add thunk detection --- ccnl-core.c | 2 +- ccnl-ext-nfn.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ccnl-core.c b/ccnl-core.c index 6652bac7fa94..95c2e01b4fc0 100644 --- a/ccnl-core.c +++ b/ccnl-core.c @@ -888,7 +888,7 @@ ccnl_core_RX_i_or_c(struct ccnl_relay_s *relay, struct ccnl_face_s *from, //NFN PLUGIN CALL #ifdef CCNL_NFN if(!memcmp(p->comp[p->compcnt-1], "NFN", 3)){ - ccnl_nfn(); + ccnl_nfn(relay, buf, p, from); goto Done; } #endif /*CCNL_NFN*/ diff --git a/ccnl-ext-nfn.c b/ccnl-ext-nfn.c index e044c9f312a3..33258c2c62f8 100644 --- a/ccnl-ext-nfn.c +++ b/ccnl-ext-nfn.c @@ -20,9 +20,17 @@ * 2014-02-06 created */ +#include "ccnl-core.h" int -ccnl_nfn(){ - DEBUGMSG(49, "ccnl_nfn()\n"); +ccnl_nfn(struct ccnl_relay_s *ccnl, struct ccnl_buf_s *orig, + struct ccnl_prefix_s *prefix, struct ccnl_face_s *from) +{ + DEBUGMSG(49, "ccnl_nfn(%p, %p, %p, %p)\n", ccnl, orig, prefix, from); DEBUGMSG(99, "NFN-engine\n"); + if(!memcmp(prefix->comp[prefix->compcnt-2], "THUNK", 5)) + { + DEBUGMSG(99, " Thunk-request\n"); + } + } \ No newline at end of file