#include <dlfcn.h>
#include <forb/forb-internal.h>
#include <pthread.h>
+#include <forb/server_id.h>
static struct option long_opts[] = {
{ "daemon", optional_argument, NULL, 'd' },
{ "id", required_argument, NULL, 'i' },
{ "loglevel", required_argument, NULL, 'l' },
{ "port", required_argument, NULL, 'p' },
+ { "serverid", required_argument, NULL, 's' },
{ 0, 0, 0, 0}
};
printf(" -i, --id <textual orb id>\n");
printf(" -l, --loglevel <number>|<domain>=<number>,...\n");
printf(" -p, --port <number> listen on a fixed port number\n");
+ printf(" -s, --serverid <serverid> fixed server id of this server\n");
}
int print_log_domain(ul_log_domain_t *domain, void *context)
bool opt_daemon = false;
char *opt_pidfile = NULL;
int i, ret;
+ forb_server_id *server_id;
forb_init_attr_t attr = {
.orb_id = "",
.peer_discovery_callback = NULL, /* TODO */
};
int opt;
- while ((opt = getopt_long(argc, argv, "d::hi:l:p:", &long_opts[0], NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "d::hi:l:p:s:", &long_opts[0], NULL)) != EOF) {
switch (opt) {
case 'l':
if (*optarg == '?') {
case 'p':
attr.fixed_tcp_port = atol(optarg);
break;
+ case 's':
+ server_id = forb_server_id_from_string(&attr.fixed_server_id, optarg);
+ if (!server_id)
+ error(1, 0, "Invalid server id: '%s'\n", optarg);
+ break;
}
}