Fixed make_adj_lsa_prefix_for_repo() in nlsr_lsdb.c
diff --git a/nlsr-sync-0.0/nlsr_lsdb.c b/nlsr-sync-0.0/nlsr_lsdb.c
index 5fc8833..de632bb 100755
--- a/nlsr-sync-0.0/nlsr_lsdb.c
+++ b/nlsr-sync-0.0/nlsr_lsdb.c
@@ -91,16 +91,20 @@
make_adj_lsa_prefix_for_repo(char *key, char *orig_router, int ls_type, char *orig_time,char *slice_prefix)
{
- char lst[2];
+/* char lst[2];
memset(lst,0,2);
- sprintf(lst,"%d",ls_type);
+ sprintf(lst,"%d",ls_type);
+
+
memcpy(key+strlen(key),slice_prefix,strlen(slice_prefix));
memcpy(key+strlen(key),"/",1);
memcpy(key+strlen(key),lst,strlen(lst));
memcpy(key+strlen(key),"/",1);
memcpy(key+strlen(key),orig_time,strlen(orig_time));
memcpy(key+strlen(key),orig_router,strlen(orig_router));
-
+*/
+ sprintf(key,"%s%d/%s%s",slice_prefix,ls_type, orig_time, orig_router);
+ printf("Key:%s\n",key);
}
void
@@ -693,7 +697,8 @@
char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
memset(key,0,adj_lsa->header->orig_router->length+2);
make_adj_lsa_key(key,adj_lsa);
-
+ 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,strlen(key)+1,0);
diff --git a/nlsr-sync-0.0/nlsrc.c b/nlsr-sync-0.0/nlsrc.c
index 44ce2ad..8943973 100755
--- a/nlsr-sync-0.0/nlsrc.c
+++ b/nlsr-sync-0.0/nlsrc.c
@@ -38,7 +38,7 @@
int len;
struct sockaddr_in address;
int result;
- int byteSend;
+ int bytesSent;
char *server_address, *server_port;
int command_len=0;
@@ -92,7 +92,8 @@
exit(1);
}
printf("Command to send: %s \n",command);
- byteSend=send(sockfd, command, strlen(command),0);
+ bytesSent=send(sockfd, command, strlen(command),0);
+ printf("Command len: %d, Bytes sent: %d \n",strlen(command), bytesSent);
recv(sockfd, recv_buffer, 1024, 0);
printf("%s\n",recv_buffer);
free(command);