Not Adding Adj LSA to Repo
diff --git a/nlsr-sync-0.0/nlsr_lsdb.c b/nlsr-sync-0.0/nlsr_lsdb.c
index 1ceffa5..855566c 100755
--- a/nlsr-sync-0.0/nlsr_lsdb.c
+++ b/nlsr-sync-0.0/nlsr_lsdb.c
@@ -681,7 +681,7 @@
printf("Adj LSA Repo Key: %s \n",repo_con_name);
char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
- memset(key,0,adj_lsa->header->orig_router->length+2);
+ memset(key,0,adj_lsa->header->orig_router->length+2+2);
make_adj_lsa_key(key,adj_lsa);
if ( nlsr->debugging )
printf("Adj LSA: %s \n",key);
@@ -694,6 +694,35 @@
write_adj_lsa_to_repo(repo_con_name, lsaid);
*/
+
+ char *repo_key=(char *)malloc(strlen(nlsr->slice_prefix)+strlen(adj_lsa->header->orig_time)+strlen(adj_lsa->header->orig_router->name) + strlen(lst) + 5);
+ memset(repo_key, 0, strlen(nlsr->slice_prefix)+strlen(adj_lsa->header->orig_time)+strlen(adj_lsa->header->orig_router->name) + strlen(lst) + 5);
+ make_adj_lsa_prefix_for_repo(repo_key, adj_lsa->header->orig_router->name,LS_TYPE_ADJ,adj_lsa->header->orig_time,nlsr->slice_prefix);
+
+ if ( nlsr->debugging )
+ printf("Adj LSA Repo Key: %s \n",repo_key);
+
+ char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
+ memset(key,0,adj_lsa->header->orig_router->length+2+2);
+ make_adj_lsa_key(key,adj_lsa);
+ if ( nlsr->debugging )
+ printf("Adj LSA: %s \n",key);
+
+ struct name_prefix *lsaid=(struct name_prefix *)malloc(sizeof(struct name_prefix));
+ lsaid->name=(char *)malloc(strlen(key)+1);
+ memset(lsaid->name, 0, strlen(key)+1);
+ memcpy(lsaid->name,key,strlen(key));
+ lsaid->length=strlen(key)+1;
+
+
+ //write_adj_lsa_to_repo(repo_key, lsaid);
+
+ free(key);
+ free(repo_key);
+ free(lsaid->name);
+ free(lsaid);
+
+
free(adj_lsa->header->orig_router->name);
free(adj_lsa->header->orig_router);
@@ -2052,14 +2081,14 @@
write_adj_lsa_to_repo(char *repo_content_prefix, struct name_prefix *lsa_id)
{
if ( nlsr->debugging )
- printf("write_adj_lsa_to_repo \n");
+ printf("write_adj_lsa_to_repo called\n");
if ( nlsr->debugging )
printf("Content Prefix: %s\n",repo_content_prefix);
struct ccn_charbuf *lsa_data=ccn_charbuf_create();
get_adj_lsa_data(lsa_data,lsa_id);
if ( nlsr->debugging )
- printf("Name LSA Data: %s \n",ccn_charbuf_as_string(lsa_data));
+ printf("Adj LSA Data: %s \n",ccn_charbuf_as_string(lsa_data));
write_data_to_repo(ccn_charbuf_as_string(lsa_data), repo_content_prefix);
@@ -2069,11 +2098,16 @@
void
write_name_lsa_to_repo(char *repo_content_prefix, struct name_prefix *lsa_id)
{
- printf("Content Prefix: %s\n",repo_content_prefix);
+ if ( nlsr->debugging )
+ printf("write_name_lsa_to_repo called\n");
+ if ( nlsr->debugging )
+ printf("Content Prefix: %s\n",repo_content_prefix);
struct ccn_charbuf *lsa_data=ccn_charbuf_create();
get_name_lsa_data(lsa_data,lsa_id);
- printf("Name LSA Data: %s \n",ccn_charbuf_as_string(lsa_data));
+
+ if ( nlsr->debugging )
+ printf("Name LSA Data: %s \n",ccn_charbuf_as_string(lsa_data));
write_data_to_repo(ccn_charbuf_as_string(lsa_data), repo_content_prefix);