xref: /original-bsd/lib/libtelnet/misc.c (revision c3e32dec)
1 /*-
2  * Copyright (c) 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)misc.c	8.1 (Berkeley) 06/04/93";
10 #endif /* not lint */
11 
12 #include "misc.h"
13 
14 char *RemoteHostName;
15 char *LocalHostName;
16 char *UserNameRequested = 0;
17 int ConnectedCount = 0;
18 
19 	void
20 auth_encrypt_init(local, remote, name, server)
21 	char *local;
22 	char *remote;
23 	char *name;
24 	int server;
25 {
26 	RemoteHostName = remote;
27 	LocalHostName = local;
28 #if	defined(AUTHENTICATION)
29 	auth_init(name, server);
30 #endif
31 #ifdef	ENCRYPTION
32 	encrypt_init(name, server);
33 #endif	/* ENCRYPTION */
34 	if (UserNameRequested) {
35 		free(UserNameRequested);
36 		UserNameRequested = 0;
37 	}
38 }
39 
40 	void
41 auth_encrypt_user(name)
42 	char *name;
43 {
44 	extern char *strdup();
45 
46 	if (UserNameRequested)
47 		free(UserNameRequested);
48 	UserNameRequested = name ? strdup(name) : 0;
49 }
50 
51 	void
52 auth_encrypt_connect(cnt)
53 	int cnt;
54 {
55 }
56 
57 	void
58 printd(data, cnt)
59 	unsigned char *data;
60 	int cnt;
61 {
62 	if (cnt > 16)
63 		cnt = 16;
64 	while (cnt-- > 0) {
65 		printf(" %02x", *data);
66 		++data;
67 	}
68 }
69