Browse code

ip_addr.h: logging: convert LOG to LM_*

Ovidiu Sas authored on 03/10/2014 21:13:26
Showing 1 changed files
... ...
@@ -351,8 +351,7 @@ static inline void sockaddr2ip_addr(struct ip_addr* ip, struct sockaddr* sa)
351 351
 			memcpy(ip->u.addr, &((struct sockaddr_in6*)sa)->sin6_addr, 16);
352 352
 			break;
353 353
 	default:
354
-			LOG(L_CRIT, "sockaddr2ip_addr: BUG: unknown address family %d\n",
355
-					sa->sa_family);
354
+			LM_CRIT("unknown address family %d\n", sa->sa_family);
356 355
 	}
357 356
 }
358 357
 
... ...
@@ -378,8 +377,7 @@ static inline int su_cmp(const union sockaddr_union* s1,
378 377
 			return (s1->sin6.sin6_port==s2->sin6.sin6_port)&&
379 378
 					(memcmp(&s1->sin6.sin6_addr, &s2->sin6.sin6_addr, 16)==0);
380 379
 		default:
381
-			LOG(L_CRIT,"su_cmp: BUG: unknown address family %d\n",
382
-						s1->s.sa_family);
380
+			LM_CRIT("unknown address family %d\n", s1->s.sa_family);
383 381
 			return 0;
384 382
 	}
385 383
 }
... ...
@@ -395,8 +393,7 @@ static inline unsigned short su_getport(const union sockaddr_union* su)
395 393
 		case AF_INET6:
396 394
 			return ntohs(su->sin6.sin6_port);
397 395
 		default:
398
-			LOG(L_CRIT,"su_get_port: BUG: unknown address family %d\n",
399
-						su->s.sa_family);
396
+			LM_CRIT("unknown address family %d\n", su->s.sa_family);
400 397
 			return 0;
401 398
 	}
402 399
 }
... ...
@@ -414,8 +411,7 @@ static inline void su_setport(union sockaddr_union* su, unsigned short port)
414 411
 			 su->sin6.sin6_port=htons(port);
415 412
 			 break;
416 413
 		default:
417
-			LOG(L_CRIT,"su_set_port: BUG: unknown address family %d\n",
418
-						su->s.sa_family);
414
+			LM_CRIT("unknown address family %d\n", su->s.sa_family);
419 415
 	}
420 416
 }
421 417
 
... ...
@@ -436,8 +432,7 @@ static inline void su2ip_addr(struct ip_addr* ip, union sockaddr_union* su)
436 432
 					memcpy(ip->u.addr, &su->sin6.sin6_addr, 16);
437 433
 					break;
438 434
 	default:
439
-					LOG(L_CRIT,"su2ip_addr: BUG: unknown address family %d\n",
440
-							su->s.sa_family);
435
+					LM_CRIT("unknown address family %d\n", su->s.sa_family);
441 436
 	}
442 437
 }
443 438
 
... ...
@@ -470,7 +465,7 @@ static inline int init_su( union sockaddr_union* su,
470 465
 		su->sin.sin_port=htons(port);
471 466
 		break;
472 467
 	default:
473
-		LOG(L_CRIT, "init_ss: BUG: unknown address family %d\n", ip->af);
468
+		LM_CRIT("unknown address family %d\n", ip->af);
474 469
 		return -1;
475 470
 	}
476 471
 	return 0;
... ...
@@ -505,8 +500,7 @@ static inline int hostent2su( union sockaddr_union* su,
505 500
 		su->sin.sin_port=htons(port);
506 501
 		break;
507 502
 	default:
508
-		LOG(L_CRIT, "hostent2su: BUG: unknown address family %d\n", 
509
-				he->h_addrtype);
503
+		LM_CRIT("unknown address family %d\n", he->h_addrtype);
510 504
 		return -1;
511 505
 	}
512 506
 	return 0;
... ...
@@ -665,8 +659,7 @@ static inline int ip_addr2sbuf(struct ip_addr* ip, char* buff, int len)
665 659
 			return ip4tosbuf(ip->u.addr, buff, len);
666 660
 			break;
667 661
 		default:
668
-			LOG(L_CRIT, "BUG: ip_addr2sbuf: unknown address family %d\n",
669
-					ip->af);
662
+			LM_CRIT("unknown address family %d\n", ip->af);
670 663
 			return 0;
671 664
 	}
672 665
 	return 0;