Browse code

ip_addr.c: logging: convert LOG to LM_*

Ovidiu Sas authored on 03/10/2014 21:15:35
Showing 1 changed files
... ...
@@ -59,13 +59,13 @@ struct net* mk_new_net(struct ip_addr* ip, struct ip_addr* mask)
59 59
 	
60 60
 	warning=0;
61 61
 	if ((ip->af != mask->af) || (ip->len != mask->len)){
62
-		LOG(L_CRIT, "ERROR: mk_net: trying to use a different mask family"
62
+		LM_CRIT("trying to use a different mask family"
63 63
 				" (eg. ipv4/ipv6mask or ipv6/ipv4mask)\n");
64 64
 		goto error;
65 65
 	}
66 66
 	n=(struct net*)pkg_malloc(sizeof(struct net));
67 67
 	if (n==0){ 
68
-		LOG(L_CRIT, "ERROR: mk_net: memory allocation failure\n");
68
+		LM_CRIT("memory allocation failure\n");
69 69
 		goto error;
70 70
 	}
71 71
 	n->ip=*ip;
... ...
@@ -75,7 +75,7 @@ struct net* mk_new_net(struct ip_addr* ip, struct ip_addr* mask)
75 75
 		if (n->ip.u.addr32[r]!=ip->u.addr32[r]) warning=1;
76 76
 	};
77 77
 	if (warning){
78
-		LOG(L_WARN, "WARNING: mk_net: invalid network address/netmask "
78
+		LM_WARN("invalid network address/netmask "
79 79
 					"combination fixed...\n");
80 80
 		print_ip("original network address:", ip, "/");
81 81
 		print_ip("", mask, "\n");
... ...
@@ -95,7 +95,7 @@ struct net* mk_new_net_bitlen(struct ip_addr* ip, unsigned int bitlen)
95 95
 	int r;
96 96
 	
97 97
 	if (bitlen>ip->len*8){
98
-		LOG(L_CRIT, "ERROR: mk_net_bitlen: bad bitlen number %d\n", bitlen);
98
+		LM_CRIT("bad bitlen number %d\n", bitlen);
99 99
 		goto error;
100 100
 	}
101 101
 	memset(&mask,0, sizeof(mask));
... ...
@@ -292,7 +292,7 @@ void stdout_print_ip(struct ip_addr* ip)
292 292
 void print_net(struct net* net)
293 293
 {
294 294
 	if (net==0){
295
-		LOG(L_WARN, "ERROR: print net: null pointer\n");
295
+		LM_WARN("null pointer\n");
296 296
 		return;
297 297
 	}
298 298
 	print_ip("", &net->ip, "/"); print_ip("", &net->mask, "");
... ...
@@ -305,7 +305,7 @@ void print_net(struct net* net)
305 305
 int is_mcast(struct ip_addr* ip)
306 306
 {
307 307
 	if (!ip){
308
-		LOG(L_ERR, "ERROR: is_mcast: Invalid parameter value\n");
308
+		LM_ERR("Invalid parameter value\n");
309 309
 		return -1;
310 310
 	}
311 311
 
... ...
@@ -314,7 +314,7 @@ int is_mcast(struct ip_addr* ip)
314 314
 	} else if (ip->af==AF_INET6){
315 315
 		return IN6_IS_ADDR_MULTICAST((struct in6_addr*)ip->u.addr32);
316 316
 	} else {
317
-		LOG(L_ERR, "ERROR: is_mcast: Unsupported protocol family\n");
317
+		LM_ERR("Unsupported protocol family\n");
318 318
 		return -1;
319 319
 	}
320 320
 }