Commit b2b01900 authored by Niels Möller's avatar Niels Möller

New files.

Rev: src/crypto.c:1.1
Rev: src/crypto.h:1.1
Rev: src/lshd.c:1.1
Rev: src/session.c:1.1
parent 1010ae53
/* crypto.c
*
*/
#include "crypto.h"
static void do_crypt_none(struct crypto_instance *ignored,
UINT32 length, UINT8 *dst, UINT8 *src)
{
if (src != dst)
memcpy(dst, src, length);
}
struct crypto_instance crypto_none_instance =
{
8,
do_crypt_none
};
/* crypto.h
*
*/
#ifndef LSH_CRYPTO_H_INCLUDED
#define LSH_CRYPTO_H_INCLUDED
#include "abstract_crypto.h"
struct crypto_instance crypto_none_instance;
#endif
/* lshd.c
*
* main server program.
*/
#include <getopt.h>
#include "io.h"
#include "werror.h"
#include "server.h"
/* Global variable */
struct io_backend backend;
void usage() NORETURN;
void usage()
{
exit(1);
}
int main(int argc, char **argv)
{
char *port = "ssh";
int verbose;
int option;
/* For filtering messages. Could perhaps also be used when converting
* strings to and from UTF8. */
setlocale(LC_CTYPE, "");
while((option = getopt(argc, argv, "dp:q")) != -1)
switch(option)
{
case 'p':
port = optarg;
break;
case 'q':
quiet_flag = 1;
break;
case 'd':
debug_flag = 1;
break;
default:
usage();
}
if ( (argc - optind) != 0)
usage();
if (!get_inaddr(&remote, NULL, port, "tcp"))
{
fprintf(stderr, "No such host or service");
exit(1);
}
{
struct server_callback connected = {
{ (fd_callback_f) server_initiate },
&backend,
BLOCK_SIZE;
};
io_connect(&backend, &remote, NULL,
make_client_callback(backend, BLOCK_SIZE));
}
io_run();
return 0;
}
/* session.c
*
*/
#include "session.h"
struct session *ssh_session_alloc()
{
struct ssh_session *session = xalloc(sizeof(struct ssh_session));
memset(session, 0, sizeof(struct ssh_Session));
session->max_packet = 0x8000;
return session;
}
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