Commit 3a9b7529 authored by Niels Möller's avatar Niels Möller
Browse files

Added verbose option.

Rev: src/lsh.c:1.5
Rev: src/lshd.c:1.3
parent 82e3e297
...@@ -28,7 +28,6 @@ int main(int argc, char **argv) ...@@ -28,7 +28,6 @@ int main(int argc, char **argv)
{ {
char *host = NULL; char *host = NULL;
char *port = "ssh"; char *port = "ssh";
/* int verbose; */
int option; int option;
struct sockaddr_in remote; struct sockaddr_in remote;
...@@ -37,7 +36,7 @@ int main(int argc, char **argv) ...@@ -37,7 +36,7 @@ int main(int argc, char **argv)
* strings to and from UTF8. */ * strings to and from UTF8. */
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
while((option = getopt(argc, argv, "dp:q")) != -1) while((option = getopt(argc, argv, "dp:qv")) != -1)
switch(option) switch(option)
{ {
case 'p': case 'p':
...@@ -49,6 +48,9 @@ int main(int argc, char **argv) ...@@ -49,6 +48,9 @@ int main(int argc, char **argv)
case 'd': case 'd':
debug_flag = 1; debug_flag = 1;
break; break;
case 'v':
verbose_flag = 1;
break;
default: default:
usage(); usage();
} }
......
...@@ -3,12 +3,17 @@ ...@@ -3,12 +3,17 @@
* main server program. * main server program.
*/ */
#include <getopt.h> #include <stdio.h>
#include <locale.h>
#include "getopt.h"
#include "io.h" #include "io.h"
#include "werror.h" #include "werror.h"
#include "server.h" #include "server.h"
#define BLOCK_SIZE 32768
/* Global variable */ /* Global variable */
struct io_backend backend; struct io_backend backend;
...@@ -23,7 +28,6 @@ int main(int argc, char **argv) ...@@ -23,7 +28,6 @@ int main(int argc, char **argv)
{ {
char *host = NULL; /* Interface to bind */ char *host = NULL; /* Interface to bind */
char *port = "ssh"; char *port = "ssh";
int verbose;
int option; int option;
struct sockaddr_in local; struct sockaddr_in local;
...@@ -32,7 +36,7 @@ int main(int argc, char **argv) ...@@ -32,7 +36,7 @@ int main(int argc, char **argv)
* strings to and from UTF8. */ * strings to and from UTF8. */
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
while((option = getopt(argc, argv, "dp:qi:")) != -1) while((option = getopt(argc, argv, "dp:qi:v")) != -1)
switch(option) switch(option)
{ {
case 'p': case 'p':
...@@ -47,6 +51,9 @@ int main(int argc, char **argv) ...@@ -47,6 +51,9 @@ int main(int argc, char **argv)
case 'i': case 'i':
host = optarg; host = optarg;
break; break;
case 'v':
verbose_flag = 1;
break;
default: default:
usage(); usage();
} }
...@@ -60,18 +67,12 @@ int main(int argc, char **argv) ...@@ -60,18 +67,12 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
{
struct server_callback connected = {
{ (fd_callback_f) server_initiate },
&backend,
BLOCK_SIZE;
};
io_listen(&backend, &local, io_listen(&backend, &local,
make_server_callback(backend, BLOCK_SIZE)); make_server_callback(&backend,
} "lsh - a free ssh",
BLOCK_SIZE));
io_run(); io_run(&backend);
return 0; return 0;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment