diff -arcN xipmsg-8088/xipmsg.c xipmsg-8088-hostname/xipmsg.c *** xipmsg-8088/xipmsg.c Wed Mar 2 16:40:19 2005 --- xipmsg-8088-hostname/xipmsg.c Mon May 2 19:02:06 2005 *************** *** 1217,1222 **** --- 1217,1223 ---- {"-disable", ".disable", XrmoptionNoArg, "True"}, {"-debug", ".debug", XrmoptionSepArg, NULL}, {"-name", ".name", XrmoptionSepArg, NULL}, + {"-host", ".host", XrmoptionSepArg, NULL}, {"-port", ".port", XrmoptionSepArg, NULL}, }; struct appr { *************** *** 1225,1230 **** --- 1226,1232 ---- String debug; Boolean disable; String name; + String host; String port; } app_resources; static XtResource resources[] = { *************** *** 1235,1247 **** DEFSTR(debug, "Debug", NULL), DEFBOOL(disable, "Disable", False), DEFSTR(name, "Name", NULL), DEFSTR(port, "Port", NULL), }; static char usage_msg[] = "usage: %s " "[-bogus_fix][-disable]" "[-broadcast xx.xx.xx.xx][-debug n]" ! "[-port n][-name str]" "[Xtoolkit options]" "\n"; myname = argv[0]; --- 1237,1250 ---- DEFSTR(debug, "Debug", NULL), DEFBOOL(disable, "Disable", False), DEFSTR(name, "Name", NULL), + DEFSTR(host, "Host", NULL), DEFSTR(port, "Port", NULL), }; static char usage_msg[] = "usage: %s " "[-bogus_fix][-disable]" "[-broadcast xx.xx.xx.xx][-debug n]" ! "[-port n][-name str][-host str]" "[Xtoolkit options]" "\n"; myname = argv[0]; *************** *** 1271,1278 **** name = "anonymous"; bros = cvs_list(app_resources.broadcast); strncpyz(entity_name, name, sizeof(entity_name)); ! gethostname(hostname, sizeof(hostname)); ! hostname[sizeof(hostname) - 1] = '\0'; if (strchr(hostname, '.') != NULL) *strchr(hostname, '.') = '\0'; bro_so = bro_init(port, entity_name, hostname, (void *)bros); --- 1274,1286 ---- name = "anonymous"; bros = cvs_list(app_resources.broadcast); strncpyz(entity_name, name, sizeof(entity_name)); ! if (app_resources.host != NULL) { ! strlcpy(hostname, app_resources.host, sizeof(hostname)); ! } ! else { ! gethostname(hostname, sizeof(hostname)); ! hostname[sizeof(hostname) - 1] = '\0'; ! } if (strchr(hostname, '.') != NULL) *strchr(hostname, '.') = '\0'; bro_so = bro_init(port, entity_name, hostname, (void *)bros);