[sr-dev] git:master: ip_addr.h: logging: convert LOG to LM_*

Ovidiu Sas osas at voipembedded.com
Fri Oct 3 23:13:32 CEST 2014


Module: sip-router
Branch: master
Commit: 44f49c060217322e4469582073e728097313a851
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=44f49c060217322e4469582073e728097313a851

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date:   Fri Oct  3 17:13:26 2014 -0400

ip_addr.h: logging: convert LOG to LM_*

---

 ip_addr.h |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/ip_addr.h b/ip_addr.h
index 3cdecc6..2a08349 100644
--- a/ip_addr.h
+++ b/ip_addr.h
@@ -351,8 +351,7 @@ static inline void sockaddr2ip_addr(struct ip_addr* ip, struct sockaddr* sa)
 			memcpy(ip->u.addr, &((struct sockaddr_in6*)sa)->sin6_addr, 16);
 			break;
 	default:
-			LOG(L_CRIT, "sockaddr2ip_addr: BUG: unknown address family %d\n",
-					sa->sa_family);
+			LM_CRIT("unknown address family %d\n", sa->sa_family);
 	}
 }
 
@@ -378,8 +377,7 @@ static inline int su_cmp(const union sockaddr_union* s1,
 			return (s1->sin6.sin6_port==s2->sin6.sin6_port)&&
 					(memcmp(&s1->sin6.sin6_addr, &s2->sin6.sin6_addr, 16)==0);
 		default:
-			LOG(L_CRIT,"su_cmp: BUG: unknown address family %d\n",
-						s1->s.sa_family);
+			LM_CRIT("unknown address family %d\n", s1->s.sa_family);
 			return 0;
 	}
 }
@@ -395,8 +393,7 @@ static inline unsigned short su_getport(const union sockaddr_union* su)
 		case AF_INET6:
 			return ntohs(su->sin6.sin6_port);
 		default:
-			LOG(L_CRIT,"su_get_port: BUG: unknown address family %d\n",
-						su->s.sa_family);
+			LM_CRIT("unknown address family %d\n", su->s.sa_family);
 			return 0;
 	}
 }
@@ -414,8 +411,7 @@ static inline void su_setport(union sockaddr_union* su, unsigned short port)
 			 su->sin6.sin6_port=htons(port);
 			 break;
 		default:
-			LOG(L_CRIT,"su_set_port: BUG: unknown address family %d\n",
-						su->s.sa_family);
+			LM_CRIT("unknown address family %d\n", su->s.sa_family);
 	}
 }
 
@@ -436,8 +432,7 @@ static inline void su2ip_addr(struct ip_addr* ip, union sockaddr_union* su)
 					memcpy(ip->u.addr, &su->sin6.sin6_addr, 16);
 					break;
 	default:
-					LOG(L_CRIT,"su2ip_addr: BUG: unknown address family %d\n",
-							su->s.sa_family);
+					LM_CRIT("unknown address family %d\n", su->s.sa_family);
 	}
 }
 
@@ -470,7 +465,7 @@ static inline int init_su( union sockaddr_union* su,
 		su->sin.sin_port=htons(port);
 		break;
 	default:
-		LOG(L_CRIT, "init_ss: BUG: unknown address family %d\n", ip->af);
+		LM_CRIT("unknown address family %d\n", ip->af);
 		return -1;
 	}
 	return 0;
@@ -505,8 +500,7 @@ static inline int hostent2su( union sockaddr_union* su,
 		su->sin.sin_port=htons(port);
 		break;
 	default:
-		LOG(L_CRIT, "hostent2su: BUG: unknown address family %d\n", 
-				he->h_addrtype);
+		LM_CRIT("unknown address family %d\n", he->h_addrtype);
 		return -1;
 	}
 	return 0;
@@ -665,8 +659,7 @@ static inline int ip_addr2sbuf(struct ip_addr* ip, char* buff, int len)
 			return ip4tosbuf(ip->u.addr, buff, len);
 			break;
 		default:
-			LOG(L_CRIT, "BUG: ip_addr2sbuf: unknown address family %d\n",
-					ip->af);
+			LM_CRIT("unknown address family %d\n", ip->af);
 			return 0;
 	}
 	return 0;




More information about the sr-dev mailing list