*** ../rtpproxy_orig/main.c 2004-08-13 21:04:23.000000000 +0200 --- ./main.c 2004-11-17 18:30:32.000000000 +0100 *************** *** 215,220 **** --- 215,221 ---- static int umode = 0; /* UDP control mode */ static const char *cmd_sock = CMD_SOCK; static const char *pid_file = PID_FILE; + static char *public_ip = NULL; /* * The first address is for external interface, the second one - for *************** *** 916,924 **** } if (lia[0] == NULL || ishostnull(lia[0])) len += sprintf(cp, "%d\n", lport); ! else ! len += sprintf(cp, "%d %s%s\n", lport, addr2char(lia[0]), ! (lia[0]->sa_family == AF_INET) ? "" : " 6"); doreply: if (umode == 0) { write(controlfd, buf, len); --- 917,931 ---- } if (lia[0] == NULL || ishostnull(lia[0])) len += sprintf(cp, "%d\n", lport); ! else { ! if(!public_ip) { ! len += sprintf(cp, "%d %s%s\n", lport, addr2char(lia[0]), ! (lia[0]->sa_family == AF_INET) ? "" : " 6"); ! } else { ! len += sprintf(cp, "%d %s%s\n", lport, public_ip, ! (lia[0]->sa_family == AF_INET) ? "" : " 6"); ! } ! } doreply: if (umode == 0) { write(controlfd, buf, len); *************** *** 999,1009 **** dmode = 0; ! while ((ch = getopt(argc, argv, "vf2Rl:6:s:t:r:p:")) != -1) switch (ch) { case 'f': nodaemon = 1; break; case 'l': bh[0] = optarg; --- 1006,1020 ---- dmode = 0; ! while ((ch = getopt(argc, argv, "vf2Rl:6:s:t:r:p:i:")) != -1) switch (ch) { case 'f': nodaemon = 1; break; + case 'i': + public_ip=(char*) malloc(strlen(optarg)+1); + strcpy(public_ip,optarg); + break; case 'l': bh[0] = optarg; *************** *** 1014,1020 **** bmode = 1; } break; - case '6': bh6[0] = optarg; bh6[1] = strchr(bh6[0], '/'); --- 1025,1030 ----