Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove cis tlv from ccn-lite #228

Merged
merged 1 commit into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Featue | Description
`USE_SCHEDULER` | Rate control at CCNx msg and fragment level.
`USE_SIGNATURES` | Authenticate management messages.
`USE_STATS` | Enable statistics.
`USE_SUITE_*` | Enable a specific protocol: CCNB, NDNTLV (NDN 2014), CCNTLV (CCNx2014), LOCALRPC or CISTLV (Cisco 2015) and COMPRESSED (for packet compression)
`USE_SUITE_*` | Enable a specific protocol: CCNB, NDNTLV (NDN 2014), CCNTLV (CCNx2014), or LOCALRPC and COMPRESSED (for packet compression)
`USE_UNIXSOCKET` | Add UNIX IPC to the set of interfaces.

The approach for these extensions is that one can tailor a CCN forwarder to
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ set(CCNL_PACKETFORMAT_FLAGS
-DUSE_SUITE_NDNTLV
-DUSE_SUITE_CCNB
-DUSE_SUITE_CCNTLV
-DUSE_SUITE_CISTLV
-DUSE_SUITE_LOCALRPC
CACHE PATH
"packet format flags for CCN-lite"
Expand Down
8 changes: 4 additions & 4 deletions src/build-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ endif
# Get effective user id (0 for root)
EUID:=$(shell sh -c 'id -u')

PKT_FORMATS:=ccnb ccntlv cistlv ndntlv
SUITES:=ccnb ccnx2015 cisco2015 ndn2013
PKT_FORMATS:=ccnb ccntlv ndntlv
SUITES:=ccnb ccnx2015 ndn2013
BT_RELAY:=bt-relay-nothing \
bt-relay-barebones \
bt-relay-vanilla \
Expand Down Expand Up @@ -78,7 +78,7 @@ bt-relay-nothing:
USE_ECHO USE_LINKLAYER USE_HMAC256 USE_HTTP_STATUS USE_IPV4 USE_IPV6 \
USE_MGMT USE_NACK USE_NFN USE_NFN_NSTRANS USE_NFN_MONITOR \
USE_SCHEDULER USE_STATS USE_SUITE_CCNB USE_SUITE_CCNTLV \
USE_SUITE_CISTLV USE_SUITE_NDNTLV USE_SUITE_LOCALRPC \
USE_SUITE_NDNTLV USE_SUITE_LOCALRPC \
USE_UNIXSOCKET" \
./build-test-helper.sh || ${PRINT_LOG}

Expand All @@ -92,7 +92,7 @@ bt-relay-barebones:
UNSET_VARS="USE_CCNxDIGEST USE_DEBUG USE_DEBUG_MALLOC USE_ECHO \
USE_LINKLAYER USE_HMAC256 USE_HTTP_STATUS USE_MGMT \
USE_NACK USE_NFN USE_NFN_NSTRANS USE_NFN_MONITOR USE_SCHEDULER \
USE_STATS USE_SUITE_CCNB USE_SUITE_CCNTLV USE_SUITE_CISTLV \
USE_STATS USE_SUITE_CCNB USE_SUITE_CCNTLV \
USE_SUITE_LOCALRPC USE_UNIXSOCKET" \
./build-test-helper.sh || ${PRINT_LOG}

Expand Down
5 changes: 2 additions & 3 deletions src/ccn-lite-simu.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
//#define USE_SCHEDULER
#define USE_SUITE_CCNB
#define USE_SUITE_CCNTLV
#define USE_SUITE_CISTLV
#define USE_SUITE_NDNTLV

#define NEEDS_PREFIX_MATCHING
Expand Down Expand Up @@ -261,7 +260,7 @@ ccnl_app_RX(struct ccnl_relay_s *ccnl, struct ccnl_content_s *c)
char tmp[200], tmp2[10];
struct ccnl_prefix_s *p = c->pkt->pfx;

if (theSuite == CCNL_SUITE_CCNTLV || theSuite == CCNL_SUITE_CISTLV) {
if (theSuite == CCNL_SUITE_CCNTLV ) {
tmp[0] = '\0';
for (i = 0; i < p->compcnt-1; i++) {
strcat((char*)tmp, "/");
Expand Down Expand Up @@ -612,7 +611,7 @@ main(int argc, char **argv)
" [-g MIN_INTER_PACKET_INTERVAL]\n"
" [-i MIN_INTER_CCNMSG_INTERVAL]\n"
" [-m MTU]\n"
" [-s SUITE (ccnb, ccnx2015, cisco2015, ndn2013)]\n"
" [-s SUITE (ccnb, ccnx2015, ndn2013)]\n"
" [-v DEBUG_LEVEL]\n",
argv[0]);
exit(EXIT_FAILURE);
Expand Down
1 change: 0 additions & 1 deletion src/ccnl-android/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ set(CCNL_PACKETFORMAT_FLAGS
-DUSE_SUITE_NDNTLV
-DUSE_SUITE_CCNB
-DUSE_SUITE_CCNTLV
-DUSE_SUITE_CISTLV
-DUSE_SUITE_LOCALRPC
CACHE PATH
"packet format flags for CCN-lite"
Expand Down
1 change: 0 additions & 1 deletion src/ccnl-android/native/include/ccn-lite-android.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#include "ccnl-pkt-ccnb.h"
#include "ccnl-pkt-ccntlv.h"
#include "ccnl-pkt-cistlv.h"
#include "ccnl-pkt-ndntlv.h"
#include "ccnl-pkt-switch.h"
#include "ccnl-dispatch.h"
Expand Down
16 changes: 0 additions & 16 deletions src/ccnl-android/native/src/ccn-lite-android.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,22 +399,6 @@ ccnl_populate_cache(struct ccnl_relay_s *ccnl, char *path)
break;
}
#endif
#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV: {
int hdrlen;
unsigned char *start;

data = start = buf->data + skip;
datalen -= skip;

hdrlen = ccnl_cistlv_getHdrLen(data, datalen);
data += hdrlen;
datalen -= hdrlen;

pk = ccnl_cistlv_bytes2pkt(start, &data, &datalen);
break;
}
#endif
#ifdef USE_SUITE_NDNTLV
case CCNL_SUITE_NDNTLV: {
unsigned char *olddata;
Expand Down
6 changes: 1 addition & 5 deletions src/ccnl-core/include/ccnl-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ enum {
#ifdef USE_SUITE_CCNTLV
CCNL_SUITE_CCNTLV = 2,
#endif
#ifdef USE_SUITE_CISTLV
CCNL_SUITE_CISTLV = 3,
#endif
#ifdef USE_SUITE_LOCALRPC
CCNL_SUITE_LOCALRPC = 5,
#endif
Expand Down Expand Up @@ -130,8 +127,7 @@ typedef enum ccnl_enc_e {
CCNL_ENC_CCNB, /**< encoding for CCN */
CCNL_ENC_NDN2013, /**< NDN encoding (version 2013) */
CCNL_ENC_CCNX2014, /**< CCNx encoding (version 2014) */
CCNL_ENC_LOCALRPC, /**< encoding type for local rpc mechanism */
CCNL_ENC_CISCO2015 /**< 2015 version of the Cisco packet format */
CCNL_ENC_LOCALRPC /**< encoding type for local rpc mechanism */
} ccnl_enc;

// ----------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions src/ccnl-core/src/ccnl-interest.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ ccnl_interest_isSame(struct ccnl_interest_s *i, struct ccnl_pkt_s *pkt)
#endif
#ifdef USE_SUITE_CCNTLV
case CCNL_SUITE_CCNTLV:
#endif
#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV:
#endif
default:
break;
Expand Down
27 changes: 0 additions & 27 deletions src/ccnl-core/src/ccnl-pkt-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "ccnl-os-time.h"
#include "ccnl-pkt-ccnb.h"
#include "ccnl-pkt-ccntlv.h"
#include "ccnl-pkt-cistlv.h"
#include "ccnl-pkt-ndntlv.h"
#include "ccnl-pkt-switch.h"
#include "ccnl-logging.h"
Expand All @@ -35,7 +34,6 @@
#include <ccnl-os-time.h>
#include <ccnl-pkt-ccnb.h>
#include <ccnl-pkt-ccntlv.h>
#include <ccnl-pkt-cistlv.h>
#include <ccnl-pkt-ndntlv.h>
#include <ccnl-pkt-switch.h>
#include <ccnl-logging.h>
Expand All @@ -55,10 +53,6 @@ ccnl_str2suite(char *cp)
if (!strcmp(cp, CONSTSTR("ccnx2015")))
return CCNL_SUITE_CCNTLV;
#endif
#ifdef USE_SUITE_CISTLV
if (!strcmp(cp, CONSTSTR("cisco2015")))
return CCNL_SUITE_CISTLV;
#endif
#ifdef USE_SUITE_LOCALRPC
if (!strcmp(cp, CONSTSTR("localrpc")))
return CCNL_SUITE_LOCALRPC;
Expand All @@ -81,10 +75,6 @@ ccnl_suite2str(int suite)
if (suite == CCNL_SUITE_CCNTLV)
return CONSTSTR("ccnx2015");
#endif
#ifdef USE_SUITE_CISTLV
if (suite == CCNL_SUITE_CISTLV)
return CONSTSTR("cisco2015");
#endif
#ifdef USE_SUITE_LOCALRPC
if (suite == CCNL_SUITE_LOCALRPC)
return CONSTSTR("localrpc");
Expand All @@ -107,10 +97,6 @@ ccnl_suite2defaultPort(int suite)
if (suite == CCNL_SUITE_CCNTLV)
return CCN_UDP_PORT;
#endif
#ifdef USE_SUITE_CISTLV
if (suite == CCNL_SUITE_CISTLV)
return CCN_UDP_PORT;
#endif
#ifdef USE_SUITE_NDNTLV
if (suite == CCNL_SUITE_NDNTLV)
return NDN_UDP_PORT;
Expand All @@ -129,10 +115,6 @@ ccnl_isSuite(int suite)
if (suite == CCNL_SUITE_CCNTLV)
return true;
#endif
#ifdef USE_SUITE_CISTLV
if (suite == CCNL_SUITE_CISTLV)
return true;
#endif
#ifdef USE_SUITE_LOCALRPC
if (suite == CCNL_SUITE_LOCALRPC)
return true;
Expand Down Expand Up @@ -186,15 +168,6 @@ ccnl_pkt2suite(unsigned char *data, int len, int *skip)
}
#endif

#ifdef USE_SUITE_CISTLV
if (data[0] == CISCO_TLV_V1 && len > 1) {
if (data[1] == CISCO_PT_Interest ||
data[1] == CISCO_PT_Content ||
data[1] == CISCO_PT_Nack)
return CCNL_SUITE_CISTLV;
}
#endif

#ifdef USE_SUITE_NDNTLV
if (*data == NDN_TLV_Interest || *data == NDN_TLV_Data ||
*data == NDN_TLV_Fragment)
Expand Down
30 changes: 0 additions & 30 deletions src/ccnl-core/src/ccnl-pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "ccnl-os-time.h"
#include "ccnl-defs.h"
#include "ccnl-pkt-cistlv.h"
#include "ccnl-pkt-ccntlv.h"

#include "ccnl-prefix.h"
Expand Down Expand Up @@ -55,9 +54,6 @@ ccnl_pkt_free(struct ccnl_pkt_s *pkt)
ccnl_free(pkt->s.ndntlv.ppkl);
break;
#endif
#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV:
#endif
#ifdef USE_SUITE_LOCALRPC
case CCNL_SUITE_LOCALRPC:
#endif
Expand Down Expand Up @@ -103,9 +99,6 @@ ccnl_pkt_dup(struct ccnl_pkt_s *pkt){
ret->s.ndntlv.ppkl = buf_dup(pkt->s.ndntlv.ppkl);
break;
#endif
#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV:
#endif
#ifdef USE_SUITE_LOCALRPC
case CCNL_SUITE_LOCALRPC:
#endif
Expand Down Expand Up @@ -143,17 +136,6 @@ ccnl_pkt_mkComponent(int suite, unsigned char *dst, char *src, int srclen)
len += 2*sizeof(unsigned short);
break;
}
#endif
#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV: {
unsigned short *sp = (unsigned short*) dst;
*sp++ = htons(CISCO_TLV_NameComponent);
len = srclen;
*sp++ = htons(len);
memcpy(sp, src, len);
len += 2*sizeof(unsigned short);
break;
}
#endif
default:
len = srclen;
Expand Down Expand Up @@ -187,18 +169,6 @@ ccnl_pkt_prependComponent(int suite, char *src, int *offset, unsigned char *buf)
*offset -= 2*sizeof(unsigned short);
}
#endif
#ifdef USE_SUITE_CISTLV
if (suite == CCNL_SUITE_CISTLV) {
unsigned short *sp = (unsigned short*) (buf + *offset) - 1;
if (*offset < 4)
return -1;
*sp-- = htons(len);
*sp = htons(CISCO_TLV_NameComponent);
len += 2*sizeof(unsigned short);
*offset -= 2*sizeof(unsigned short);
}
#endif

return len;
}

30 changes: 1 addition & 29 deletions src/ccnl-core/src/ccnl-prefix.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#ifndef CCNL_LINUXKERNEL
#include "ccnl-prefix.h"
#include "ccnl-pkt-ndntlv.h"
#include "ccnl-pkt-cistlv.h"
#include "ccnl-pkt-ccntlv.h"
#ifdef USE_NFN
#include "ccnl-nfn-requests.h"
Expand All @@ -39,7 +38,6 @@
#else //CCNL_LINUXKERNEL
#include <ccnl-prefix.h>
#include <ccnl-pkt-ndntlv.h>
#include <ccnl-pkt-cistlv.h>
#include <ccnl-pkt-ccntlv.h>
#endif //CCNL_LINUXKERNEL

Expand Down Expand Up @@ -207,25 +205,6 @@ ccnl_prefix_addChunkNum(struct ccnl_prefix_s *prefix, unsigned int chunknum)
break;
#endif

#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV: {
unsigned char cmp[5];
// TODO: this only works for chunknums smaller than 255
cmp[0] = 0;
cmp[1] = CISCO_TLV_NameSegment;
cmp[2] = 0;
cmp[3] = 1;
cmp[4] = chunknum;
if (ccnl_prefix_appendCmp(prefix, cmp, 5) < 0)
return -1;
if (prefix->chunknum)
ccnl_free(prefix->chunknum);
prefix->chunknum = (int*) ccnl_malloc(sizeof(int));
*prefix->chunknum = chunknum;
}
break;
#endif

default:
DEBUGMSG_CUTL(WARNING,
"add chunk number not implemented for suite %d\n",
Expand Down Expand Up @@ -327,10 +306,6 @@ ccnl_URItoPrefix(char* uri, int suite, char *nfnexpr, unsigned int *chunknum)
if (suite == CCNL_SUITE_CCNTLV)
len += cnt * 4; // add TL size
#endif
#ifdef USE_SUITE_CISTLV
if (suite == CCNL_SUITE_CISTLV)
len += cnt * 4; // add TL size
#endif

p->bytes = (unsigned char*) ccnl_malloc(len);
if (!p->bytes) {
Expand Down Expand Up @@ -626,17 +601,14 @@ ccnl_prefix_to_str_detailed(struct ccnl_prefix_s *pr, int ccntlv_skip, int escap

int skip = 0;

#if (defined(USE_SUITE_CCNTLV) || defined(USE_SUITE_CISTLV)) // && defined(USE_NFN)
#if defined(USE_SUITE_CCNTLV) // && defined(USE_NFN)
// In the future it is possibly helpful to see the type information
// in the logging output. However, this does not work with NFN because
// it uses this function to create the names in NFN expressions
// resulting in CCNTLV type information names within expressions.
if (ccntlv_skip && (0
#ifdef USE_SUITE_CCNTLV
|| pr->suite == CCNL_SUITE_CCNTLV
#endif
#ifdef USE_SUITE_CISTLV
|| pr->suite == CCNL_SUITE_CISTLV
#endif
))
skip = 4;
Expand Down
9 changes: 0 additions & 9 deletions src/ccnl-core/src/ccnl-relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,6 @@ ccnl_content_serve_pending(struct ccnl_relay_s *ccnl, struct ccnl_content_s *c)
}
break;
#endif
#ifdef USE_SUITE_CISTLV
case CCNL_SUITE_CISTLV:
if (ccnl_prefix_cmp(c->pkt->pfx, NULL, i->pkt->pfx, CMP_EXACT)) {
// XX must also check keyid
i = i->next;
continue;
}
break;
#endif
#ifdef USE_SUITE_NDNTLV
case CCNL_SUITE_NDNTLV:
if (!ccnl_i_prefixof_c(i->pkt->pfx, i->pkt->s.ndntlv.minsuffix,
Expand Down
16 changes: 0 additions & 16 deletions src/ccnl-fwd/include/ccnl-fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,6 @@ ccnl_ccntlv_forwarder(struct ccnl_relay_s *relay, struct ccnl_face_s *from,
unsigned char **data, int *datalen);
#endif // USE_SUITE_CCNTLV

#ifdef USE_SUITE_CISTLV
/**
* @brief process one CISTLV packet (CISTLV forwarding pipeline)
*
* @param[in] relay pointer to current ccnl relay
* @param[in] from face on which the message was received
* @param[in] data data which were received
* @param[in] datalen length of the received data
*
* @return < 0 if no bytes consumed or error
*/
int
ccnl_cistlv_forwarder(struct ccnl_relay_s *relay, struct ccnl_face_s *from,
unsigned char **data, int *datalen);
#endif // USE_SUITE_CISTLV

#ifdef USE_SUITE_NDNTLV
/**
* @brief process one NDNTLV packet (NDN forwarding pipeline)
Expand Down
Loading