Przeglądaj źródła

modules/tcpops: renamed functions to prevent conflicts

Camille Oudot 10 lat temu
rodzic
commit
927de0d6fc
3 zmienionych plików z 20 dodań i 20 usunięć
  1. 6 6
      modules/tcpops/tcpops.c
  2. 4 4
      modules/tcpops/tcpops.h
  3. 10 10
      modules/tcpops/tcpops_mod.c

+ 6 - 6
modules/tcpops/tcpops.c

@@ -39,7 +39,7 @@
  * @return 1 on success, 0 on failure
  *
  */
-int get_current_fd(int conid, int *fd)
+int tcpops_get_current_fd(int conid, int *fd)
 {
 	struct tcp_connection *s_con;
 	if (unlikely((s_con = tcpconn_get(conid, 0, 0, 0, 0)) == NULL)) {
@@ -62,7 +62,7 @@ int get_current_fd(int conid, int *fd)
  * @return 1 on success, 0 on failure
  *
  */
-int acquire_fd_from_tcpmain(int conid, int *fd)
+int tcpops_acquire_fd_from_tcpmain(int conid, int *fd)
 {
 	struct tcp_connection *s_con, *tmp;
 	long msg[2];
@@ -98,20 +98,20 @@ error_release:
 #if !defined(HAVE_SO_KEEPALIVE) || !defined(HAVE_TCP_KEEPIDLE) || !defined(HAVE_TCP_KEEPCNT) || !defined(HAVE_TCP_KEEPINTVL)
 	#warning "TCP keepalive is not fully supported by your platform"
 
-int tcp_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
+int tcpops_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
 {
 	LM_ERR("tcp_keepalive_enable() failed: this module does not support your platform\n");
 	return -1;
 }
 
-int tcp_keepalive_disable(int fd, int closefd)
+int tcpops_keepalive_disable(int fd, int closefd)
 {
 	LM_ERR("tcp_keepalive_disable() failed: this module does not support your platform\n");
 	return -1;
 }
 #else
 
-int tcp_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
+int tcpops_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
 {
 	static const int enable = 1;
 	int ret = -1;
@@ -148,7 +148,7 @@ int tcp_keepalive_enable(int fd, int idle, int count, int interval, int closefd)
 	return ret;
 }
 
-int tcp_keepalive_disable(int fd, int closefd)
+int tcpops_keepalive_disable(int fd, int closefd)
 {
 	static const int disable = 0;
 	int ret = -1;

+ 4 - 4
modules/tcpops/tcpops.h

@@ -24,9 +24,9 @@
 #ifndef TCP_KEEPALIVE_H_
 #define TCP_KEEPALIVE_H_
 
-int get_current_fd(int conid, int *fd);
-int acquire_fd_from_tcpmain(int conid, int *fd);
-int tcp_keepalive_enable(int fd, int idle, int count, int interval, int closefd);
-int tcp_keepalive_disable(int fd, int closefd);
+int tcpops_get_current_fd(int conid, int *fd);
+int tcpops_acquire_fd_from_tcpmain(int conid, int *fd);
+int tcpops_keepalive_enable(int fd, int idle, int count, int interval, int closefd);
+int tcpops_keepalive_disable(int fd, int closefd);
 
 #endif /* TCP_KEEPALIVE_H_ */

+ 10 - 10
modules/tcpops/tcpops_mod.c

@@ -126,11 +126,11 @@ static int w_tcp_keepalive_enable4(sip_msg_t* msg, char* con, char* idle, char *
 	_IVALUE (con)
 
 	if (msg != NULL && msg->rcv.proto_reserved1 == i_con) {
-		if (!get_current_fd(msg->rcv.proto_reserved1, &fd)) {
+		if (!tcpops_get_current_fd(msg->rcv.proto_reserved1, &fd)) {
 			return -1;
 		}
 	} else {
-		if (!acquire_fd_from_tcpmain(i_con, &fd)) {
+		if (!tcpops_acquire_fd_from_tcpmain(i_con, &fd)) {
 			return -1;
 		}
 		closefd = 1;
@@ -140,7 +140,7 @@ static int w_tcp_keepalive_enable4(sip_msg_t* msg, char* con, char* idle, char *
 	_IVALUE (cnt)
 	_IVALUE (intvl)
 
-	return tcp_keepalive_enable(fd, i_idle, i_cnt, i_intvl, closefd);
+	return tcpops_keepalive_enable(fd, i_idle, i_cnt, i_intvl, closefd);
 
 }
 
@@ -152,7 +152,7 @@ static int w_tcp_keepalive_enable3(sip_msg_t* msg, char* idle, char *cnt, char *
 		return -1;
 	}
 
-	if (!get_current_fd(msg->rcv.proto_reserved1, &fd)) {
+	if (!tcpops_get_current_fd(msg->rcv.proto_reserved1, &fd)) {
 		return -1;
 	}
 
@@ -160,7 +160,7 @@ static int w_tcp_keepalive_enable3(sip_msg_t* msg, char* idle, char *cnt, char *
 	_IVALUE (cnt)
 	_IVALUE (intvl)
 
-	return tcp_keepalive_enable(fd, i_idle, i_cnt, i_intvl, 0);
+	return tcpops_keepalive_enable(fd, i_idle, i_cnt, i_intvl, 0);
 }
 
 static int w_tcp_keepalive_disable1(sip_msg_t* msg, char* con)
@@ -171,17 +171,17 @@ static int w_tcp_keepalive_disable1(sip_msg_t* msg, char* con)
 	_IVALUE (con)
 
 	if (msg != NULL && msg->rcv.proto_reserved1 == i_con) {
-		if (!get_current_fd(msg->rcv.proto_reserved1, &fd)) {
+		if (!tcpops_get_current_fd(msg->rcv.proto_reserved1, &fd)) {
 			return -1;
 		}
 	} else {
-		if (!acquire_fd_from_tcpmain(i_con, &fd)) {
+		if (!tcpops_acquire_fd_from_tcpmain(i_con, &fd)) {
 			return -1;
 		}
 		closefd = 1;
 	}
 
-	return tcp_keepalive_disable(fd, closefd);
+	return tcpops_keepalive_disable(fd, closefd);
 }
 
 static int w_tcp_keepalive_disable0(sip_msg_t* msg)
@@ -191,11 +191,11 @@ static int w_tcp_keepalive_disable0(sip_msg_t* msg)
 	if (msg == NULL)
 		return -1;
 
-	if (!get_current_fd(msg->rcv.proto_reserved1, &fd)) {
+	if (!tcpops_get_current_fd(msg->rcv.proto_reserved1, &fd)) {
 		return -1;
 	}
 
-	return tcp_keepalive_disable(fd, 0);
+	return tcpops_keepalive_disable(fd, 0);
 }
 
 /**