Browse Source

Export parse_phostport function to modules.

Function parse_phostport was originally defined static in file.c, some
of kamailio modules use the function and so we re-define it as public
and add a declaration to header file socket_info.h
Jan Janak 16 years ago
parent
commit
537ce843fd
2 changed files with 5 additions and 2 deletions
  1. 2 2
      main.c
  2. 3 0
      socket_info.h

+ 2 - 2
main.c

@@ -958,8 +958,8 @@ error:
  * returns  fills proto, port, host and returns list of addresses on success
  * (pkg malloc'ed) and 0 on failure
  */
-static struct name_lst* parse_phostport(char* s, char** host, int* hlen,
-										int* port, int* proto)
+struct name_lst* parse_phostport(char* s, char** host, int* hlen,
+								 int* port, int* proto)
 {
 	char* first; /* first ':' occurrence */
 	char* second; /* second ':' occurrence */

+ 3 - 0
socket_info.h

@@ -90,6 +90,9 @@ struct socket_info* find_si(struct ip_addr* ip, unsigned short port,
 
 struct socket_info** get_sock_info_list(unsigned short proto);
 
+struct name_lst* parse_phostport(char* s, char** host, int* hlen,
+								 int* port, int* proto);
+
 /* helper function:
  * returns next protocol, if the last one is reached return 0
  * useful for cycling on the supported protocols