Browse code

kamcmd: removed svn ids, history

Daniel-Constantin Mierla authored on 13/01/2017 07:58:54
Showing 4 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /*
2 2
  * Copyright (C) 2006 iptelorg GmbH
3 3
  *
4
- * This file is part of kamailio, a free SIP server.
4
+ * This file is part of kamcmd, a free cli tool for Kamailio SIP server.
5 5
  *
6 6
  * kamailio is free software; you can redistribute it and/or modify
7 7
  * it under the terms of the GNU General Public License as published by
... ...
@@ -176,7 +176,7 @@ static inline char* int2str(unsigned int l, int* len)
176 176
 {
177 177
 	static char r[INT2STR_MAX_LEN];
178 178
 	int i;
179
-	
179
+
180 180
 	i=INT2STR_MAX_LEN-2;
181 181
 	r[INT2STR_MAX_LEN-1]=0; /* null terminate */
182 182
 	do{
... ...
@@ -196,11 +196,11 @@ static inline char* int2str(unsigned int l, int* len)
196 196
 static char* trim_ws(char* l)
197 197
 {
198 198
 	char* ret;
199
-	
199
+
200 200
 	for(;*l && ((*l==' ')||(*l=='\t')||(*l=='\n')||(*l=='\r')); l++);
201 201
 	ret=l;
202 202
 	if (*ret==0) return ret;
203
-	for(l=l+strlen(l)-1; (l>ret) && 
203
+	for(l=l+strlen(l)-1; (l>ret) &&
204 204
 			((*l==' ')||(*l=='\t')||(*l=='\n')||(*l=='\r')); l--);
205 205
 	*(l+1)=0;
206 206
 	return ret;
... ...
@@ -353,7 +353,7 @@ static int parse_arg(struct binrpc_val* v, char* arg)
353 353
 	double f;
354 354
 	char* tmp;
355 355
 	int len;
356
-	
356
+
357 357
 	i=strtol(arg, &tmp, 10);
358 358
 	if ((tmp==0) || (*tmp)){
359 359
 		f=strtod(arg, &tmp);
... ...
@@ -385,7 +385,7 @@ static int parse_arg(struct binrpc_val* v, char* arg)
385 385
 static int parse_cmd(struct binrpc_cmd* cmd, char** argv, int count)
386 386
 {
387 387
 	int r;
388
-	
388
+
389 389
 	cmd->method=argv[0];
390 390
 	if ((count-1)>MAX_BINRPC_ARGS){
391 391
 		fprintf(stderr,  "ERROR: too many args %d, only %d allowed\n",
... ...
@@ -444,7 +444,7 @@ int connect_unix_sock(char* name, int type)
444 444
 	int len;
445 445
 	int ret;
446 446
 	int retries;
447
-	
447
+
448 448
 	retries=0;
449 449
 	s=-1;
450 450
 	memset(&ifsun, 0, sizeof (struct sockaddr_un));
... ...
@@ -472,7 +472,7 @@ int connect_unix_sock(char* name, int type)
472 472
 				sock_dir="/tmp";
473 473
 retry:
474 474
 			ret=snprintf(mysun.sun_path, UNIX_PATH_MAX, "%s/" NAME "_%d",
475
-							sock_dir, rand()); 
475
+							sock_dir, rand());
476 476
 			if ((ret<0) ||(ret>=UNIX_PATH_MAX)){
477 477
 				fprintf(stderr, "ERROR: buffer overflow while trying to"
478 478
 							"generate unix datagram socket name");
... ...
@@ -519,7 +519,7 @@ int connect_tcpudp_socket(char* address, int port, int type)
519 519
 	struct sockaddr_in addr;
520 520
 	struct hostent* he;
521 521
 	int sock;
522
-	
522
+
523 523
 	sock=-1;
524 524
 	/* resolve destination */
525 525
 	he=gethostbyname(address);
... ...
@@ -531,7 +531,7 @@ int connect_tcpudp_socket(char* address, int port, int type)
531 531
 	addr.sin_family=he->h_addrtype;
532 532
 	addr.sin_port=htons(port);
533 533
 	memcpy(&addr.sin_addr.s_addr, he->h_addr_list[0], he->h_length);
534
-	
534
+
535 535
 	sock = socket(he->h_addrtype, type, 0);
536 536
 	if (sock==-1){
537 537
 		fprintf(stderr, "ERROR: socket: %s\n", strerror(errno));
... ...
@@ -552,7 +552,7 @@ error:
552 552
 static void hexdump(unsigned char* buf, int len, int ascii)
553 553
 {
554 554
 	int r, i;
555
-	
555
+
556 556
 	/* dump it in hex */
557 557
 	for (r=0; r<len; r++){
558 558
 		if ((r) && ((r%16)==0)){
... ...
@@ -595,7 +595,7 @@ static int send_binrpc_cmd(int s, struct binrpc_cmd* cmd, int cookie)
595 595
 	struct binrpc_pkt body;
596 596
 	int ret;
597 597
 	int n;
598
-	
598
+
599 599
 	ret=binrpc_init_pkt(&body, msg_body, MAX_BODY_SIZE);
600 600
 	if (ret<0) goto binrpc_err;
601 601
 	ret=binrpc_addstr(&body, cmd->method, strlen(cmd->method));
... ...
@@ -631,7 +631,7 @@ write_again:
631 631
 			goto write_again;
632 632
 		goto error_send;
633 633
 	}
634
-	
634
+
635 635
 	return n;
636 636
 error_send:
637 637
 	return -1;
... ...
@@ -646,7 +646,7 @@ static int binrpc_errno=0;
646 646
  * returns < 0 on error, reply size on success + initializes in_pkt
647 647
  * if ret==-2 (parse error), sets binrpc_errno to the binrpc error
648 648
  * error returns: -1 - read error (check errno)
649
- *                -2 - binrpc parse error (chekc binrpc_errno) 
649
+ *                -2 - binrpc parse error (chekc binrpc_errno)
650 650
  *                -3 - cookie error (the cookied doesn't match)
651 651
  *                -4 - message too big */
652 652
 static int get_reply(int s, unsigned char* reply_buf, int max_reply_size,
... ...
@@ -658,8 +658,7 @@ static int get_reply(int s, unsigned char* reply_buf, int max_reply_size,
658 658
 	unsigned char* msg_end;
659 659
 	int n;
660 660
 	int ret;
661
-	
662
-	
661
+
663 662
 	hdr_end=crt=reply_buf;
664 663
 	msg_end=reply_buf+max_reply_size;
665 664
 	binrpc_errno=0;
... ...
@@ -716,7 +715,7 @@ static int get_reply(int s, unsigned char* reply_buf, int max_reply_size,
716 716
 			}
717 717
 		}
718 718
 	}while(crt<msg_end);
719
-	
719
+
720 720
 	*body=hdr_end;
721 721
 	return (int)(msg_end-reply_buf);
722 722
 error_read:
... ...
@@ -737,11 +736,11 @@ static char* str_escape(char* str)
737 737
 {
738 738
 	char* n;
739 739
 	char* ret;
740
-	
740
+
741 741
 	ret=n=malloc(strlen(str)+1);
742 742
 	if (n==0)
743 743
 		goto end;
744
-	
744
+
745 745
 	for(;*str;str++){
746 746
 		*n=*str;
747 747
 		if (*str=='\\'){
... ...
@@ -786,7 +785,7 @@ end:
786 786
  *          printf("%.*s", size, s);
787 787
  *          if (type==-1)
788 788
  *            continue;
789
- *          else 
789
+ *          else
790 790
  *             printf("now we should get & print an object of type %d\n", type)
791 791
  *        }
792 792
  */
... ...
@@ -820,10 +819,10 @@ static char* parse_fmt(char* fmt, int* type, int* size)
820 820
 
821 821
 
822 822
 
823
-static int print_body(struct binrpc_parse_ctx* in_pkt, 
823
+static int print_body(struct binrpc_parse_ctx* in_pkt,
824 824
 						unsigned char* body, int size, char* fmt)
825 825
 {
826
-	
826
+
827 827
 	unsigned char* p;
828 828
 	unsigned char* end;
829 829
 	struct binrpc_val val;
... ...
@@ -833,7 +832,7 @@ static int print_body(struct binrpc_parse_ctx* in_pkt,
833 833
 	char* s;
834 834
 	int f_size;
835 835
 	int fmt_has_values;
836
-	
836
+
837 837
 	p=body;
838 838
 	end=p+size;
839 839
 	rec=0;
... ...
@@ -842,7 +841,7 @@ static int print_body(struct binrpc_parse_ctx* in_pkt,
842 842
 	/* read body */
843 843
 	while(p<end){
844 844
 		if (f){
845
-			
845
+
846 846
 			do{
847 847
 				if (*f==0)
848 848
 					f=fmt; /* reset */
... ...
@@ -903,7 +902,7 @@ error:
903 903
 
904 904
 
905 905
 
906
-static int print_fault(struct binrpc_parse_ctx* in_pkt, 
906
+static int print_fault(struct binrpc_parse_ctx* in_pkt,
907 907
 						unsigned char* body, int size)
908 908
 {
909 909
 	printf("error: ");
... ...
@@ -919,7 +918,7 @@ static int run_binrpc_cmd(int s, struct binrpc_cmd * cmd, char* fmt)
919 919
 	unsigned char* msg_body;
920 920
 	struct binrpc_parse_ctx in_pkt;
921 921
 	int ret;
922
-	
922
+
923 923
 	cookie=gen_cookie();
924 924
 	if ((ret=send_binrpc_cmd(s, cmd, cookie))<0){
925 925
 		if (ret==-1) goto error_send;
... ...
@@ -960,11 +959,11 @@ static int run_binrpc_cmd(int s, struct binrpc_cmd * cmd, char* fmt)
960 960
 	/* normal exit */
961 961
 	return 0;
962 962
 binrpc_err:
963
-	fprintf(stderr, "ERROR while building the packet: %s\n", 
963
+	fprintf(stderr, "ERROR while building the packet: %s\n",
964 964
 				binrpc_error(ret));
965 965
 	goto error;
966 966
 error_parse:
967
-	fprintf(stderr, "ERROR while parsing the reply: %s\n", 
967
+	fprintf(stderr, "ERROR while parsing the reply: %s\n",
968 968
 				binrpc_error(binrpc_errno));
969 969
 	goto error;
970 970
 error_cookie:
... ...
@@ -991,7 +990,7 @@ static int parse_line(struct binrpc_cmd* cmd, char* line)
991 991
 {
992 992
 	char* p;
993 993
 	int count;
994
-	
994
+
995 995
 	cmd->method=strtok(line, " \t");
996 996
 	if (cmd->method==0)
997 997
 		goto error_no_method;
... ...
@@ -1024,7 +1023,7 @@ error_arg:
1024 1024
 static void fix_cmd(struct binrpc_cmd* cmd, char** format)
1025 1025
 {
1026 1026
 	int r;
1027
-	
1027
+
1028 1028
 	for (r=0; cmd_aliases[r].name; r++){
1029 1029
 		if (strcmp(cmd_aliases[r].name, cmd->method)==0){
1030 1030
 			cmd->method=cmd_aliases[r].method;
... ...
@@ -1043,7 +1042,7 @@ static int run_builtins(int s, struct binrpc_cmd* cmd)
1043 1043
 {
1044 1044
 	int r;
1045 1045
 	int ret;
1046
-	
1046
+
1047 1047
 	for (r=0; builtins[r].name; r++){
1048 1048
 		if (strcmp(builtins[r].name, cmd->method)==0){
1049 1049
 			ret=builtins[r].f(s, cmd);
... ...
@@ -1062,7 +1061,7 @@ inline static int run_cmd(int s, struct binrpc_cmd* cmd, char* format)
1062 1062
 	char* fmt;
1063 1063
 
1064 1064
 	fmt=format;
1065
-	
1065
+
1066 1066
 	fix_cmd(cmd, &fmt);
1067 1067
 	if (!(ret=run_builtins(s, cmd))){
1068 1068
 		ret=run_binrpc_cmd(s, cmd, fmt);
... ...
@@ -1077,7 +1076,7 @@ inline static int run_line(int s, char* l, char* format)
1077 1077
 {
1078 1078
 	struct binrpc_cmd cmd;
1079 1079
 	int ret;
1080
-	
1080
+
1081 1081
 	if ((ret=parse_line(&cmd, l))==0){
1082 1082
 		return run_cmd(s, &cmd, format);
1083 1083
 	}
... ...
@@ -1103,7 +1102,7 @@ static void free_rpc_array(struct binrpc_val* a, int size)
1103 1103
 
1104 1104
 
1105 1105
 /* parse the body into a malloc allocated,  binrpc_val array */
1106
-static struct binrpc_val* parse_reply_body(int* records, 
1106
+static struct binrpc_val* parse_reply_body(int* records,
1107 1107
 											struct binrpc_parse_ctx* in_pkt,
1108 1108
 											unsigned char* body, int size)
1109 1109
 {
... ...
@@ -1124,7 +1123,7 @@ static struct binrpc_val* parse_reply_body(int* records,
1124 1124
 		goto error_mem;
1125 1125
 	p=body;
1126 1126
 	end=p+size;
1127
-	
1127
+
1128 1128
 	/* read body */
1129 1129
 	while(p<end){
1130 1130
 		val.type=BINRPC_T_ALL;
... ...
@@ -1194,10 +1193,10 @@ static int get_kamcmd_list(int s)
1194 1194
 	unsigned char* msg_body;
1195 1195
 	struct binrpc_parse_ctx in_pkt;
1196 1196
 	int ret;
1197
-	
1197
+
1198 1198
 	cmd.method="system.listMethods";
1199 1199
 	cmd.argc=0;
1200
-	
1200
+
1201 1201
 	cookie=gen_cookie();
1202 1202
 	if ((ret=send_binrpc_cmd(s, &cmd, cookie))<0){
1203 1203
 		if (ret==-1) goto error_send;
... ...
@@ -1275,11 +1274,11 @@ static int get_cfgvars_list(int s)
1275 1275
 	str var_name;
1276 1276
 	int r;
1277 1277
 	int ret;
1278
-	
1278
+
1279 1279
 	cmd.method="cfg.list";
1280 1280
 	cmd.argc=0;
1281 1281
 	if (!is_rpc_cmd(cmd.method)) goto error;
1282
-	
1282
+
1283 1283
 	cookie=gen_cookie();
1284 1284
 	if ((ret=send_binrpc_cmd(s, &cmd, cookie))<0){
1285 1285
 		if (ret==-1) goto error_send;
... ...
@@ -1394,7 +1393,7 @@ void free_cfg_grp_lst()
1394 1394
 {
1395 1395
 	struct cfg_var_grp* grp;
1396 1396
 	struct cfg_var_grp* last;
1397
-	
1397
+
1398 1398
 	grp=cfg_grp_lst;
1399 1399
 	while(grp){
1400 1400
 		last=grp;
... ...
@@ -1422,11 +1421,11 @@ static int get_counters_list(int s)
1422 1422
 	str var_name;
1423 1423
 	int r;
1424 1424
 	int ret;
1425
-	
1425
+
1426 1426
 	cmd.method="cnt.grps_list";
1427 1427
 	cmd.argc=0;
1428 1428
 	if (!is_rpc_cmd(cmd.method)) goto error;
1429
-	
1429
+
1430 1430
 	cookie=gen_cookie();
1431 1431
 	if ((ret=send_binrpc_cmd(s, &cmd, cookie))<0){
1432 1432
 		if (ret==-1) goto error_send;
... ...
@@ -1544,7 +1543,7 @@ void free_cnt_grp_lst()
1544 1544
 {
1545 1545
 	struct cnt_var_grp* grp;
1546 1546
 	struct cnt_var_grp* last;
1547
-	
1547
+
1548 1548
 	grp=cnt_grp_lst;
1549 1549
 	while(grp){
1550 1550
 		last=grp;
... ...
@@ -1588,7 +1587,7 @@ static void print_formatting(char* prefix, char* format, char* suffix)
1588 1588
 static int kamcmd_help(int s, struct binrpc_cmd* cmd)
1589 1589
 {
1590 1590
 	int r;
1591
-	
1591
+
1592 1592
 	if (cmd->argc && (cmd->argv[0].type==BINRPC_T_STR)){
1593 1593
 		/* if it has args, try command help */
1594 1594
 		for (r=0; cmd_aliases[r].name; r++){
... ...
@@ -1603,7 +1602,7 @@ static int kamcmd_help(int s, struct binrpc_cmd* cmd)
1603 1603
 		}
1604 1604
 		for(r=0; builtins[r].name; r++){
1605 1605
 			 if (strcmp(cmd->argv[0].u.strval.s, builtins[r].name)==0){
1606
-				 printf("builtin command: %s\n", 
1606
+				 printf("builtin command: %s\n",
1607 1607
 						 builtins[r].doc?builtins[r].doc:"undocumented");
1608 1608
 				 return 0;
1609 1609
 			 }
... ...
@@ -1614,7 +1613,7 @@ static int kamcmd_help(int s, struct binrpc_cmd* cmd)
1614 1614
 		}
1615 1615
 		return 0;
1616 1616
 	}
1617
-		
1617
+
1618 1618
 	if (rpc_no==0){
1619 1619
 		if (get_kamcmd_list(s)<0)
1620 1620
 			goto error;
... ...
@@ -1837,7 +1836,7 @@ char** kamcmd_completion(const char* text, int start, int end)
1837 1837
 	static int cnt_grp_start;
1838 1838
 	int cnt_grp_len;
1839 1839
 #endif /* USE_COUNTERS */
1840
-	
1840
+
1841 1841
 	crt_param_no=0;
1842 1842
 	/* skip over whitespace at the beginning */
1843 1843
 	for (j=0; (j<start) && (rl_line_buffer[j]==' ' ||
... ...
@@ -2044,12 +2043,12 @@ int main(int argc, char** argv)
2044 2044
 				if (isprint(optopt))
2045 2045
 					fprintf(stderr, "Unknown option `-%c'.\n", optopt);
2046 2046
 				else
2047
-					fprintf(stderr, 
2047
+					fprintf(stderr,
2048 2048
 							"Unknown option character `\\x%x'.\n",
2049 2049
 							optopt);
2050 2050
 				goto error;
2051 2051
 			case ':':
2052
-				fprintf(stderr, 
2052
+				fprintf(stderr,
2053 2053
 						"Option `-%c' requires an argument.\n",
2054 2054
 						optopt);
2055 2055
 				goto error;
... ...
@@ -2060,10 +2059,10 @@ int main(int argc, char** argv)
2060 2060
 	if (sock_name==0){
2061 2061
 		sock_name=DEFAULT_CTL_SOCKET;
2062 2062
 	}
2063
-	
2063
+
2064 2064
 	/* init the random number generator */
2065 2065
 	srand(getpid()+time(0)); /* we don't need very strong random numbers */
2066
-	
2066
+
2067 2067
 	if (sock_name==0){
2068 2068
 		fprintf(stderr, "ERROR: no server socket address specified\n");
2069 2069
 		goto error;
... ...
@@ -2073,7 +2072,7 @@ int main(int argc, char** argv)
2073 2073
 		fprintf(stderr, "ERROR: error parsing server socket address %s\n", sock_name);
2074 2074
 		goto error;
2075 2075
 	}
2076
-	
2076
+
2077 2077
 	switch(sock_id->proto){
2078 2078
 		case UDP_SOCK:
2079 2079
 		case TCP_SOCK:
... ...
@@ -2104,14 +2103,14 @@ int main(int argc, char** argv)
2104 2104
 	}
2105 2105
 	free(sock_id); /* not needed anymore */
2106 2106
 	sock_id=0;
2107
-	
2107
+
2108 2108
 	if (optind>=argc){
2109 2109
 			/*fprintf(stderr, "ERROR: no command specified\n");
2110 2110
 			goto error; */
2111 2111
 	}else{
2112 2112
 		if (parse_cmd(&cmd, &argv[optind], argc-optind)<0)
2113 2113
 			goto error;
2114
-		if (run_cmd(s, &cmd, format)<0) 
2114
+		if (run_cmd(s, &cmd, format)<0)
2115 2115
 			goto error;
2116 2116
 		goto end;
2117 2117
 	}
... ...
@@ -2129,17 +2128,17 @@ int main(int argc, char** argv)
2129 2129
 	printf("%s\n", COPYRIGHT);
2130 2130
 	printf("%s\n", DISCLAIMER);
2131 2131
 #ifdef USE_READLINE
2132
-	
2132
+
2133 2133
 	/* initialize readline */
2134 2134
 	/* allow conditional parsing of the ~/.inputrc file*/
2135
-	rl_readline_name=NAME; 
2135
+	rl_readline_name=NAME;
2136 2136
 	rl_completion_entry_function=kamcmd_generator;
2137 2137
 	rl_attempted_completion_function=kamcmd_completion;
2138
-	
2138
+
2139 2139
 	while(!quit){
2140 2140
 		line=readline(NAME "> ");
2141 2141
 		if (line==0) /* EOF */
2142
-			break; 
2142
+			break;
2143 2143
 		l=trim_ws(line); /* trim whitespace */
2144 2144
 		if (*l){
2145 2145
 			add_history(l);
... ...
@@ -1,7 +1,5 @@
1 1
 /*
2
- * $Id$
3
- *
4
- * sercmd GPL license, standard disclaimer and copyright
2
+ * kamcmd GPL license, standard disclaimer and copyright
5 3
  */
6 4
 
7 5
 #ifndef __license_h_
... ...
@@ -1,9 +1,7 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2006 iptelorg GmbH
5 3
  *
6
- * This file is part of ser, a free SIP server.
4
+ * This file is part of kamcmd, a free cli tool for Kamailio SIP server.
7 5
  *
8 6
  * ser is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
... ...
@@ -20,14 +18,10 @@
20 20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 21
  * GNU General Public License for more details.
22 22
  *
23
- * You should have received a copy of the GNU General Public License 
24
- * along with this program; if not, write to the Free Software 
23
+ * You should have received a copy of the GNU General Public License
24
+ * along with this program; if not, write to the Free Software
25 25
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 26
  */
27
-/* History:
28
- * --------
29
- *  2006-02-20  created by andrei
30
- */
31 27
 
32 28
 
33 29
 #include <stdio.h>
... ...
@@ -54,14 +48,14 @@ static int _debug = 0;
54 54
 		if(_debug==1) \
55 55
 			fprintf(stderr,  __VA_ARGS__); \
56 56
 	} while(0)
57
-#define LOG(lev, ...) fprintf(stderr,  __VA_ARGS__)
57
+#define ERR(...) fprintf(stderr,  __VA_ARGS__)
58 58
 #else
59 59
 #define DBG(fmt, args...) \
60 60
 	do { \
61 61
 		if(_debug==1) \
62 62
 			fprintf(stderr, fmt, ## args); \
63 63
 	} while(0)
64
-#define LOG(lev, fmt, args...) fprintf(stderr, fmt, ## args)
64
+#define ERR(fmt, args...) fprintf(stderr, fmt, ## args)
65 65
 #endif
66 66
 
67 67
 
... ...
@@ -100,11 +94,11 @@ static inline unsigned short str2s(const char* s, unsigned int len,
100 100
 	return ret;
101 101
 
102 102
 error_digits:
103
-	DBG("str2s: ERROR: too many letters in [%.*s]\n", (int)len, init);
103
+	DBG("ERROR: too many letters in [%.*s]\n", (int)len, init);
104 104
 	if (err) *err=1;
105 105
 	return 0;
106 106
 error_char:
107
-	DBG("str2s: ERROR: unexpected char %c in %.*s\n", *str, (int)len, init);
107
+	DBG("ERROR: unexpected char %c in %.*s\n", *str, (int)len, init);
108 108
 	if (err) *err=1;
109 109
 	return 0;
110 110
 }
... ...
@@ -119,7 +113,7 @@ error_char:
119 119
  *     tcp|udp|unix:host_name
120 120
  *     host_name:port
121 121
  *     host_name
122
- * 
122
+ *
123 123
  *
124 124
  *     where host_name=string, ipv4 address, [ipv6 address],
125 125
  *         unix socket path (starts with '/')
... ...
@@ -135,22 +129,22 @@ struct id_list* parse_listen_id(char* l, int len, enum socket_protos def)
135 135
 	struct servent* se;
136 136
 	char* s;
137 137
 	struct id_list* id;
138
-	
138
+
139 139
 	s=pkg_malloc((len+1)*sizeof(char));
140 140
 	if (s==0){
141
-		LOG(L_ERR, "ERROR:parse_listen_id: out of memory\n");
141
+		ERR("ERROR:parse_listen_id: out of memory\n");
142 142
 		goto error;
143 143
 	}
144 144
 	memcpy(s, l, len);
145 145
 	s[len]=0; /* null terminate */
146
-	
146
+
147 147
 	/* duplicate */
148 148
 	proto=UNKNOWN_SOCK;
149 149
 	port=0;
150 150
 	name=0;
151 151
 	port_str=0;
152 152
 	p=s;
153
-	
153
+
154 154
 	if ((*p)=='[') goto ipv6;
155 155
 	/* find proto or name */
156 156
 	for (; *p; p++){
... ...
@@ -207,11 +201,11 @@ ipv6:
207 207
 			goto error;
208 208
 		}
209 209
 	}
210
-	
210
+
211 211
 find_port:
212 212
 	p++;
213 213
 	port_str=(*p)?p:0;
214
-	
214
+
215 215
 end:
216 216
 	/* fix all the stuff */
217 217
 	if (name==0) goto error;
... ...
@@ -247,13 +241,13 @@ end:
247 247
 		port=str2s(port_str, strlen(port_str), &err);
248 248
 		if (err){
249 249
 			/* try getservbyname */
250
-			se=getservbyname(port_str, 
250
+			se=getservbyname(port_str,
251 251
 					(proto==TCP_SOCK)?"tcp":(proto==UDP_SOCK)?"udp":0);
252 252
 			if (se) port=ntohs(se->s_port);
253 253
 			else goto error;
254 254
 		}
255 255
 	}else{
256
-		/* no port, check if the hostname is a port 
256
+		/* no port, check if the hostname is a port
257 257
 		 * (e.g. tcp:3012 == tcp:*:3012 */
258 258
 		if (proto==TCP_SOCK|| proto==UDP_SOCK){
259 259
 			port=str2s(name, strlen(name), &err);
... ...
@@ -266,7 +260,7 @@ end:
266 266
 	}
267 267
 	id=pkg_malloc(sizeof(struct id_list));
268 268
 	if (id==0){
269
-		LOG(L_ERR, "ERROR:parse_listen_id: out of memory\n");
269
+		ERR("ERROR:parse_listen_id: out of memory\n");
270 270
 		goto error;
271 271
 	}
272 272
 	id->name=name;
... ...
@@ -1,9 +1,7 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2006 iptelorg GmbH
5 3
  *
6
- * This file is part of ser, a free SIP server.
4
+ * This file is part of kamcmd, a free cli tool for Kamailio SIP server.
7 5
  *
8 6
  * ser is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
... ...
@@ -20,14 +18,10 @@
20 20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 21
  * GNU General Public License for more details.
22 22
  *
23
- * You should have received a copy of the GNU General Public License 
24
- * along with this program; if not, write to the Free Software 
23
+ * You should have received a copy of the GNU General Public License
24
+ * along with this program; if not, write to the Free Software
25 25
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 26
  */
27
-/* History:
28
- * --------
29
- *  2006-02-20  created by andrei
30
- */
31 27
 
32 28
 
33 29
 #ifndef parse_listen_id_h
... ...
@@ -35,7 +29,7 @@
35 35
 
36 36
 enum payload_proto	{ P_BINRPC , P_FIFO };
37 37
 
38
-enum socket_protos	{	UNKNOWN_SOCK=0, UDP_SOCK, TCP_SOCK, 
38
+enum socket_protos	{	UNKNOWN_SOCK=0, UDP_SOCK, TCP_SOCK,
39 39
 						UNIXS_SOCK, UNIXD_SOCK
40 40
 #ifdef USE_FIFO
41 41
 							, FIFO_SOCK