summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Hagen <khagen@multi-development.com>2014-09-11 09:37:45 +0200
committerKim Hagen <khagen@multi-development.com>2014-09-11 09:37:45 +0200
commit3aa1c63a41eb6018dd7732a5c1f09f1963db886d (patch)
tree15a697af8d84bd7acf21feebe2c69c47d5620b50
parent27cf2ad45c843c08c4cd180f69611744391b1734 (diff)
downloadvyos-opennhrp-3aa1c63a41eb6018dd7732a5c1f09f1963db886d.tar.gz
vyos-opennhrp-3aa1c63a41eb6018dd7732a5c1f09f1963db886d.zip
Replace info to debug
-rw-r--r--nhrp/nhrp_common.h2
-rw-r--r--nhrp/nhrp_packet.c10
-rw-r--r--nhrp/nhrp_peer.c34
-rw-r--r--nhrp/nhrp_server.c22
-rw-r--r--nhrp/sysdep_netlink.c12
-rw-r--r--nhrp/sysdep_pfpacket.c2
6 files changed, 41 insertions, 41 deletions
diff --git a/nhrp/nhrp_common.h b/nhrp/nhrp_common.h
index 9422382..7e3a3c6 100644
--- a/nhrp/nhrp_common.h
+++ b/nhrp/nhrp_common.h
@@ -33,7 +33,7 @@ void nhrp_log(int level, const char *format, ...);
nhrp_log(NHRP_LOG_DEBUG, __VA_ARGS__); \
} while(0)
-#define nhrp_info(...) \
+#define nhrp_debug(...) \
nhrp_log(NHRP_LOG_INFO, __VA_ARGS__)
#define nhrp_error(...) \
diff --git a/nhrp/nhrp_packet.c b/nhrp/nhrp_packet.c
index 4edf392..3c06ada 100644
--- a/nhrp/nhrp_packet.c
+++ b/nhrp/nhrp_packet.c
@@ -240,7 +240,7 @@ void nhrp_payload_add_cie(struct nhrp_payload *payload, struct nhrp_cie *cie)
{
if (payload->payload_type != NHRP_PAYLOAD_TYPE_CIE_LIST) {
nhrp_cie_free(cie);
- nhrp_info("Trying to add CIE payload to non-CIE payload %d\n",
+ nhrp_debug("Trying to add CIE payload to non-CIE payload %d\n",
payload->payload_type);
return;
}
@@ -650,7 +650,7 @@ static int nhrp_packet_forward(struct nhrp_packet *packet)
char tmp[64], tmp2[64], tmp3[64];
struct nhrp_payload *p = NULL;
- nhrp_info("Forwarding packet from nbma src %s, proto src %s to proto dst %s, hop count %d",
+ nhrp_debug("Forwarding packet from nbma src %s, proto src %s to proto dst %s, hop count %d",
nhrp_address_format(&packet->src_nbma_address,
sizeof(tmp), tmp),
nhrp_address_format(&packet->src_protocol_address,
@@ -734,7 +734,7 @@ static int nhrp_packet_receive_local(struct nhrp_packet *packet)
}
/* Reply to unsent request? */
- nhrp_info("Packet type %d from nbma src %s, proto src %s, "
+ nhrp_debug("Packet type %d from nbma src %s, proto src %s, "
"proto dst %s dropped: no matching request",
packet->hdr.type,
nhrp_address_format(&packet->src_nbma_address,
@@ -750,7 +750,7 @@ static int nhrp_packet_receive_local(struct nhrp_packet *packet)
}
if (packet_types[packet->hdr.type].handler == NULL) {
- nhrp_info("Packet type %d from nbma src %s, proto src %s, "
+ nhrp_debug("Packet type %d from nbma src %s, proto src %s, "
"proto dst %s not supported",
packet->hdr.type,
nhrp_address_format(&packet->src_nbma_address,
@@ -1308,7 +1308,7 @@ int nhrp_packet_send_traffic(struct nhrp_interface *iface,
NHRP_EXTENSION_FLAG_COMPULSORY,
NHRP_PAYLOAD_TYPE_CIE_LIST);
- nhrp_info("Sending Traffic Indication about packet from %s to %s (to %s/%s)",
+ nhrp_debug("Sending Traffic Indication about packet from %s to %s (to %s/%s)",
nhrp_address_format(protocol_src, sizeof(tmp1), tmp1),
nhrp_address_format(protocol_dst, sizeof(tmp2), tmp2),
nhrp_address_format(&peer->protocol_address, sizeof(tmp3), tmp3),
diff --git a/nhrp/nhrp_peer.c b/nhrp/nhrp_peer.c
index 97bbe48..3154e17 100644
--- a/nhrp/nhrp_peer.c
+++ b/nhrp/nhrp_peer.c
@@ -513,7 +513,7 @@ static void nhrp_peer_script_route_up_done(union nhrp_peer_event e, int revents)
holding_time_to_expiry_time(peer->expire_time - ev_now(), 10),
nhrp_peer_expire_cb);
} else {
- nhrp_info("[%s] Route up script: %s; "
+ nhrp_debug("[%s] Route up script: %s; "
"adding negative cached entry",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp),
@@ -658,7 +658,7 @@ static void nhrp_peer_is_up(struct nhrp_peer *peer)
if (mcast) {
list_add(&peer->mcast_list_entry, &iface->mcast_list);
- nhrp_info("[%s] Peer inserted to multicast list",
+ nhrp_debug("[%s] Peer inserted to multicast list",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp));
}
@@ -762,7 +762,7 @@ static void nhrp_peer_address_query_cb(struct nhrp_address_query *query,
char host[64];
if (num_addr > 0) {
- nhrp_info("Resolved '%s' as %s",
+ nhrp_debug("Resolved '%s' as %s",
peer->nbma_hostname,
nhrp_address_format(&addrs[0], sizeof(host), host));
peer->next_hop_address = addrs[0];
@@ -837,7 +837,7 @@ static void nhrp_peer_send_protocol_purge(struct nhrp_peer *peer)
payload = nhrp_packet_payload(packet, NHRP_PAYLOAD_TYPE_CIE_LIST);
nhrp_payload_add_cie(payload, cie);
- nhrp_info("Sending Purge Request (of protocol address) to %s",
+ nhrp_debug("Sending Purge Request (of protocol address) to %s",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp));
@@ -938,7 +938,7 @@ static void nhrp_peer_handle_registration_reply(void *ctx,
if (reply == NULL ||
reply->hdr.type != NHRP_PACKET_REGISTRATION_REPLY) {
ec = reply ? reply->hdr.u.error.code : -1;
- nhrp_info("Failed to register to %s: %s (%d)",
+ nhrp_debug("Failed to register to %s: %s (%d)",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp),
nhrp_error_indication_text(ec), ntohs(ec));
@@ -970,7 +970,7 @@ static void nhrp_peer_handle_registration_reply(void *ctx,
ec = cie->hdr.code;
}
- nhrp_info("Received Registration Reply from %s: %s",
+ nhrp_debug("Received Registration Reply from %s: %s",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp),
nhrp_cie_code_text(ec));
@@ -995,7 +995,7 @@ static void nhrp_peer_handle_registration_reply(void *ctx,
if (payload != NULL) {
cie = nhrp_payload_get_cie(payload, 2);
if (cie != NULL) {
- nhrp_info("NAT detected: our real NBMA address is %s",
+ nhrp_debug("NAT detected: our real NBMA address is %s",
nhrp_address_format(&cie->nbma_address,
sizeof(tmp), tmp));
peer->interface->nat_cie = *cie;
@@ -1034,7 +1034,7 @@ static void nhrp_peer_handle_registration_reply(void *ctx,
NHRP_EXTENSION_FLAG_COMPULSORY,
NHRP_PAYLOAD_TYPE_CIE_LIST);
- nhrp_info("Sending Purge Request (of local routes) to %s",
+ nhrp_debug("Sending Purge Request (of local routes) to %s",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp));
@@ -1141,7 +1141,7 @@ static void nhrp_peer_send_register_cb(struct ev_timer *w, int revents)
NHRP_PAYLOAD_TYPE_CIE_LIST);
nhrp_payload_add_cie(payload, cie);
- nhrp_info("Sending Registration Request to %s (my mtu=%d)",
+ nhrp_debug("Sending Registration Request to %s (my mtu=%d)",
nhrp_address_format(&peer->protocol_address,
sizeof(dst), dst),
peer->my_nbma_mtu);
@@ -1182,7 +1182,7 @@ static void nhrp_peer_handle_resolution_reply(void *ctx,
reply->hdr.type != NHRP_PACKET_RESOLUTION_REPLY) {
ec = reply ? reply->hdr.u.error.code : -1;
- nhrp_info("Failed to resolve %s: %s (%d)",
+ nhrp_debug("Failed to resolve %s: %s (%d)",
nhrp_address_format(&peer->protocol_address,
sizeof(tmp), tmp),
nhrp_error_indication_text(ec), ntohs(ec));
@@ -1205,7 +1205,7 @@ static void nhrp_peer_handle_resolution_reply(void *ctx,
if (cie == NULL)
goto ret;
- nhrp_info("Received Resolution Reply %s/%d is at proto %s nbma %s",
+ nhrp_debug("Received Resolution Reply %s/%d is at proto %s nbma %s",
nhrp_address_format(&peer->protocol_address,
sizeof(dst), dst),
cie->hdr.prefix_length,
@@ -1223,7 +1223,7 @@ static void nhrp_peer_handle_resolution_reply(void *ctx,
natcie = list_next(&payload->u.cie_list, struct nhrp_cie, cie_list_entry);
if (natcie != NULL) {
natoacie = cie;
- nhrp_info("NAT detected: really at proto %s nbma %s",
+ nhrp_debug("NAT detected: really at proto %s nbma %s",
nhrp_address_format(&natcie->protocol_address,
sizeof(tmp), tmp),
nhrp_address_format(&natcie->nbma_address,
@@ -1343,7 +1343,7 @@ static void nhrp_peer_send_resolve(struct nhrp_peer *peer)
payload = nhrp_packet_payload(packet, NHRP_PAYLOAD_TYPE_CIE_LIST);
nhrp_payload_add_cie(payload, cie);
- nhrp_info("Sending Resolution Request to %s",
+ nhrp_debug("Sending Resolution Request to %s",
nhrp_address_format(&peer->protocol_address,
sizeof(dst), dst));
@@ -2096,7 +2096,7 @@ static int dump_peer(void *ctx, struct nhrp_peer *peer)
int *num_total = (int *) ctx;
char tmp[NHRP_PEER_FORMAT_LEN];
- nhrp_info("%s %s",
+ nhrp_debug("%s %s",
nhrp_peer_type[peer->type],
nhrp_peer_format(peer, sizeof(tmp), tmp));
(*num_total)++;
@@ -2107,9 +2107,9 @@ void nhrp_peer_dump_cache(void)
{
int num_total = 0;
- nhrp_info("Peer cache dump:");
+ nhrp_debug("Peer cache dump:");
nhrp_peer_foreach(dump_peer, &num_total, NULL);
- nhrp_info("Total %d peer cache entries, %d allocated entries",
+ nhrp_debug("Total %d peer cache entries, %d allocated entries",
num_total, nhrp_peer_num_total);
}
@@ -2121,7 +2121,7 @@ void nhrp_peer_cleanup(void)
while (nhrp_peer_num_total > 0) {
if (ev_now() > prev + 5.0) {
- nhrp_info("Waiting for peers to die, %d left", nhrp_peer_num_total);
+ nhrp_debug("Waiting for peers to die, %d left", nhrp_peer_num_total);
prev = ev_now();
}
ev_loop(EVLOOP_ONESHOT);
diff --git a/nhrp/nhrp_server.c b/nhrp/nhrp_server.c
index 8c35e1c..5e47ad3 100644
--- a/nhrp/nhrp_server.c
+++ b/nhrp/nhrp_server.c
@@ -100,7 +100,7 @@ static int nhrp_handle_resolution_request(struct nhrp_packet *packet)
struct nhrp_peer_selector sel;
struct nhrp_cie *cie;
- nhrp_info("Received Resolution Request from proto src %s to %s",
+ nhrp_debug("Received Resolution Request from proto src %s to %s",
nhrp_address_format(&packet->src_protocol_address,
sizeof(tmp), tmp),
nhrp_address_format(&packet->dst_protocol_address,
@@ -153,7 +153,7 @@ static int nhrp_handle_resolution_request(struct nhrp_packet *packet)
cie->nbma_address = peer->my_nbma_address;
cie->protocol_address = packet->dst_iface->protocol_address;
- nhrp_info("Sending Resolution Reply %s/%d is-at %s (holdtime %d)",
+ nhrp_debug("Sending Resolution Reply %s/%d is-at %s (holdtime %d)",
nhrp_address_format(&packet->dst_protocol_address,
sizeof(tmp), tmp),
cie->hdr.prefix_length,
@@ -204,7 +204,7 @@ static void nhrp_server_finish_reg(struct nhrp_pending_request *pr)
if (pr->rpeer != NULL &&
nhrp_packet_reroute(packet, pr->rpeer)) {
- nhrp_info("Sending Registration Reply from proto src %s to %s (%d bindings accepted, %d rejected)",
+ nhrp_debug("Sending Registration Reply from proto src %s to %s (%d bindings accepted, %d rejected)",
nhrp_address_format(&packet->dst_protocol_address,
sizeof(tmp), tmp),
nhrp_address_format(&packet->src_protocol_address,
@@ -215,7 +215,7 @@ static void nhrp_server_finish_reg(struct nhrp_pending_request *pr)
} else {
/* We could not create route peer entry (likely out of memory),
* so we can't do much more here. */
- nhrp_info("Dropping Registration Reply from proto src %s to %s",
+ nhrp_debug("Dropping Registration Reply from proto src %s to %s",
nhrp_address_format(&packet->dst_protocol_address,
sizeof(tmp), tmp),
nhrp_address_format(&packet->src_protocol_address,
@@ -362,14 +362,14 @@ static int nhrp_handle_registration_request(struct nhrp_packet *packet)
struct nhrp_pending_request *pr;
int natted = 0;
- nhrp_info("Received Registration Request from proto src %s to %s",
+ nhrp_debug("Received Registration Request from proto src %s to %s",
nhrp_address_format(&packet->src_protocol_address,
sizeof(tmp), tmp),
nhrp_address_format(&packet->dst_protocol_address,
sizeof(tmp2), tmp2));
if (nhrp_server_request_pending(packet)) {
- nhrp_info("Already processing: resent packet ignored.");
+ nhrp_debug("Already processing: resent packet ignored.");
return TRUE;
}
@@ -379,7 +379,7 @@ static int nhrp_handle_registration_request(struct nhrp_packet *packet)
* Indication. However, we do not have a direct peer entry
* nor can we make sure that the lower layer is up, so
* we just lamely drop the packet for now. */
- nhrp_info("Too many pending requests: dropping this one");
+ nhrp_debug("Too many pending requests: dropping this one");
return TRUE;
}
@@ -470,7 +470,7 @@ static int nhrp_handle_purge_request(struct nhrp_packet *packet)
struct nhrp_cie *cie;
int flags, ret = TRUE;
- nhrp_info("Received Purge Request from proto src %s to %s",
+ nhrp_debug("Received Purge Request from proto src %s to %s",
nhrp_address_format(&packet->src_protocol_address,
sizeof(tmp), tmp),
nhrp_address_format(&packet->dst_protocol_address,
@@ -490,7 +490,7 @@ static int nhrp_handle_purge_request(struct nhrp_packet *packet)
payload = nhrp_packet_payload(packet, NHRP_PAYLOAD_TYPE_CIE_LIST);
list_for_each_entry(cie, &payload->u.cie_list, cie_list_entry) {
- nhrp_info("Purge proto %s/%d nbma %s",
+ nhrp_debug("Purge proto %s/%d nbma %s",
nhrp_address_format(&cie->protocol_address,
sizeof(tmp), tmp),
cie->hdr.prefix_length,
@@ -529,7 +529,7 @@ static int nhrp_handle_traffic_indication(struct nhrp_packet *packet)
/* Shortcuts enabled? */
if (packet->src_iface->flags & NHRP_INTERFACE_FLAG_SHORTCUT) {
- nhrp_info("Traffic Indication from proto src %s; "
+ nhrp_debug("Traffic Indication from proto src %s; "
"about packet to %s",
nhrp_address_format(&packet->src_protocol_address,
sizeof(tmp), tmp),
@@ -539,7 +539,7 @@ static int nhrp_handle_traffic_indication(struct nhrp_packet *packet)
packet->hdr.afnum,
&dst);
} else {
- nhrp_info("Traffic Indication ignored from proto src %s; "
+ nhrp_debug("Traffic Indication ignored from proto src %s; "
"about packet to %s",
nhrp_address_format(&packet->src_protocol_address,
sizeof(tmp), tmp),
diff --git a/nhrp/sysdep_netlink.c b/nhrp/sysdep_netlink.c
index be529d8..9797b3e 100644
--- a/nhrp/sysdep_netlink.c
+++ b/nhrp/sysdep_netlink.c
@@ -153,7 +153,7 @@ static int netlink_receive(struct netlink_fd *fd, struct nlmsghdr *reply)
fd->dispatch[h->nlmsg_type] != NULL) {
fd->dispatch[h->nlmsg_type](h);
} else if (h->nlmsg_type != NLMSG_DONE) {
- nhrp_info("Unknown NLmsg: 0x%08x, len %d",
+ nhrp_debug("Unknown NLmsg: 0x%08x, len %d",
h->nlmsg_type, h->nlmsg_len);
}
h = NLMSG_NEXT(h, status);
@@ -459,11 +459,11 @@ static void netlink_link_new(struct nlmsghdr *msg)
if (((ifi->ifi_change & IFF_UP) || (iface->index == 0)) &&
(ifi->ifi_flags & IFF_UP)) {
- nhrp_info("Interface %s: configured UP, mtu=%d",
+ nhrp_debug("Interface %s: configured UP, mtu=%d",
ifname, iface->mtu);
nhrp_interface_run_script(iface, "interface-up");
} else {
- nhrp_info("Interface %s: config change, mtu=%d",
+ nhrp_debug("Interface %s: config change, mtu=%d",
ifname, iface->mtu);
}
@@ -503,7 +503,7 @@ static void netlink_link_new(struct nlmsghdr *msg)
* this works when there's only one GRE interface */
iface->link_index = 0;
nhrp_address_set_type(&iface->nbma_address, PF_UNSPEC);
- nhrp_info("WARNING: Cannot figure out NBMA address for "
+ nhrp_debug("WARNING: Cannot figure out NBMA address for "
"interface '%s'. Using route hints.", ifname);
}
}
@@ -534,7 +534,7 @@ static void netlink_link_new(struct nlmsghdr *msg)
sel.type_mask = NHRP_PEER_TYPEMASK_PURGEABLE;
sel.interface = iface;
nhrp_peer_foreach(nhrp_peer_purge_matching, &count, &sel);
- nhrp_info("Interface %s: GRE configuration changed. Purged %d peers.",
+ nhrp_debug("Interface %s: GRE configuration changed. Purged %d peers.",
ifname, count);
}
}
@@ -555,7 +555,7 @@ static void netlink_link_del(struct nlmsghdr *msg)
if (iface == NULL)
return;
- nhrp_info("Interface '%s' deleted", ifname);
+ nhrp_debug("Interface '%s' deleted", ifname);
iface->index = 0;
iface->link_index = 0;
nhrp_interface_hash(iface);
diff --git a/nhrp/sysdep_pfpacket.c b/nhrp/sysdep_pfpacket.c
index 9659dfd..efad73b 100644
--- a/nhrp/sysdep_pfpacket.c
+++ b/nhrp/sysdep_pfpacket.c
@@ -236,7 +236,7 @@ static void install_filter_cb(struct ev_timer *w, int revents)
&prog, sizeof(prog)))
nhrp_perror("Failed to install filter code");
else
- nhrp_info("Filter code installed (%d opcodes)", f.numops);
+ nhrp_debug("Filter code installed (%d opcodes)", f.numops);
free(f.code);
}