git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1187 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-01-24 23:13:35 +00:00
parent 7984aaf260
commit 3d7c57acdb
18 changed files with 467 additions and 566 deletions

View File

@@ -53,63 +53,58 @@
* or implied warranty.
*/
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
/* $Id$ */
#if defined(AUTHENTICATION)
Authenticator *findauthenticator P((int, int));
Authenticator *findauthenticator (int, int);
void auth_init P((char *, int));
int auth_cmd P((int, char **));
void auth_request P((void));
void auth_send P((unsigned char *, int));
void auth_send_retry P((void));
void auth_is P((unsigned char *, int));
void auth_reply P((unsigned char *, int));
void auth_finished P((Authenticator *, int));
int auth_wait P((char *));
void auth_disable_name P((char *));
void auth_gen_printsub P((unsigned char *, int, unsigned char *, int));
void auth_init (char *, int);
int auth_cmd (int, char **);
void auth_request (void);
void auth_send (unsigned char *, int);
void auth_send_retry (void);
void auth_is (unsigned char *, int);
void auth_reply (unsigned char *, int);
void auth_finished (Authenticator *, int);
int auth_wait (char *);
void auth_disable_name (char *);
void auth_gen_printsub (unsigned char *, int, unsigned char *, int);
#ifdef UNSAFE
int unsafe_init P((Authenticator *, int));
int unsafe_send P((Authenticator *));
void unsafe_is P((Authenticator *, unsigned char *, int));
void unsafe_reply P((Authenticator *, unsigned char *, int));
int unsafe_status P((Authenticator *, char *, int));
void unsafe_printsub P((unsigned char *, int, unsigned char *, int));
int unsafe_init (Authenticator *, int);
int unsafe_send (Authenticator *);
void unsafe_is (Authenticator *, unsigned char *, int);
void unsafe_reply (Authenticator *, unsigned char *, int);
int unsafe_status (Authenticator *, char *, int);
void unsafe_printsub (unsigned char *, int, unsigned char *, int);
#endif
#ifdef SRA
int sra_init P((Authenticator *, int));
int sra_send P((Authenticator *));
void sra_is P((Authenticator *, unsigned char *, int));
void sra_reply P((Authenticator *, unsigned char *, int));
int sra_status P((Authenticator *, char *, int));
void sra_printsub P((unsigned char *, int, unsigned char *, int));
int sra_init (Authenticator *, int);
int sra_send (Authenticator *);
void sra_is (Authenticator *, unsigned char *, int);
void sra_reply (Authenticator *, unsigned char *, int);
int sra_status (Authenticator *, char *, int);
void sra_printsub (unsigned char *, int, unsigned char *, int);
#endif
#ifdef KRB4
int kerberos4_init P((Authenticator *, int));
int kerberos4_send_mutual P((Authenticator *));
int kerberos4_send_oneway P((Authenticator *));
void kerberos4_is P((Authenticator *, unsigned char *, int));
void kerberos4_reply P((Authenticator *, unsigned char *, int));
int kerberos4_status P((Authenticator *, char *, int));
void kerberos4_printsub P((unsigned char *, int, unsigned char *, int));
int kerberos4_init (Authenticator *, int);
int kerberos4_send_mutual (Authenticator *);
int kerberos4_send_oneway (Authenticator *);
void kerberos4_is (Authenticator *, unsigned char *, int);
void kerberos4_reply (Authenticator *, unsigned char *, int);
int kerberos4_status (Authenticator *, char *, int);
void kerberos4_printsub (unsigned char *, int, unsigned char *, int);
#endif
#ifdef KRB5
int kerberos5_init P((Authenticator *, int));
int kerberos5_send P((Authenticator *));
void kerberos5_is P((Authenticator *, unsigned char *, int));
void kerberos5_reply P((Authenticator *, unsigned char *, int));
int kerberos5_status P((Authenticator *, char *, int));
void kerberos5_printsub P((unsigned char *, int, unsigned char *, int));
int kerberos5_init (Authenticator *, int);
int kerberos5_send_mutual (Authenticator *);
int kerberos5_send_oneway (Authenticator *);
void kerberos5_is (Authenticator *, unsigned char *, int);
void kerberos5_reply (Authenticator *, unsigned char *, int);
int kerberos5_status (Authenticator *, char *, int);
void kerberos5_printsub (unsigned char *, int, unsigned char *, int);
#endif
#endif

View File

@@ -148,9 +148,16 @@ Authenticator authenticators[] = {
spx_printsub },
#endif
#ifdef KRB5
{ AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL,
kerberos5_init,
kerberos5_send_mutual,
kerberos5_is,
kerberos5_reply,
kerberos5_status,
kerberos5_printsub },
{ AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
kerberos5_init,
kerberos5_send,
kerberos5_send_oneway,
kerberos5_is,
kerberos5_reply,
kerberos5_status,

View File

@@ -53,6 +53,8 @@
* or implied warranty.
*/
/* $Id$ */
#ifndef __AUTH__
#define __AUTH__
@@ -62,23 +64,15 @@
#define AUTH_USER 3 /* We know he name */
#define AUTH_VALID 4 /* We know him, and he needs no password */
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
typedef struct XauthP {
int type;
int way;
int (*init) P((struct XauthP *, int));
int (*send) P((struct XauthP *));
void (*is) P((struct XauthP *, unsigned char *, int));
void (*reply) P((struct XauthP *, unsigned char *, int));
int (*status) P((struct XauthP *, char *, int));
void (*printsub) P((unsigned char *, int, unsigned char *, int));
int (*init) (struct XauthP *, int);
int (*send) (struct XauthP *);
void (*is) (struct XauthP *, unsigned char *, int);
void (*reply) (struct XauthP *, unsigned char *, int);
int (*status) (struct XauthP *, char *, int);
void (*printsub) (unsigned char *, int, unsigned char *, int);
} Authenticator;
#include "auth-proto.h"

View File

@@ -54,63 +54,57 @@
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
/* $Id$ */
#if defined(ENCRYPTION)
void encrypt_init P((char *, int));
Encryptions *findencryption P((int));
void encrypt_send_supprt P((void));
void encrypt_auto P((int));
void decrypt_auto P((int));
void encrypt_not P((void));
void encrypt_verbose_quiet P((int));
void encrypt_is P((unsigned char *, int));
void encrypt_reply P((unsigned char *, int));
void encrypt_start_input P((int));
void encrypt_session_key P((Session_Key *, int));
void encrypt_end_input P((void));
void encrypt_start_output P((int));
void encrypt_end_output P((void));
void encrypt_send_request_start P((void));
void encrypt_send_request_end P((void));
void encrypt_send_end P((void));
void encrypt_wait P((void));
void encrypt_send_support P((void));
void encrypt_send_keyid P((int, unsigned char *, int, int));
int net_write P((unsigned char *, int));
void encrypt_init (char *, int);
Encryptions *findencryption (int);
void encrypt_send_supprt (void);
void encrypt_auto (int);
void decrypt_auto (int);
void encrypt_not (void);
void encrypt_verbose_quiet (int);
void encrypt_is (unsigned char *, int);
void encrypt_reply (unsigned char *, int);
void encrypt_start_input (int);
void encrypt_session_key (Session_Key *, int);
void encrypt_end_input (void);
void encrypt_start_output (int);
void encrypt_end_output (void);
void encrypt_send_request_start (void);
void encrypt_send_request_end (void);
void encrypt_send_end (void);
void encrypt_wait (void);
void encrypt_send_support (void);
void encrypt_send_keyid (int, unsigned char *, int, int);
int net_write (unsigned char *, int);
#ifdef TELENTD
void encrypt_wait P((void));
void encrypt_wait (void);
#else
int encrypt_cmd P((int, char **));
void encrypt_display P((void));
int encrypt_cmd (int, char **);
void encrypt_display (void);
#endif
void cfb64_encrypt P((unsigned char *, int));
int cfb64_decrypt P((int));
void cfb64_init P((int));
int cfb64_start P((int, int));
int cfb64_is P((unsigned char *, int));
int cfb64_reply P((unsigned char *, int));
void cfb64_session P((Session_Key *, int));
int cfb64_keyid P((int, unsigned char *, int *));
void cfb64_printsub P((unsigned char *, int, unsigned char *, int));
void cfb64_encrypt (unsigned char *, int);
int cfb64_decrypt (int);
void cfb64_init (int);
int cfb64_start (int, int);
int cfb64_is (unsigned char *, int);
int cfb64_reply (unsigned char *, int);
void cfb64_session (Session_Key *, int);
int cfb64_keyid (int, unsigned char *, int *);
void cfb64_printsub (unsigned char *, int, unsigned char *, int);
void ofb64_encrypt P((unsigned char *, int));
int ofb64_decrypt P((int));
void ofb64_init P((int));
int ofb64_start P((int, int));
int ofb64_is P((unsigned char *, int));
int ofb64_reply P((unsigned char *, int));
void ofb64_session P((Session_Key *, int));
int ofb64_keyid P((int, unsigned char *, int *));
void ofb64_printsub P((unsigned char *, int, unsigned char *, int));
void ofb64_encrypt (unsigned char *, int);
int ofb64_decrypt (int);
void ofb64_init (int);
int ofb64_start (int, int);
int ofb64_is (unsigned char *, int);
int ofb64_reply (unsigned char *, int);
void ofb64_session (Session_Key *, int);
int ofb64_keyid (int, unsigned char *, int *);
void ofb64_printsub (unsigned char *, int, unsigned char *, int);
#endif

View File

@@ -115,14 +115,14 @@ struct keyidlist {
#define FB64_IV_BAD 3
void fb64_stream_iv P((des_cblock, struct stinfo *));
void fb64_init P((struct fb *));
static int fb64_start P((struct fb *, int, int));
int fb64_is P((unsigned char *, int, struct fb *));
int fb64_reply P((unsigned char *, int, struct fb *));
static void fb64_session P((Session_Key *, int, struct fb *));
void fb64_stream_key P((des_cblock, struct stinfo *));
int fb64_keyid P((int, unsigned char *, int *, struct fb *));
void fb64_stream_iv (des_cblock, struct stinfo *);
void fb64_init (struct fb *);
static int fb64_start (struct fb *, int, int);
int fb64_is (unsigned char *, int, struct fb *);
int fb64_reply (unsigned char *, int, struct fb *);
static void fb64_session (Session_Key *, int, struct fb *);
void fb64_stream_key (des_cblock, struct stinfo *);
int fb64_keyid (int, unsigned char *, int *, struct fb *);
void cfb64_init(int server)
{

View File

@@ -67,21 +67,15 @@ RCSID("$Id$");
#include "encrypt.h"
#include "misc.h"
#ifdef __STDC__
#include <stdlib.h>
#endif
#ifdef NO_STRING_H
#include <strings.h>
#else
#include <string.h>
#endif
/*
* These functions pointers point to the current routines
* for encrypting and decrypting data.
*/
void (*encrypt_output) P((unsigned char *, int));
int (*decrypt_input) P((int));
void (*encrypt_output) (unsigned char *, int);
int (*decrypt_input) (int);
char *nclearto;
int encrypt_debug_mode = 0;

View File

@@ -55,6 +55,7 @@
* or implied warranty.
*/
/* $Id$ */
#ifndef __ENCRYPT__
#define __ENCRYPT__
@@ -73,26 +74,18 @@ typedef struct {
unsigned char *data;
} Session_Key;
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
typedef struct {
char *name;
int type;
void (*output) P((unsigned char *, int));
int (*input) P((int));
void (*init) P((int));
int (*start) P((int, int));
int (*is) P((unsigned char *, int));
int (*reply) P((unsigned char *, int));
void (*session) P((Session_Key *, int));
int (*keyid) P((int, unsigned char *, int *));
void (*printsub) P((unsigned char *, int, unsigned char *, int));
void (*output) (unsigned char *, int);
int (*input) (int);
void (*init) (int);
int (*start) (int, int);
int (*is) (unsigned char *, int);
int (*reply) (unsigned char *, int);
void (*session) (Session_Key *, int);
int (*keyid) (int, unsigned char *, int *);
void (*printsub) (unsigned char *, int, unsigned char *, int);
} Encryptions;
#define SK_DES 1 /* Matched Kerberos v5 KEYTYPE_DES */
@@ -100,6 +93,6 @@ typedef struct {
#include "enc-proto.h"
extern int encrypt_debug_mode;
extern int (*decrypt_input) P((int));
extern void (*encrypt_output) P((unsigned char *, int));
extern int (*decrypt_input) (int);
extern void (*encrypt_output) (unsigned char *, int);
#endif

View File

@@ -31,10 +31,9 @@
* SUCH DAMAGE.
*/
#ifndef lint
static char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95";
#endif /* not lint */
#include <config.h>
RCSID("$Id$");
#include <ctype.h>
@@ -97,7 +96,7 @@ genget(char *name, char **table, int stlen)
* Function call version of Ambiguous()
*/
int
Ambiguous(char *s)
Ambiguous(void *s)
{
return((char **)s == &ambiguous);
}

View File

@@ -80,7 +80,7 @@ RCSID("$Id$");
#include "auth.h"
#include "misc.h"
int kerberos4_cksum P((unsigned char *, int));
int kerberos4_cksum (unsigned char *, int);
extern int auth_debug_mode;
static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0,
@@ -306,9 +306,12 @@ kerberos4_is(Authenticator *ap, unsigned char *data, int cnt)
Data(ap, KRB_REJECT, NULL, 0);
sprintf (msg, "user `%s' is not authorized to "
"login as `%s'",
#if 0
krb_unparse_name_long(adat.pname,
adat.pinst,
adat.prealm),
#endif
NULL,
UserNameRequested);
Data(ap, KRB_REJECT, (void *)msg, -1);

View File

@@ -79,21 +79,15 @@ RCSID("$Id$");
#include <des.h>
#include <krb.h>
#ifdef __STDC__
#include <stdlib.h>
#endif
#ifdef NO_STRING_H
#include <strings.h>
#else
#include <string.h>
#endif
#include "encrypt.h"
#include "auth.h"
#include "misc.h"
int krb_mk_encpwd_req P((KTEXT, char *, char *, char *, char *, char *, char *));
int krb_rd_encpwd_req P((KTEXT, char *, char *, u_long, AUTH_DAT *, char *, char *, char *, char *));
int krb_mk_encpwd_req (KTEXT, char *, char *, char *, char *, char *, char *);
int krb_rd_encpwd_req (KTEXT, char *, char *, u_long, AUTH_DAT *, char *, char *, char *, char *);
extern auth_debug_mode;

View File

@@ -53,30 +53,25 @@
* or implied warranty.
*/
/* $Id$ */
#ifndef __MISC_PROTO__
#define __MISC_PROTO__
#if !defined(P)
#ifdef __STDC__
#define P(x) x
#else
#define P(x) ()
#endif
#endif
void auth_encrypt_init P((char *, char *, char *, int));
void auth_encrypt_connect P((int));
void printd P((unsigned char *, int));
char** genget P((char *name, char **table, int stlen));
void auth_encrypt_init (char *, char *, char *, int);
void auth_encrypt_connect (int);
void printd (unsigned char *, int);
char** genget (char *name, char **table, int stlen);
int isprefix(char *s1, char *s2);
int Ambiguous(void *s);
/*
* These functions are imported from the application
*/
int net_write P((unsigned char *, int));
void net_encrypt P((void));
int telnet_spin P((void));
char *telnet_getenv P((char *));
char *telnet_gets P((char *, char *, int, int));
int net_write (unsigned char *, int);
void net_encrypt (void);
int telnet_spin (void);
char *telnet_getenv (char *);
char *telnet_gets (char *, char *, int, int);
#endif

View File

@@ -50,10 +50,8 @@ RCSID("$Id$");
#include "defines.h"
#include "types.h"
int
net_write(str, len)
unsigned char *str;
int len;
int
net_write(unsigned char *str, int len)
{
if (NETROOM() > len) {
ring_supply_data(&netoring, str, len);
@@ -64,7 +62,7 @@ net_write(str, len)
return(0);
}
void
void
net_encrypt()
{
#if defined(ENCRYPTION)
@@ -75,25 +73,20 @@ net_encrypt()
#endif
}
int
int
telnet_spin()
{
return(-1);
}
char *
telnet_getenv(val)
char *val;
char *
telnet_getenv(char *val)
{
return((char *)env_getvalue((unsigned char *)val));
}
char *
telnet_gets(prompt, result, length, echo)
char *prompt;
char *result;
int length;
int echo;
char *
telnet_gets(char *prompt, char *result, int length, int echo)
{
extern char *getpass();
extern int globalmode;

View File

@@ -38,47 +38,61 @@
RCSID("$Id$");
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <signal.h>
#include <netdb.h>
#include <ctype.h>
#include <pwd.h>
#include <stdarg.h>
#include <errno.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
#endif
#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
#endif
#ifdef HAVE_ARPA_TELNET_H
#include <arpa/telnet.h>
#endif
#include "general.h"
#include "ring.h"
#include "externs.h"
#include "defines.h"
#include "types.h"
#include "libtelnet/misc-proto.h"
#include "roken.h"
#if !defined(CRAY) && !defined(sysV88)
#include <netinet/in_systm.h>
# if (defined(vax) || defined(tahoe) || defined(hp300)) && !defined(ultrix)
# include <machine/endian.h>
# endif /* vax */
#endif /* !defined(CRAY) && !defined(sysV88) */
#include <netinet/ip.h>
#ifndef MaxHostNameLen
#define MaxHostNameLen 64
#endif
#if defined(IPPROTO_IP) && defined(IP_TOS)
int tos = -1;
#endif /* defined(IPPROTO_IP) && defined(IP_TOS) */
@@ -86,12 +100,6 @@ int tos = -1;
char *hostname;
static char _hostname[MaxHostNameLen];
extern char *getenv();
extern int isprefix();
extern char **genget();
extern int Ambiguous();
typedef int (*intrtn_t)(int, char**);
static int call(intrtn_t, ...);
@@ -107,7 +115,7 @@ static char saveline[256];
static int margc;
static char *margv[20];
static void
static void
makeargv()
{
char *cp, *cp2, c;
@@ -164,7 +172,8 @@ makeargv()
* Todo: 1. Could take random integers (12, 0x12, 012, 0b1).
*/
static char special(char *s)
static char
special(char *s)
{
char c;
char b;
@@ -189,9 +198,8 @@ static char special(char *s)
* Construct a control character sequence
* for a special character.
*/
static char *
control(c)
cc_t c;
static char *
control(cc_t c)
{
static char buf[5];
/*
@@ -245,12 +253,12 @@ struct sendlist {
static int
send_esc P((void)),
send_help P((void)),
send_docmd P((char *)),
send_dontcmd P((char *)),
send_willcmd P((char *)),
send_wontcmd P((char *));
send_esc (void),
send_help (void),
send_docmd (char *),
send_dontcmd (char *),
send_willcmd (char *),
send_wontcmd (char *);
static struct sendlist Sendlist[] = {
{ "ao", "Send Telnet Abort output", 1, 0, 0, 2, AO },
@@ -284,7 +292,8 @@ static struct sendlist Sendlist[] = {
#define GETSEND(name) ((struct sendlist *) genget(name, (char **) Sendlist, \
sizeof(struct sendlist)))
static int sendcmd(int argc, char **argv)
static int
sendcmd(int argc, char **argv)
{
int count; /* how many bytes we are going to need to send */
int i;
@@ -364,43 +373,39 @@ static int sendcmd(int argc, char **argv)
return (count == success);
}
static int
static int
send_esc()
{
NETADD(escape);
return 1;
}
static int
send_docmd(name)
char *name;
static int
send_docmd(char *name)
{
return(send_tncmd(send_do, "do", name));
}
static int
send_dontcmd(name)
char *name;
static int
send_dontcmd(char *name)
{
return(send_tncmd(send_dont, "dont", name));
}
static int
send_willcmd(name)
char *name;
static int
send_willcmd(char *name)
{
return(send_tncmd(send_will, "will", name));
}
static int
send_wontcmd(name)
char *name;
static int
send_wontcmd(char *name)
{
return(send_tncmd(send_wont, "wont", name));
}
int
send_tncmd(func, cmd, name)
void (*func)();
char *cmd, *name;
int
send_tncmd(void (*func)(), char *cmd, char *name)
{
char **cpp;
extern char *telopts[];
@@ -426,7 +431,7 @@ send_tncmd(func, cmd, name)
printf("\n");
return 0;
}
cpp = (char **)genget(name, telopts, sizeof(char *));
cpp = genget(name, telopts, sizeof(char *));
if (Ambiguous(cpp)) {
fprintf(stderr,"'%s': ambiguous argument ('send %s ?' for help).\n",
name, cmd);
@@ -460,7 +465,7 @@ send_tncmd(func, cmd, name)
return 1;
}
static int
static int
send_help()
{
struct sendlist *s; /* pointer to current command */
@@ -476,14 +481,14 @@ send_help()
* to by the arguments to the "toggle" command.
*/
static int
static int
lclchars()
{
donelclchars = 1;
return 1;
}
static int
static int
togdebug()
{
#ifndef NOT43
@@ -502,7 +507,7 @@ togdebug()
}
static int
static int
togcrlf()
{
if (crlf) {
@@ -515,9 +520,8 @@ togcrlf()
int binmode;
static int
togbinary(val)
int val;
static int
togbinary(int val)
{
donebinarytoggle = 1;
@@ -554,9 +558,8 @@ togbinary(val)
return 1;
}
static int
togrbinary(val)
int val;
static int
togrbinary(int val)
{
donebinarytoggle = 1;
@@ -581,9 +584,8 @@ togrbinary(val)
return 1;
}
static int
togxbinary(val)
int val;
static int
togxbinary(int val)
{
donebinarytoggle = 1;
@@ -609,15 +611,15 @@ togxbinary(val)
}
static int togglehelp P((void));
static int togglehelp (void);
#if defined(AUTHENTICATION)
extern int auth_togdebug P((int));
extern int auth_togdebug (int);
#endif
#if defined(ENCRYPTION)
extern int EncryptAutoEnc P((int));
extern int EncryptAutoDec P((int));
extern int EncryptDebug P((int));
extern int EncryptVerbose P((int));
extern int EncryptAutoEnc (int);
extern int EncryptAutoDec (int);
extern int EncryptDebug (int);
extern int EncryptVerbose (int);
#endif
struct togglelist {
@@ -743,7 +745,7 @@ static struct togglelist Togglelist[] = {
{ 0 }
};
static int
static int
togglehelp()
{
struct togglelist *c;
@@ -761,9 +763,8 @@ togglehelp()
return 0;
}
static void
settogglehelp(set)
int set;
static void
settogglehelp(int set)
{
struct togglelist *c;
@@ -781,10 +782,8 @@ settogglehelp(set)
#define GETTOGGLE(name) (struct togglelist *) \
genget(name, (char **) Togglelist, sizeof(struct togglelist))
static int
toggle(argc, argv)
int argc;
char *argv[];
static int
toggle(int argc, char *argv[])
{
int retval = 1;
char *name;
@@ -895,17 +894,15 @@ _setlist_init()
}
#endif /* defined(CRAY) && !defined(__STDC__) */
static struct setlist *
getset(name)
char *name;
static struct setlist *
getset(char *name)
{
return (struct setlist *)
genget(name, (char **) Setlist, sizeof(struct setlist));
}
void
set_escape_char(s)
char *s;
void
set_escape_char(char *s)
{
if (rlogin != _POSIX_VDISABLE) {
rlogin = (s && *s) ? special(s) : _POSIX_VDISABLE;
@@ -917,10 +914,8 @@ set_escape_char(s)
}
}
static int
setcmd(argc, argv)
int argc;
char *argv[];
static int
setcmd(int argc, char *argv[])
{
int value;
struct setlist *ct;
@@ -990,10 +985,8 @@ setcmd(argc, argv)
return 1;
}
static int
unsetcmd(argc, argv)
int argc;
char *argv[];
static int
unsetcmd(int argc, char *argv[])
{
struct setlist *ct;
struct togglelist *c;
@@ -1060,7 +1053,8 @@ unsetcmd(argc, argv)
#ifdef KLUDGELINEMODE
extern int kludgelinemode;
static int dokludgemode(void)
static int
dokludgemode(void)
{
kludgelinemode = 1;
send_wont(TELOPT_LINEMODE, 1);
@@ -1070,7 +1064,7 @@ static int dokludgemode(void)
}
#endif
static int
static int
dolinemode()
{
#ifdef KLUDGELINEMODE
@@ -1082,7 +1076,7 @@ dolinemode()
return 1;
}
static int
static int
docharmode()
{
#ifdef KLUDGELINEMODE
@@ -1095,9 +1089,8 @@ docharmode()
return 1;
}
static int
dolmmode(bit, on)
int bit, on;
static int
dolmmode(int bit, int on)
{
unsigned char c;
extern int linemode;
@@ -1116,14 +1109,14 @@ dolmmode(bit, on)
return 1;
}
int
setmode(bit)
static int
tn_setmode(int bit)
{
return dolmmode(bit, 1);
}
int
clearmode(bit)
static int
tn_clearmode(int bit)
{
return dolmmode(bit, 0);
}
@@ -1136,7 +1129,7 @@ struct modelist {
int arg1;
};
extern int modehelp();
static int modehelp();
static struct modelist ModeList[] = {
{ "character", "Disable LINEMODE option", docharmode, 1 },
@@ -1149,18 +1142,18 @@ static struct modelist ModeList[] = {
#endif
{ "", "", 0 },
{ "", "These require the LINEMODE option to be enabled", 0 },
{ "isig", "Enable signal trapping", setmode, 1, MODE_TRAPSIG },
{ "+isig", 0, setmode, 1, MODE_TRAPSIG },
{ "-isig", "Disable signal trapping", clearmode, 1, MODE_TRAPSIG },
{ "edit", "Enable character editing", setmode, 1, MODE_EDIT },
{ "+edit", 0, setmode, 1, MODE_EDIT },
{ "-edit", "Disable character editing", clearmode, 1, MODE_EDIT },
{ "softtabs", "Enable tab expansion", setmode, 1, MODE_SOFT_TAB },
{ "+softtabs", 0, setmode, 1, MODE_SOFT_TAB },
{ "-softtabs", "Disable character editing", clearmode, 1, MODE_SOFT_TAB },
{ "litecho", "Enable literal character echo", setmode, 1, MODE_LIT_ECHO },
{ "+litecho", 0, setmode, 1, MODE_LIT_ECHO },
{ "-litecho", "Disable literal character echo", clearmode, 1, MODE_LIT_ECHO },
{ "isig", "Enable signal trapping", tn_setmode, 1, MODE_TRAPSIG },
{ "+isig", 0, tn_setmode, 1, MODE_TRAPSIG },
{ "-isig", "Disable signal trapping", tn_clearmode, 1, MODE_TRAPSIG },
{ "edit", "Enable character editing", tn_setmode, 1, MODE_EDIT },
{ "+edit", 0, tn_setmode, 1, MODE_EDIT },
{ "-edit", "Disable character editing", tn_clearmode, 1, MODE_EDIT },
{ "softtabs", "Enable tab expansion", tn_setmode, 1, MODE_SOFT_TAB },
{ "+softtabs", 0, tn_setmode, 1, MODE_SOFT_TAB },
{ "-softtabs", "Disable character editing", tn_clearmode, 1, MODE_SOFT_TAB },
{ "litecho", "Enable literal character echo", tn_setmode, 1, MODE_LIT_ECHO },
{ "+litecho", 0, tn_setmode, 1, MODE_LIT_ECHO },
{ "-litecho", "Disable literal character echo", tn_clearmode, 1, MODE_LIT_ECHO },
{ "help", 0, modehelp, 0 },
#ifdef KLUDGELINEMODE
{ "kludgeline", 0, dokludgemode, 1 },
@@ -1171,7 +1164,7 @@ static struct modelist ModeList[] = {
};
int
static int
modehelp()
{
struct modelist *mt;
@@ -1191,10 +1184,8 @@ modehelp()
#define GETMODECMD(name) (struct modelist *) \
genget(name, (char **) ModeList, sizeof(struct modelist))
static int
modecmd(argc, argv)
int argc;
char *argv[];
static int
modecmd(int argc, char **argv)
{
struct modelist *mt;
@@ -1219,10 +1210,8 @@ modecmd(argc, argv)
* "display" command.
*/
static int
display(argc, argv)
int argc;
char *argv[];
static int
display(int argc, char *argv[])
{
struct togglelist *tl;
struct setlist *sl;
@@ -1290,10 +1279,8 @@ display(argc, argv)
/*
* Set the escape character.
*/
static int
setescape(argc, argv)
int argc;
char *argv[];
static int
setescape(int argc, char *argv[])
{
char *arg;
char buf[50];
@@ -1316,8 +1303,7 @@ setescape(argc, argv)
return 1;
}
/*VARARGS*/
static int
static int
togcrmod()
{
crmod = !crmod;
@@ -1327,8 +1313,7 @@ togcrmod()
return 1;
}
/*VARARGS*/
int
static int
suspend()
{
#ifdef SIGTSTP
@@ -1357,8 +1342,7 @@ suspend()
return 1;
}
/*ARGSUSED*/
int
static int
shell(int argc, char **argv)
{
long oldrows, oldcols, newrows, newcols, err;
@@ -1404,7 +1388,8 @@ shell(int argc, char **argv)
return 1;
}
static int bye(int argc, char **argv)
static int
bye(int argc, char **argv)
{
extern int resettermname;
@@ -1425,16 +1410,15 @@ static int bye(int argc, char **argv)
return 0; /* NOTREACHED */
}
/*VARARGS*/
int quit(void)
int
quit(void)
{
call(bye, "bye", "fromquit", 0);
Exit(0);
return 0; /*NOTREACHED*/
}
/*VARARGS*/
int
static int
logout()
{
send_do(TELOPT_LOGOUT, 1);
@@ -1468,7 +1452,7 @@ struct slclist SlcList[] = {
{ 0 },
};
static void
static void
slc_help()
{
struct slclist *c;
@@ -1483,15 +1467,15 @@ slc_help()
}
}
static struct slclist *
getslc(name)
char *name;
static struct slclist *
getslc(char *name)
{
return (struct slclist *)
genget(name, (char **) SlcList, sizeof(struct slclist));
}
static int slccmd(int argc, char **argv)
static int
slccmd(int argc, char **argv)
{
struct slclist *c;
@@ -1528,15 +1512,15 @@ struct envlist {
};
extern struct env_lst *
env_define P((unsigned char *, unsigned char *));
env_define (unsigned char *, unsigned char *);
extern void
env_undefine P((unsigned char *)),
env_export P((unsigned char *)),
env_unexport P((unsigned char *)),
env_send P((unsigned char *)),
env_list P((void));
env_undefine (unsigned char *),
env_export (unsigned char *),
env_unexport (unsigned char *),
env_send (unsigned char *),
env_list (void);
static void
env_help P((void));
env_help (void);
struct envlist EnvList[] = {
{ "define", "Define an environment variable",
@@ -1555,7 +1539,7 @@ struct envlist EnvList[] = {
{ 0 },
};
static void
static void
env_help()
{
struct envlist *c;
@@ -1570,15 +1554,15 @@ env_help()
}
}
static struct envlist *
getenvcmd(name)
char *name;
static struct envlist *
getenvcmd(char *name)
{
return (struct envlist *)
genget(name, (char **) EnvList, sizeof(struct envlist));
}
int env_cmd(int argc, char **argv)
static int
env_cmd(int argc, char **argv)
{
struct envlist *c;
@@ -1620,9 +1604,8 @@ struct env_lst {
struct env_lst envlisthead;
struct env_lst *
env_find(var)
unsigned char *var;
struct env_lst *
env_find(unsigned char *var)
{
struct env_lst *ep;
@@ -1637,7 +1620,7 @@ env_find(var)
#define environ _environ
#endif
void
void
env_init()
{
extern char **environ;
@@ -1694,9 +1677,8 @@ env_init()
env_export((unsigned char *)"XAUTHORITY");
}
struct env_lst *
env_define(var, value)
unsigned char *var, *value;
struct env_lst *
env_define(unsigned char *var, unsigned char *value)
{
struct env_lst *ep;
@@ -1720,9 +1702,8 @@ env_define(var, value)
return(ep);
}
void
env_undefine(var)
unsigned char *var;
void
env_undefine(unsigned char *var)
{
struct env_lst *ep;
@@ -1738,9 +1719,8 @@ env_undefine(var)
}
}
void
env_export(var)
unsigned char *var;
void
env_export(unsigned char *var)
{
struct env_lst *ep;
@@ -1748,9 +1728,8 @@ env_export(var)
ep->export = 1;
}
void
env_unexport(var)
unsigned char *var;
void
env_unexport(unsigned char *var)
{
struct env_lst *ep;
@@ -1758,9 +1737,8 @@ env_unexport(var)
ep->export = 0;
}
void
env_send(var)
unsigned char *var;
void
env_send(unsigned char *var)
{
struct env_lst *ep;
@@ -1785,7 +1763,7 @@ env_send(var)
env_opt_end(0);
}
void
void
env_list()
{
struct env_lst *ep;
@@ -1796,9 +1774,8 @@ env_list()
}
}
unsigned char *
env_default(init, welldefined)
int init;
unsigned char *
env_default(int init, int welldefined)
{
static struct env_lst *nep = NULL;
@@ -1815,9 +1792,8 @@ env_default(init, welldefined)
return(NULL);
}
unsigned char *
env_getvalue(var)
unsigned char *var;
unsigned char *
env_getvalue(unsigned char *var)
{
struct env_lst *ep;
@@ -1840,11 +1816,11 @@ struct authlist {
};
extern int
auth_enable P((char *)),
auth_disable P((char *)),
auth_status P((void));
auth_enable (char *),
auth_disable (char *),
auth_status (void);
static int
auth_help P((void));
auth_help (void);
struct authlist AuthList[] = {
{ "status", "Display current status of authentication information",
@@ -1858,7 +1834,7 @@ struct authlist AuthList[] = {
{ 0 },
};
static int
static int
auth_help()
{
struct authlist *c;
@@ -1874,7 +1850,8 @@ auth_help()
return 0;
}
int auth_cmd(int argc, char **argv)
static int
auth_cmd(int argc, char **argv)
{
struct authlist *c;
@@ -1923,18 +1900,18 @@ struct encryptlist {
};
extern int
EncryptEnable P((char *, char *)),
EncryptDisable P((char *, char *)),
EncryptType P((char *, char *)),
EncryptStart P((char *)),
EncryptStartInput P((void)),
EncryptStartOutput P((void)),
EncryptStop P((char *)),
EncryptStopInput P((void)),
EncryptStopOutput P((void)),
EncryptStatus P((void));
EncryptEnable (char *, char *),
EncryptDisable (char *, char *),
EncryptType (char *, char *),
EncryptStart (char *),
EncryptStartInput (void),
EncryptStartOutput (void),
EncryptStop (char *),
EncryptStopInput (void),
EncryptStopOutput (void),
EncryptStatus (void);
static int
EncryptHelp P((void));
EncryptHelp (void);
struct encryptlist EncryptList[] = {
{ "enable", "Enable encryption. ('encrypt enable ?' for more)",
@@ -1963,7 +1940,7 @@ struct encryptlist EncryptList[] = {
{ 0 },
};
static int
static int
EncryptHelp()
{
struct encryptlist *c;
@@ -1979,7 +1956,8 @@ EncryptHelp()
return 0;
}
int encrypt_cmd(int argc, char **argv)
static int
encrypt_cmd(int argc, char **argv)
{
struct encryptlist *c;
@@ -2026,7 +2004,8 @@ int encrypt_cmd(int argc, char **argv)
* Print status about the connection.
*/
static int status(int argc, char **argv)
static int
status(int argc, char **argv)
{
if (connected) {
printf("Connected to %s.\n", hostname);
@@ -2080,7 +2059,8 @@ static char rcbuf[128];
static Command *getcmd(char *name);
static void cmdrc(char *m1, char *m2)
static void
cmdrc(char *m1, char *m2)
{
Command *c;
FILE *rcfile;
@@ -2159,7 +2139,8 @@ static void cmdrc(char *m1, char *m2)
fclose(rcfile);
}
int tn(int argc, char **argv)
int
tn(int argc, char **argv)
{
struct hostent *host = 0;
struct sockaddr_in sin;
@@ -2292,9 +2273,6 @@ int tn(int argc, char **argv)
return 0;
}
} else {
#if !defined(htons) && 0
u_short htons P((unsigned short));
#endif /* !defined(htons) */
sin.sin_port = htons(sin.sin_port);
}
} else {
@@ -2462,7 +2440,8 @@ static Command cmdtab2[] = {
* Call routine with argc, argv set from args (terminated by 0).
*/
static int call(intrtn_t routine, ...)
static int
call(intrtn_t routine, ...)
{
va_list ap;
char *args[100];
@@ -2475,7 +2454,8 @@ static int call(intrtn_t routine, ...)
}
static Command *getcmd(char *name)
static Command
*getcmd(char *name)
{
Command *cm;
@@ -2484,11 +2464,8 @@ static Command *getcmd(char *name)
return (Command *) genget(name, (char **) cmdtab2, sizeof(Command));
}
void
command(top, tbuf, cnt)
int top;
char *tbuf;
int cnt;
void
command(int top, char *tbuf, int cnt)
{
Command *c;
@@ -2560,7 +2537,8 @@ command(top, tbuf, cnt)
/*
* Help command.
*/
static int help(int argc, char **argv)
static int
help(int argc, char **argv)
{
Command *c;
@@ -2629,11 +2607,8 @@ static int help(int argc, char **argv)
* pointed to by *cpp is.
*
*/
unsigned long
sourceroute(arg, cpp, lenp)
char *arg;
char **cpp;
int *lenp;
unsigned long
sourceroute(char *arg, char **cpp, int *lenp)
{
static char lsr[44];
#ifdef sysV88

View File

@@ -33,6 +33,8 @@
* @(#)externs.h 8.3 (Berkeley) 5/30/95
*/
/* $Id$ */
#include <stdio.h>
#include <setjmp.h>
#if defined(CRAY) && !defined(NO_BSD_SETJMP)
@@ -67,14 +69,6 @@
#define SUBBUFSIZE 256
#if !defined(P)
# ifdef __STDC__
# define P(x) x
# else
# define P(x) ()
# endif
#endif
extern int
autologin, /* Autologin enabled */
skiprc, /* Don't process the ~/.telnetrc file */
@@ -120,8 +114,8 @@ extern char
options[], /* All the little options */
*hostname; /* Who are we connected to? */
#if defined(ENCRYPTION)
extern void (*encrypt_output) P((unsigned char *, int));
extern int (*decrypt_input) P((int));
extern void (*encrypt_output) (unsigned char *, int);
extern int (*decrypt_input) (int);
#endif
/*
@@ -192,80 +186,80 @@ extern FILE
extern unsigned char
NetTraceFile[]; /* Name of file where debugging output goes */
extern void
SetNetTrace P((char *)); /* Function to change where debugging goes */
SetNetTrace (char *); /* Function to change where debugging goes */
extern jmp_buf
peerdied,
toplevel; /* For error conditions. */
extern void
command P((int, char *, int)),
Dump P((char, unsigned char *, int)),
printoption P((char *, int, int)),
printsub P((char, unsigned char *, int)),
sendnaws P((void)),
setconnmode P((int)),
setcommandmode P((void)),
setneturg P((void)),
sys_telnet_init P((void)),
telnet P((char *)),
tel_enter_binary P((int)),
TerminalFlushOutput P((void)),
TerminalNewMode P((int)),
TerminalRestoreState P((void)),
TerminalSaveState P((void)),
tninit P((void)),
upcase P((char *)),
willoption P((int)),
wontoption P((int));
command (int, char *, int),
Dump (char, unsigned char *, int),
printoption (char *, int, int),
printsub (char, unsigned char *, int),
sendnaws (void),
setconnmode (int),
setcommandmode (void),
setneturg (void),
sys_telnet_init (void),
telnet (char *),
tel_enter_binary (int),
TerminalFlushOutput (void),
TerminalNewMode (int),
TerminalRestoreState (void),
TerminalSaveState (void),
tninit (void),
upcase (char *),
willoption (int),
wontoption (int);
extern void
send_do P((int, int)),
send_dont P((int, int)),
send_will P((int, int)),
send_wont P((int, int));
send_do (int, int),
send_dont (int, int),
send_will (int, int),
send_wont (int, int);
extern void
lm_will P((unsigned char *, int)),
lm_wont P((unsigned char *, int)),
lm_do P((unsigned char *, int)),
lm_dont P((unsigned char *, int)),
lm_mode P((unsigned char *, int, int));
lm_will (unsigned char *, int),
lm_wont (unsigned char *, int),
lm_do (unsigned char *, int),
lm_dont (unsigned char *, int),
lm_mode (unsigned char *, int, int);
extern void
slc_init P((void)),
slcstate P((void)),
slc_mode_export P((void)),
slc_mode_import P((int)),
slc_import P((int)),
slc_export P((void)),
slc P((unsigned char *, int)),
slc_check P((void)),
slc_start_reply P((void)),
slc_add_reply P((unsigned char, unsigned char, cc_t)),
slc_end_reply P((void));
slc_init (void),
slcstate (void),
slc_mode_export (void),
slc_mode_import (int),
slc_import (int),
slc_export (void),
slc (unsigned char *, int),
slc_check (void),
slc_start_reply (void),
slc_add_reply (unsigned char, unsigned char, cc_t),
slc_end_reply (void);
extern int
slc_update P((void));
slc_update (void);
extern void
env_opt P((unsigned char *, int)),
env_opt_start P((void)),
env_opt_start_info P((void)),
env_opt_add P((unsigned char *)),
env_opt_end P((int));
env_opt (unsigned char *, int),
env_opt_start (void),
env_opt_start_info (void),
env_opt_add (unsigned char *),
env_opt_end (int);
extern unsigned char
*env_default P((int, int)),
*env_getvalue P((unsigned char *));
*env_default (int, int),
*env_getvalue (unsigned char *);
extern int
get_status P((void)),
dosynch P((void));
get_status (void),
dosynch (void);
extern cc_t
*tcval P((int));
*tcval (int);
extern int quit P((void));
extern int quit (void);
extern struct termios new_tc;

View File

@@ -52,24 +52,22 @@ RCSID("$Id$");
#include <stdio.h>
#include <errno.h>
#ifdef size_t
#undef size_t
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include "ring.h"
#include "general.h"
/* Internal macros */
#include <roken.h>
#if !defined(MIN)
#define MIN(a,b) (((a)<(b))? (a):(b))
#endif /* !defined(MIN) */
/* Internal macros */
#define ring_subtract(d,a,b) (((a)-(b) >= 0)? \
(a)-(b): (((a)-(b))+(d)->size))
@@ -102,7 +100,8 @@ static u_long ring_clock = 0;
/* Buffer state transition routines */
int ring_init(Ring *ring, unsigned char *buffer, int count)
int
ring_init(Ring *ring, unsigned char *buffer, int count)
{
memset(ring, 0, sizeof *ring);
@@ -125,9 +124,8 @@ int ring_init(Ring *ring, unsigned char *buffer, int count)
* Mark the most recently supplied byte.
*/
void
ring_mark(ring)
Ring *ring;
void
ring_mark(Ring *ring)
{
ring->mark = ring_decrement(ring, ring->supply, 1);
}
@@ -136,9 +134,8 @@ ring_mark(ring)
* Is the ring pointing to the mark?
*/
int
ring_at_mark(ring)
Ring *ring;
int
ring_at_mark(Ring *ring)
{
if (ring->mark == ring->consume) {
return 1;
@@ -151,9 +148,8 @@ ring_at_mark(ring)
* Clear any mark set on the ring.
*/
void
ring_clear_mark(ring)
Ring *ring;
void
ring_clear_mark(Ring *ring)
{
ring->mark = 0;
}
@@ -161,10 +157,8 @@ ring_clear_mark(ring)
/*
* Add characters from current segment to ring buffer.
*/
void
ring_supplied(ring, count)
Ring *ring;
int count;
void
ring_supplied(Ring *ring, int count)
{
ring->supply = ring_increment(ring, ring->supply, count);
ring->supplytime = ++ring_clock;
@@ -173,10 +167,8 @@ ring_supplied(ring, count)
/*
* We have just consumed "c" bytes.
*/
void
ring_consumed(ring, count)
Ring *ring;
int count;
void
ring_consumed(Ring *ring, int count)
{
if (count == 0) /* don't update anything */
return;
@@ -210,9 +202,8 @@ ring_consumed(ring, count)
/* Number of bytes that may be supplied */
int
ring_empty_count(ring)
Ring *ring;
int
ring_empty_count(Ring *ring)
{
if (ring_empty(ring)) { /* if empty */
return ring->size;
@@ -222,9 +213,8 @@ ring_empty_count(ring)
}
/* number of CONSECUTIVE bytes that may be supplied */
int
ring_empty_consecutive(ring)
Ring *ring;
int
ring_empty_consecutive(Ring *ring)
{
if ((ring->consume < ring->supply) || ring_empty(ring)) {
/*
@@ -244,9 +234,8 @@ ring_empty_consecutive(ring)
* (but don't give more than enough to get to cross over set mark)
*/
int
ring_full_count(ring)
Ring *ring;
int
ring_full_count(Ring *ring)
{
if ((ring->mark == 0) || (ring->mark == ring->consume)) {
if (ring_full(ring)) {
@@ -263,9 +252,8 @@ ring_full_count(ring)
* Return the number of CONSECUTIVE bytes available for consuming.
* However, don't return more than enough to cross over set mark.
*/
int
ring_full_consecutive(ring)
Ring *ring;
int
ring_full_consecutive(Ring *ring)
{
if ((ring->mark == 0) || (ring->mark == ring->consume)) {
if ((ring->supply < ring->consume) || ring_full(ring)) {
@@ -285,16 +273,13 @@ ring_full_consecutive(ring)
/*
* Move data into the "supply" portion of of the ring buffer.
*/
void
ring_supply_data(ring, buffer, count)
Ring *ring;
unsigned char *buffer;
int count;
void
ring_supply_data(Ring *ring, unsigned char *buffer, int count)
{
int i;
while (count) {
i = MIN(count, ring_empty_consecutive(ring));
i = min(count, ring_empty_consecutive(ring));
memmove(ring->supply, buffer, i);
ring_supplied(ring, i);
count -= i;
@@ -307,16 +292,13 @@ ring_supply_data(ring, buffer, count)
/*
* Move data from the "consume" portion of the ring buffer
*/
void
ring_consume_data(ring, buffer, count)
Ring *ring;
unsigned char *buffer;
int count;
void
ring_consume_data(Ring *ring, unsigned char *buffer, int count)
{
int i;
while (count) {
i = MIN(count, ring_full_consecutive(ring));
i = min(count, ring_full_consecutive(ring));
memmove(buffer, ring->consume, i);
ring_consumed(ring, i);
count -= i;
@@ -326,10 +308,8 @@ ring_consume_data(ring, buffer, count)
#endif
#if defined(ENCRYPTION)
void
ring_encrypt(ring, encryptor)
Ring *ring;
void (*encryptor)();
void
ring_encrypt(Ring *ring, void (*encryptor)())
{
unsigned char *s, *c;
@@ -350,9 +330,8 @@ ring_encrypt(ring, encryptor)
ring->clearto = ring->supply;
}
void
ring_clearto(ring)
Ring *ring;
void
ring_clearto(Ring *ring)
{
if (!ring_empty(ring))
ring->clearto = ring->supply;

View File

@@ -33,15 +33,7 @@
* @(#)ring.h 8.1 (Berkeley) 6/6/93
*/
#if defined(P)
# undef P
#endif
#if defined(__STDC__) || defined(LINT_ARGS)
# define P(x) x
#else
# define P(x) ()
#endif
/* $Id$ */
/*
* This defines a structure for a ring buffer.
@@ -72,32 +64,32 @@ typedef struct {
/* Initialization routine */
extern int
ring_init P((Ring *ring, unsigned char *buffer, int count));
ring_init (Ring *ring, unsigned char *buffer, int count);
/* Data movement routines */
extern void
ring_supply_data P((Ring *ring, unsigned char *buffer, int count));
ring_supply_data (Ring *ring, unsigned char *buffer, int count);
#ifdef notdef
extern void
ring_consume_data P((Ring *ring, unsigned char *buffer, int count));
ring_consume_data (Ring *ring, unsigned char *buffer, int count);
#endif
/* Buffer state transition routines */
extern void
ring_supplied P((Ring *ring, int count)),
ring_consumed P((Ring *ring, int count));
ring_supplied (Ring *ring, int count),
ring_consumed (Ring *ring, int count);
/* Buffer state query routines */
extern int
ring_empty_count P((Ring *ring)),
ring_empty_consecutive P((Ring *ring)),
ring_full_count P((Ring *ring)),
ring_full_consecutive P((Ring *ring));
ring_empty_count (Ring *ring),
ring_empty_consecutive (Ring *ring),
ring_full_count (Ring *ring),
ring_full_consecutive (Ring *ring);
#if defined(ENCRYPTION)
extern void
ring_encrypt P((Ring *ring, void (*func)())),
ring_clearto P((Ring *ring));
ring_encrypt (Ring *ring, void (*func)()),
ring_clearto (Ring *ring);
#endif
extern void

View File

@@ -859,10 +859,10 @@ tty_rspeed(int val)
extern struct utmp wtmp;
extern char wtmpf[];
extern void utmp_sig_init P((void));
extern void utmp_sig_reset P((void));
extern void utmp_sig_wait P((void));
extern void utmp_sig_notify P((int));
extern void utmp_sig_init (void);
extern void utmp_sig_reset (void);
extern void utmp_sig_wait (void);
extern void utmp_sig_notify (int);
# endif /* PARENT_DOES_UTMP */
#ifdef STREAMSPTY

View File

@@ -141,7 +141,7 @@ int debug = 0;
int keepalive = 1;
char *progname;
extern void usage P((void));
extern void usage (void);
/*
* The string to pass to getopt(). We do it this way so
@@ -721,7 +721,7 @@ char *hostname;
char host_name[MaxHostNameLen];
char remote_host_name[MaxHostNameLen];
extern void telnet P((int, int));
extern void telnet (int, int);
/*
* Get a pty, scan input lines.