Committer: Diego Biurrun <diego@xxxxxxxxxx> Date: 16/04/2010 at 04:31:00 Revision: 4319 Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: trunk Log: Remove disabled code from the lib/too/ directory. Modified: M lib/tool/lutil.c M lib/tool/pfkeysadb.c M lib/tool/pk.c M lib/tool/xfrmapi.c === modified file 'lib/tool/lutil.c' --- lib/tool/lutil.c 2010-04-15 16:57:50 +0000 +++ lib/tool/lutil.c 2010-04-16 01:30:31 +0000 @@ -192,39 +192,6 @@ return NULL; } -#if 0 -/** - * copy the given contents to the Nth element in the linked list - * - * @param ilist the linked list - * @param n denotes which Nth item to insert the contents - * @return NULL (on failure) or the a pointer to the contents - */ -char *setdataitem(List *ilist, int n, char *data) -{ - Listitem *ptr; - int count = 0; - - if (!ilist->head) { - return NULL; - } - ptr = ilist->head; - if (n == 0) { - return ptr->data; - } - while (ptr->next) { - ptr = ptr->next; - count++; - if (n == count) { - //memset(new->data, 0, MAX_ITEM_LEN); - strncpy(ptr->data, data, MAX_ITEM_LEN); - return ptr->data; - } - } - return NULL; -} -#endif /* 0 */ - /** * calculate difference between two timevalues * === modified file 'lib/tool/pfkeysadb.c' --- lib/tool/pfkeysadb.c 2010-04-09 16:24:44 +0000 +++ lib/tool/pfkeysadb.c 2010-04-16 01:30:31 +0000 @@ -66,8 +66,6 @@ xpl->sadb_x_policy_dir = direction; xpl->sadb_x_policy_id = 0; - //xpl->sadb_x_policy_priority = PRIORITY_DEFAULT; - if (cmd == SADB_X_SPDDELETE) { goto end; } === modified file 'lib/tool/pk.c' --- lib/tool/pk.c 2010-04-13 09:52:59 +0000 +++ lib/tool/pk.c 2010-04-16 01:30:31 +0000 @@ -127,7 +127,6 @@ HIP_IFEL(!(sig = hip_get_param(msg, HIP_PARAM_HIP_SIGNATURE2)), -ENOENT, "Could not find signature2\n"); - //ipv6_addr_copy(&tmpaddr, &msg->hitr); memset(&msg->hitr, 0, sizeof(struct in6_addr)); HIP_IFEL(!(pz = hip_get_param(msg, HIP_PARAM_PUZZLE)), @@ -142,15 +141,11 @@ -ENOENT, "Could not find signature\n"); } - //HIP_HEXDUMP("SIG", sig, hip_get_param_total_len(sig)); len = ((uint8_t *) sig) - ((uint8_t *) msg); hip_zero_msg_checksum(msg); HIP_IFEL(len < 0, -ENOENT, "Invalid signature len\n"); hip_set_msg_total_len(msg, len); - //HIP_HEXDUMP("Verifying:", msg, len); - //HIP_HEXDUMP("Pubkey:", peer_pub, hip_get_param_total_len(peer_pub)); - HIP_IFEL(hip_build_digest(HIP_DIGEST_SHA1, msg, len, sha1_digest), -1, "Could not calculate SHA1 digest\n"); if (rsa) { @@ -178,18 +173,6 @@ ipv6_addr_copy(&msg->hitr, &tmpaddr); -#if 0 - switch (err) { - case 0: - err = 0; - break; - case 1: - default: - err = -1; - break; - } -#endif - if (err) { err = -1; } === modified file 'lib/tool/xfrmapi.c' --- lib/tool/xfrmapi.c 2010-04-13 10:59:42 +0000 +++ lib/tool/xfrmapi.c 2010-04-16 01:30:31 +0000 @@ -145,12 +145,8 @@ } { - /*void *x = malloc(sizeof(req.n) * 10); - * memcpy(x, &req.n, sizeof(req.n));*/ HIP_IFEL((netlink_talk(rth, &req.n, 0, 0, NULL, NULL, NULL) < 0), -1, "netlink_talk failed\n"); - ///if (x) - //free(x); } out_err: @@ -246,10 +242,6 @@ /* SELECTOR <--> HITs */ HIP_IFE(xfrm_fill_selector(&req.xpid.sel, hit_peer, hit_our, 0, hit_prefix, 0, 0, preferred_family), -1); -/* - * if (req.xpid.sel.family == AF_UNSPEC) - * req.xpid.sel.family = AF_INET6; - */ HIP_IFEL((netlink_talk(rth, &req.n, 0, 0, NULL, NULL, NULL) < 0), -1, "No associated policies to be deleted\n"); @@ -317,8 +309,6 @@ req.xsinfo.mode = XFRM_MODE_BEET; req.xsinfo.id.proto = IPPROTO_ESP; - //memcpy(&req.xsinfo.saddr, saddr, sizeof(req.xsinfo.saddr)); - //memcpy(&req.xsinfo.id.daddr, daddr, sizeof(req.xsinfo.id.daddr)); req.xsinfo.id.spi = htonl(spi); /* Selector */ @@ -401,7 +391,6 @@ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.xsid)); req.n.nlmsg_flags = NLM_F_REQUEST; req.n.nlmsg_type = XFRM_MSG_DELSA; - //req.xsid.family = preferred_family; if (IN6_IS_ADDR_V4MAPPED(peer_addr)) { HIP_DEBUG("IPV4 SA deletion\n");