Committer: Tim Just <tim.just@xxxxxxxxxxxxxx> Date: Tue Mar 09 16:27:31 2010 +0100 Revision: 3644 Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Branch nick: tiny Log: Moved debug macros and minor style changes. Modified: M hipd/hipd.c M lib/core/message.c === modified file 'hipd/hipd.c' --- hipd/hipd.c 2010-03-09 14:57:05 +0000 +++ hipd/hipd.c 2010-03-09 15:27:31 +0000 @@ -376,7 +376,7 @@ goto to_maintenance; } #ifdef CONFIG_HIP_PERFORMANCE - if (bench_set) { //1 = true; 0 = false + if (bench_set) { HIP_DEBUG("Stop and write PERF_ALL\n"); hip_perf_stop_benchmark(perf_set, PERF_ALL); hip_perf_write_benchmark(perf_set, PERF_ALL); @@ -385,19 +385,15 @@ #endif #ifdef CONFIG_HIP_PERFORMANCE - HIP_DEBUG("Start PERF_ALL\n"); - bench_set = 1; //1 = true; 0 = false - hip_perf_start_benchmark(perf_set, PERF_ALL); + HIP_DEBUG("Start PERF_ALL\n"); + bench_set = 1; + hip_perf_start_benchmark(perf_set, PERF_ALL); #endif if (FD_ISSET(hip_raw_sock_input_v6, &read_fdset)) { - /* Receiving of a raw HIP message from IPv6 socket. */ hip_msg_init(packet_ctx.input_msg); - HIP_DEBUG("Receiving a message on raw HIP from " \ - "IPv6/HIP socket (file descriptor: %d).\n", - hip_raw_sock_input_v6); if (hip_read_control_msg_v6(hip_raw_sock_input_v6, &packet_ctx, 0)) { @@ -411,15 +407,9 @@ } if (FD_ISSET(hip_raw_sock_input_v4, &read_fdset)) { - HIP_DEBUG("HIP RAW SOCKET\n"); - /* Receiving of a raw HIP message from IPv4 socket. */ - HIP_DEBUG("Receiving a message on raw HIP from " \ - "IPv4/HIP socket (file descriptor: %d).\n", - hip_raw_sock_input_v4); + hip_msg_init(packet_ctx.input_msg); - HIP_DEBUG("Getting a msg on v4\n"); - /* Assuming that IPv4 header does not include any - * options */ + if (hip_read_control_msg_v4(hip_raw_sock_input_v4, &packet_ctx, IPV4_HDR_SIZE)) { @@ -433,17 +423,10 @@ } if (FD_ISSET(hip_nat_sock_input_udp, &read_fdset)) { - /* Data structures for storing the source and - * destination addresses and ports of the incoming - * packet. */ - - /* Receiving of a UDP message from NAT socket. */ HIP_DEBUG("Receiving a message on UDP from NAT " \ "socket (file descriptor: %d).\n", hip_nat_sock_input_udp); - /* Initialization of the hip_common header struct. We'll - * store the HIP header data here. */ hip_msg_init(packet_ctx.input_msg); err = hip_read_control_msg_v4(hip_nat_sock_input_udp, @@ -451,19 +434,14 @@ HIP_UDP_ZERO_BYTES_LEN); if (err) { HIP_ERROR("Reading network msg failed\n"); - /* If the values were read in successfully, we - * do the UDP specific stuff next. */ } else { err = hip_receive_udp_control_packet(&packet_ctx); } } if (FD_ISSET(hip_user_sock, &read_fdset)) { - /* Receiving of a message from user socket. */ struct sockaddr_in6 app_src; - HIP_DEBUG("Receiving user message.\n"); - hip_msg_init(packet_ctx.input_msg); if (hip_read_user_control_msg(hip_user_sock, === modified file 'lib/core/message.c' --- lib/core/message.c 2010-03-09 15:11:22 +0000 +++ lib/core/message.c 2010-03-09 15:27:31 +0000 @@ -492,6 +492,8 @@ int err = 0, bytes = 0, total; socklen_t len; + HIP_DEBUG("Receiving user message.\n"); + memset(saddr, 0, sizeof(*saddr)); len = sizeof(*saddr); @@ -699,6 +701,8 @@ struct hip_packet_context *packet_ctx, int encap_hdr_size) { + HIP_DEBUG("Receiving a message on raw HIP from IPv6/HIP socket "\ + " (file descriptor: %d).\n", socket); return hip_read_control_msg_all(socket, packet_ctx, encap_hdr_size, 0); } @@ -717,5 +721,7 @@ struct hip_packet_context *packet_ctx, int encap_hdr_size) { + HIP_DEBUG("Receiving a message on raw HIP from IPv4/HIP socket "\ + " (file descriptor: %d).\n", socket); return hip_read_control_msg_all(socket, packet_ctx, encap_hdr_size, 1); }