main.cpp
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:21k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.23 $
- * $Date: 1999/03/15 22:49:37 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996-98 Lucent Technologies //
- // All Rights Reserved //
- // //
- // THIS IS UNPUBLISHED //
- // PROPRIETARY SOURCE //
- // CODE OF Lucent Technologies //
- // AND elemedia //
- // //
- ////////////////////////////////////////////////////////////////
- //
- ////////////////////////////////////////////////////////////////
- // Example programs are provided soley to demonstrate one //
- // possible use of the stack libraries and are included for //
- // instructional purposes only. You are free to use, modify //
- // and/or redistribute any portion of code in the example //
- // programs. However, such examples are not intended to //
- // represent production quality code. //
- // //
- // THE COPYRIGHT HOLDERS PROVIDE THESE EXAMPLE PROGRAMS //
- // "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED //
- // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED //
- // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A //
- // PARTICULAR PURPOSE. //
- ////////////////////////////////////////////////////////////////
- #include "exchange.h"
- #include "call.h"
- #include "msg.h"
- #include "h450msgs.h"
- #include "api/apicommon.h"
- #if defined(VXWORKS)
- #include <memLib.h>
- #include <private/memPartLibP.h>
- #endif
- #if !defined(VXWORKS) && !defined(WIN32)
- #include <sys/resource.h>
- #endif
- #if (defined(__sun))
- #define INADDR_NONE 0xffffffff
- #endif
- #if (defined(ENABLE_BENCHMARKS))
- #include "perf.h"
- #endif
- #if !defined(VXWORKS)
- int parse_command_line (int argc, char * argv []);
- void show_usage (const char * progname);
- #endif
- config_data *config;
- #if defined(VXWORKS)
- ms()
- #else
- //main()
- main( int argc, char *argv[])
- #endif
- {
- Exchange* ex;
- ProtReturnCode result;
- config = new config_data;
- #if !defined(VXWORKS)
- if (argc > 1)
- {
- int need_usage = 0;
- if (parse_command_line(argc, argv))
- {
- show_usage(argv[0]);
- delete config;
- return(1);
- }
- }
- #endif
- #if !defined(VXWORKS) && !defined(WIN32)
- struct rlimit r;
- if (getrlimit(RLIMIT_NOFILE,&r) == 0)
- {
- printf("Current NOFILE limit, Soft = %d, Hard = %dn",
- r.rlim_cur, r.rlim_max);
- r.rlim_cur = RLIM_INFINITY;
- r.rlim_max = RLIM_INFINITY;
- if ((setrlimit(RLIMIT_NOFILE,&r) == 0) &&
- (setrlimit(RLIMIT_DATA,&r) == 0) &&
- #if defined(__hpux)
- (setrlimit(RLIMIT_AS,&r) == 0))
- #else
- (setrlimit(RLIMIT_VMEM,&r) == 0))
- #endif
- {
- printf("All resource limits set to INFINITYn");
- }
- else
- {
- printf("setrlimit failed, errno = %dn",errno);
- }
- }
- else
- {
- printf("getrlimit failed, errno = %dn",errno);
- }
- #endif
- InitializeProtocolStack();
- #if defined(USE_RAS)
- H225CSEndpointType et;
- H225CSVendorID vend;
- char *greeting = "elemedia multi-line terminal";
- vend.SetH221NonStd(0xde, 0, 0xad);
- vend.SetProductID((unsigned char *)greeting, strlen(greeting) + 1);
- vend.SetVersionID((unsigned char *)greeting, strlen(greeting) + 1);
- et.SetVendor(vend);
- et.SetTerminal(NULL);
- et.SetMC(FALSE);
- et.SetUndefinedNode (FALSE);
- ex = new Exchange(et,vend,CLT_TERMINAL,result);
- #else
- ex = new Exchange(result);
- #endif
- // print the protocol versions...
- printf("%sn", H225CSGetVersionString());
- printf("%sn", H245SigGetVersionString());
- ex->Start();
- #if defined(USE_RAS)
- if (config->discoverGK)
- ex->DiscoverGK();
- else
- ex->RegisterWithGK();
- #endif
- printf("Exchange created, press 'x' to exitn");
- ex->UserInterface();
- #if defined(USE_RAS)
- // ex->UnRegisterWithGK();
- #endif
- ex->Stop();
- delete ex;
- delete config;
- UninitializeProtocolStack();
- return(0);
- }
- #if (defined(unix))
- void
- mydelay(int secs)
- {
- timestruc_t to;
- mutex_t mtx;
- cond_t cv;
- if (secs == 0)
- {
- return;
- }
- cond_init(&cv, USYNC_THREAD, NULL);
- mutex_init(&mtx,USYNC_THREAD, NULL);
- mutex_lock(&mtx);
- to.tv_sec = time(NULL) + secs;
- to.tv_nsec = 0;
- cond_timedwait(&cv, &mtx, &to);
- mutex_destroy(&mtx);
- cond_destroy(&cv);
- }
- #elif (defined(WIN32))
- void
- mydelay(int secs)
- {
- HANDLE evt;
- evt = CreateEvent(NULL, FALSE, FALSE, NULL);
- WaitForSingleObject(evt, secs*1000);
- CloseHandle(evt);
- }
- #elif defined(VXWORKS)
- void
- mydelay(int secs)
- {
- taskDelay(sysClkRateGet() * secs);
- }
- #elif (defined(__hpux))
- void
- mydelay(int secs)
- {
- struct pollfd fds[1];
- fds[0].fd = -1;
- if (poll(fds,1,secs*1000) != 0)
- LOG("poll() timeout by an unknown eventn");
- }
- #else
- void
- mydelay(int secs)
- {
- return;
- }
- #endif
- void
- Exchange::UserInterface()
- {
- while(1)
- {
- char command[512];
- char save[512];
- printf(">>");
- if (gets(command) == NULL)
- {
- printf("gets failed, error %dn",errno);
- }
- if (command[0] == 'n' || command[0] == ' ')
- {
- continue;
- }
- again:
- switch(command[0])
- {
- case 'c':
- case 'C':
- {
- char remote[256];
- sscanf(command+1,"%s",remote);
- unsigned int remote_address = HostNameToIP(remote);
- if (remote_address != INADDR_NONE)
- PlaceCall(remote_address);
- }
- break;
- /* options */
- case 'o':
- case 'O':
- {
- UICmdCtrl *msg = new UICmdCtrl;
- char *command_string = command;
- char *current_word;
- int i = 0;
- current_word = strtok(command_string," ");
- // skip the first word, since it is the command letter O
- while ((current_word = strtok(NULL," ")) != NULL)
- {
- if (strcmp(current_word, "enable_faststart") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_ENABLE_FASTSTART;
- }
- else if (strcmp(current_word, "disable_faststart") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_DISABLE_FASTSTART;
- }
- else if (strcmp(current_word, "enable_overlapsend") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_ENABLE_OVERLAP_SEND;
- }
- else if (strcmp(current_word, "disable_overlapsend") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_DISABLE_OVERLAP_SEND;
- }
- else if (strcmp(current_word, "enable_tunneling") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_ENABLE_TUNNELING;
- }
- else if (strcmp(current_word, "disable_tunneling") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_DISABLE_TUNNELING;
- }
- else if (strcmp(current_word, "enable_alerting") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_ENABLE_ALERTING;
- }
- else if (strcmp(current_word, "disable_alerting") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_DISABLE_ALERTING;
- }
- else if (strcmp(current_word, "enable_callproc") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_ENABLE_CALLPROC;
- }
- else if (strcmp(current_word, "disable_callproc") == 0)
- {
- msg->command[i] = UI_CTRL_CMD_DISABLE_CALLPROC;
- }
- else
- {
- fprintf(stderr,"Unknown option to the 'o' command %sn",
- current_word);
- continue;
- }
- ++i;
- }
- if (i > 0)
- {
- msg->num_cmds = i;
- SendToExchange(PROT_UI_MSG, UI_CMD_CTRL, (unsigned int)msg);
- }
- else
- {
- fprintf(stderr,"must provide one or more options for on"
- "t enable_faststart, disable_faststart, n"
- "t enable_tunneling, disable_tunneling, n"
- "t enable_overlapsend, disable_overlapsend,n"
- "t enable_alerting, disable_alerting,n"
- "t enable_callproc, disable_callproc,n");
- }
- }
- break;
- case 's':
- case 'S':
- #if (defined(unix) || defined(WIN32) || defined(VXWORKS) || defined (__hpux))
- if (1)
- {
- /*
- * Note that this command blocks the user interface thread.
- * Also it always drops line 0. So dont use any other command
- * other than x/X while using this command.
- */
- char remote[256];
- int count = 1;
- unsigned int remote_address;
- sscanf(command+1,"%s%d",remote, &count);
- if (count <= 0)
- {
- printf("count must be a positive integern");
- break;
- }
- remote_address = HostNameToIP(remote);
- while (count-- > 0)
- {
- printf("calling %s, iteration = %dn", remote, count+1);
- PlaceCall(remote_address);
- // wait for the call to go through before hanging up.
- mydelay(7);
- printf("hanging up %sn", remote);
- DropCall(0);
- // wait for some time for the hangup to go through.
- mydelay(3);
- }
- }
- #if !defined(VXWORKS)
- else
- {
- char filename[256];
- FILE *fp;
- int times = 0;
- int nhosts = 0;
- unsigned int *addr_list = NULL;
- int i;
- sscanf(command+1,"%s",filename);
- fp = fopen(filename,"r");
- if (fp == NULL)
- {
- printf("Cannot open file %sn",filename);
- continue;
- }
- fscanf(fp,"%d%d",×,&nhosts);
- printf("Will readin %d hostnamesn",nhosts);
- addr_list = new unsigned int[nhosts];
- if (addr_list == NULL)
- {
- continue;
- }
- for (i=0;i<nhosts;++i)
- {
- char ip[100];
- fscanf(fp,"%s",ip);
- addr_list[i] = HostNameToIP(ip);
- }
- fclose(fp);
- while(--times >= 0)
- {
- printf("Iteration %dn",times);
- for(i=0;i<nhosts;++i)
- {
- PlaceCall(addr_list[i]);
- }
- // wait for the calls to go through before hanging up.
- mydelay(7);
- printf("Hanging up callsn");
- for(i=0;i<nhosts;++i)
- {
- DropCall(i);
- }
- // wait for some time for the hangup to go through.
- mydelay(3);
- }
- }
- #endif
- #else
- printf("This command is not supported in this operating systemn");
- #endif
- break;
- case 'n':
- case 'N':
- {
- char remote[256];
- unsigned int remote_address;
- int count = 1;
- int delay = 0;
- int repeat_count = 0;
- // if we don't use gk remote is the IP, else remote is the e164 alias
- sscanf(command+1,"%s%d%d%d",remote,&count,
- &repeat_count,&delay);
- if (count <= 0)
- {
- printf("count must be a positive integern");
- break;
- }
- #if defined(USE_RAS)
- if (!IsGKRegistered()) // the user must have provided IP as "remote" field
- remote_address = HostNameToIP(remote);
- #else // if no ras at all, user always provides IP as "remote" field
- remote_address = HostNameToIP(remote);
- #endif
- do
- {
- int tmp_count = count;
- while (tmp_count > 0)
- {
- #if defined(USE_RAS)
- if (!IsGKRegistered())
- PlaceCall(remote_address);
- else
- PlaceCall(NULL, remote);
- #else
- PlaceCall(remote_address);
- #endif
- --tmp_count;
- }
- mydelay(delay);
- if (repeat_count > 0)
- {
- int i;
- --repeat_count;
- // We will always try to drop
- // the first count*2 calls.
- // This is done to take care
- // of clearing localhost calls
- // properly.
- for (i=0;i<count*2;++i)
- {
- DropCall(i);
- }
- mydelay((delay/2 > 0) ? (delay/2) : 1);
- if (repeat_count == 0)
- {
- break;
- }
- printf("%d iterations leftn",repeat_count);
- }
- else
- {
- break;
- }
- }while (1);
- }
- break;
- case 'g':
- case 'G':
- {
- char gw[256];
- char phone[256];
- sscanf(command+1,"%s %s",gw,phone);
- PlaceCall(HostNameToIP(gw),phone);
- }
- break;
- #if defined(USE_RAS)
- case 'm':
- case 'M':
- {
- char phone[256];
- sscanf(command+1,"%s",phone);
- PlaceCall(NULL,phone);
- }
- break;
- #endif
- case 'd':
- case 'D':
- {
- int l = 0;
- int u = -1;
- if (sscanf(command + 1,"%d%d",&l,&u) == 1)
- {
- u = l;
- }
- if (l <= u)
- {
- while((l<=u) && (l >=0 && l < NUM_LINES))
- {
- DropCall(l);
- ++l;
- }
- }
- else
- {
- printf("??n");
- }
- }
- break;
- case 't':
- case 'T':
- {
- int l = 0;
- char args[80];
- char *p;
- H450SSseq *ssSeq;
- H4501SuppService *ss;
- int invokeID = 0;
- char *callid = "";
- unsigned int ip;
- char *e164 = "";
- if (sscanf(command + 1,"%d %s", &l, args) < 2)
- {
- printf("Use one of: %c lineno ipn",command[0]);
- printf(" %c lineno hostnamen",command[0]);
- printf(" %c lineno e164n",command[0]);
- break;
- }
- p = args;
- if(strchr(p,'.') != NULL) {
- // Assume this is an IP address
- ip = inet_addr(p);
- e164 = NULL;
- } else if(isalpha(p[0])) {
- // Assume this is a hostname
- ip = HostNameToIP(p);
- e164 = NULL;
- } else if(strcspn(p,"#*0123456789,") == strlen(p)) {
- // Assume e164
- ip = 0;
- e164 = p;
- } else {
- break;
- }
- ss = ctInitiateInvoke(invokeID, callid, ip, e164);
- ssSeq = new H450SSseq;
- ssSeq->next = NULL;
- ssSeq->value = ss;
- if(ssSeq != NULL) {
- SendFacility(l, ssSeq);
- }
- }
- break;
- case 'x':
- case 'X':
- {
- ShutDown();
- return;
- }
- /*NOTREACHED*/
- break;
- case 'l':
- case 'L':
- {
- int i;
- int prn = 0;
- int num_calls = 0;
- unsigned int min_sec = 0;
- unsigned min_msec = 0;
- unsigned int max_sec = 0;
- unsigned max_msec = 0;
- for(i=0;i<NUM_LINES;++i)
- {
- if (calls[i])
- {
- #if (defined(ENABLE_BENCHMARKS))
- unsigned int cpt = my_difftime(
- calls[i]->st_sec,
- calls[i]->st_msec,
- calls[i]->end_sec,
- calls[i]->end_msec);
- if (min_sec == 0)
- {
- min_sec = calls[i]->st_sec;
- min_msec = calls[i]->st_msec;
- }
- if ((min_sec >= calls[i]->st_sec) &&
- (min_msec > calls[i]->st_msec))
- {
- min_sec = calls[i]->st_sec;
- min_msec = calls[i]->st_msec;
- }
- if ((max_sec <= calls[i]->end_sec) &&
- (max_msec < calls[i]->end_msec))
- {
- max_sec = calls[i]->end_sec;
- max_msec = calls[i]->end_msec;
- }
- ++num_calls;
- if (cpt > 0)
- {
- printf("%s%s%d(%dms)(%d/%d) ",
- calls[i]->GetRemoteName(),
- calls[i]->IsAudioSessionRunning() ?
- "=" : "-",i,cpt,calls[i]->cur_stack_size,
- calls[i]->max_stack_size);
- }
- else
- {
- printf("%s%s%d(%d/%d) ",calls[i]->GetRemoteName(),
- calls[i]->IsAudioSessionRunning() ? "=" : "-",
- i, calls[i]->cur_stack_size,
- calls[i]->max_stack_size);
- }
- #else
- ++num_calls;
- printf("%s%s%d ",calls[i]->GetRemoteName(),
- calls[i]->IsAudioSessionRunning() ? "=" : "-", i);
- #endif
- ++prn;
- if ((prn%2) == 0)
- {
- printf("n");
- }
- }
- }
- #if (defined(ENABLE_BENCHMARKS))
- if (num_calls > 0)
- {
- printf("n%d call(s) %dmsn",num_calls,
- my_difftime(min_sec,min_msec,max_sec,max_msec));
- }
- #endif
- }
- break;
- case '!':
- {
- strcpy(command,save);
- printf("%sn",command);
- goto again;
- }
- /*NOTREACHED*/
- break;
- case '?':
- case 'h':
- case 'H':
- {
- printf("c host- calln");
- #if defined(USE_RAS)
- if (IsGKRegistered())
- printf("m phone- call using gatekeepern");
- #endif
- printf("d lineno- drop calln");
- printf("l- list callsn");
- printf("o <options>- set exchange options, type o for helpn");
- printf("t lineno transfered-to_ip - transfer call n");
- printf(" (no args for help)n");
- printf("!- repeat previous commandn");
- printf("x- Exit shelln");
- }
- default:
- printf("??n");
- break;
- }
- strcpy(save,command);
- }
- }
- void
- Exchange::PlaceCall(unsigned int ip,char *phone, int faststart)
- {
- UICmdPlaceCall *msg = new UICmdPlaceCall;
- msg->remote_addr.sin_family = AF_INET;
- msg->remote_addr.sin_port = HTONS(1720);
- msg->remote_addr.sin_addr.s_addr = ip;
- msg->do_faststart = faststart;
- msg->transfer_flag = FALSE;
- if (phone)
- {
- strcpy(msg->dest_addr,phone);
- msg->dest_addr_length = strlen(phone);
- }
- else
- {
- msg->dest_addr_length = 0;
- }
- SendToExchange(PROT_UI_MSG,UI_CMD_PLACE_CALL,
- (unsigned int)msg);
- }
- void
- Exchange::PlaceTransferedToCall(int parent_index, unsigned int ip,char *phone, int invokeID, char *callID)
- {
- UICmdPlaceCall *msg = new UICmdPlaceCall;
- msg->remote_addr.sin_family = AF_INET;
- msg->remote_addr.sin_port = HTONS(1720);
- msg->remote_addr.sin_addr.s_addr = ip;
- if (phone)
- {
- strcpy(msg->dest_addr,phone);
- msg->dest_addr_length = strlen(phone);
- }
- else
- {
- msg->dest_addr_length = 0;
- }
- msg->transfer_flag = TRUE;
- msg->invokeID = invokeID;
- if (callID)
- strncpy(msg->callID, callID, 5);
- msg->parent_index = parent_index;
- SendToExchange(PROT_UI_MSG,UI_CMD_PLACE_CALL,
- (unsigned int)msg);
- }
- void Exchange::DropTranferringCall(int line_no)
- {
- UICmdHangup *msg = new UICmdHangup;
- msg->line_no = line_no;
- msg->transfer_flag = TRUE;
- SendToExchange(PROT_UI_MSG,UI_CMD_HANGUP,
- (unsigned int)msg);
- }
- void Exchange::DropCall(int line_no)
- {
- UICmdHangup *msg = new UICmdHangup;
- msg->line_no = line_no;
- SendToExchange(PROT_UI_MSG,UI_CMD_HANGUP,
- (unsigned int)msg);
- }
- void
- Exchange::SendFacility(int lineno, H450SSseq *ssSeq)
- {
- UICmdFacility *msg = new UICmdFacility;
- msg->line_no = lineno;
- msg->suppsvcs = ssSeq;
- SendToExchange(PROT_UI_MSG,UI_CMD_FACILITY,
- (unsigned int)msg);
- }
- unsigned int
- HostNameToIP(char *hostname)
- {
- unsigned int remote_address = inet_addr(hostname);
- #if !defined(VXWORKS)
- if (remote_address == INADDR_NONE)
- {
- hostent
- *hent_p = gethostbyname(hostname);
- if(hent_p == NULL)
- {
- printf("gethostbyname failed on %s error %dn",
- hostname,errno);
- return remote_address;
- }
- remote_address = *(unsigned long *)(hent_p->h_addr_list[0]);
- }
- #else
- if ( remote_address == INADDR_NONE)
- {
- remote_address = hostGetByName(hostname);
- if ( remote_address == INADDR_NONE)
- {
- printf("hostGetByName failed on %s error %dn",
- hostname,errno);
- return remote_address;
- }
- }
- #endif
- return remote_address;
- }
- #if defined(VXWORKS)
- BOOL
- IsValidMemBlock(void *ptr)
- {
- PART_ID partId;
- BLOCK_HDR * pHdr;
- BOOL on_free_list,on_alloc_list;
- partId = memSysPartId;
- pHdr = BLOCK_TO_HDR(ptr);
- semTake (&(partId->sem), WAIT_FOREVER);
- on_alloc_list = memPartBlockIsValid (partId, pHdr, FALSE);
- on_free_list = memPartBlockIsValid (partId, pHdr, TRUE);
- semGive (&(partId->sem));
- if (on_alloc_list || on_free_list)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- #endif
- #if !defined(VXWORKS)
- void show_usage (const char * progname)
- {
- fprintf (stderr,
- "Usage: %s [-q #] [-e e164] [-h h323ID] [-r #] [-g gkaddr] [-d] [-v] n"
- " where -q # is the Q.931 signaling port (default 1720)n"
- " -e e164 is the E.164 prefix phone number (default 555),n"
- " the app will append numbers 0000-NUM_PORTS e.g. 0000-2000n"
- " -h h323ID is the H.323 alias (default elemedia),n"
- #if defined(USE_RAS)
- " -r # is the local RAS port (default 1719)n"
- " -g x.x.x.x is the gatekeeper IP addr for manual RRQ(default 127.0.0.1)n"
- " -d (discover) discover gatekeeper and register with anyone responded,n"
- " Note that this option overrides -gn"
- #endif
- " -v (verbose) displays event informationnn",
- progname);
- }
- int parse_command_line (int argc, char * argv [])
- {
- int opt;
- int need_usage = 0;
- #if defined(USE_RAS)
- while ((opt = getopt (argc, argv, "e:h:g:r:q:dv?")) != EOF)
- #else
- while ((opt = getopt (argc, argv, "e:h:q:v?")) != EOF)
- #endif
- {
- switch (opt)
- {
- case 'q':
- {
- if (sscanf (optarg, "%ul", &config->q931port) < 1)
- {
- LOG_ERROR("%s: bad q931port option: %sn", argv [0], optarg);
- need_usage = 1;
- }
- else
- printf("q931port=<%d>n", config->q931port);
- break;
- }
- case 'e':
- {
- if (sscanf (optarg, "%s", &config->e164src[0]) < 1)
- {
- LOG_ERROR("%s: bad e164 alias option: %sn", argv [0], optarg);
- need_usage = 1;
- }
- else
- printf("e164src=<%s>n", config->e164src);
- break;
- }
- case 'h':
- {
- if (sscanf (optarg, "%s", &config->h323IDsrc[0]) < 1)
- {
- LOG_ERROR("%s: bad h323 alias option: %sn", argv [0], optarg);
- need_usage = 1;
- }
- else
- printf("h323IDsrc=<%s>n", config->h323IDsrc);
- break;
- }
- #if defined(USE_RAS)
- case 'g':
- {
- if (sscanf (optarg, "%s", &config->gkaddrstr[0]) < 1)
- {
- LOG_ERROR("%s: bad gkaddrstr option: %sn", argv [0], optarg);
- need_usage = 1;
- }
- else
- printf("gkaddrstr=<%s>n", config->gkaddrstr);
- break;
- }
- case 'r':
- {
- if (sscanf (optarg, "%ul", &config->localrasport) < 1)
- {
- LOG_ERROR("%s: bad localrasport option: %sn", argv [0], optarg);
- need_usage = 1;
- }
- else
- printf("localrasport=<%d>n", config->localrasport);
- break;
- }
- case 'd':
- {
- config->discoverGK = TRUE;
- break;
- }
- #endif
- case 'v':
- {
- config->verbose = TRUE;
- break;
- }
- case '?':
- default:
- {
- need_usage = 1;
- break;
- }
- }
- }
- return need_usage;
- }
- #endif