mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-26 23:32:10 -05:00
Various changes for Open Transport.
[originally from svn r188]
This commit is contained in:
parent
3b6d5dcf1a
commit
47204a394f
30
Makefile.mpw
30
Makefile.mpw
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.mpw,v 1.1.2.12 1999/04/04 18:23:33 ben Exp $
|
# $Id: Makefile.mpw,v 1.1.2.13 1999/08/02 08:04:31 ben Exp $
|
||||||
# This is the Makefile for building PuTTY for the Mac OS.
|
# This is the Makefile for building PuTTY for the Mac OS.
|
||||||
# Users of non-Mac systems will see some pretty strange characters around.
|
# Users of non-Mac systems will see some pretty strange characters around.
|
||||||
|
|
||||||
@ -16,9 +16,10 @@ Objects
|
|||||||
dnr.c.o ¶
|
dnr.c.o ¶
|
||||||
mac.c.o ¶
|
mac.c.o ¶
|
||||||
maccfg.c.o ¶
|
maccfg.c.o ¶
|
||||||
macnet.c.o ¶
|
# macnet.c.o ¶
|
||||||
macterm.c.o ¶
|
macterm.c.o ¶
|
||||||
misc.c.o ¶
|
misc.c.o ¶
|
||||||
|
opentpt.c.o ¶
|
||||||
# ssh.c.o ¶
|
# ssh.c.o ¶
|
||||||
# sshcrc.c.o ¶
|
# sshcrc.c.o ¶
|
||||||
# sshdes.c.o ¶
|
# sshdes.c.o ¶
|
||||||
@ -37,6 +38,7 @@ Objects
|
|||||||
macnet.c.x ¶
|
macnet.c.x ¶
|
||||||
macterm.c.x ¶
|
macterm.c.x ¶
|
||||||
misc.c.x ¶
|
misc.c.x ¶
|
||||||
|
opentpt.c.x ¶
|
||||||
# ssh.c.x ¶
|
# ssh.c.x ¶
|
||||||
# sshcrc.c.x ¶
|
# sshcrc.c.x ¶
|
||||||
# sshdes.c.x ¶
|
# sshdes.c.x ¶
|
||||||
@ -52,14 +54,31 @@ Objects
|
|||||||
Libs¥68K = "{CLibraries}StdCLib.o" ¶
|
Libs¥68K = "{CLibraries}StdCLib.o" ¶
|
||||||
"{Libraries}MacRuntime.o" ¶
|
"{Libraries}MacRuntime.o" ¶
|
||||||
"{Libraries}IntEnv.o" ¶
|
"{Libraries}IntEnv.o" ¶
|
||||||
"{Libraries}Interface.o"
|
"{Libraries}Interface.o" ¶
|
||||||
|
"{Libraries}OpenTransport.o" ¶
|
||||||
|
"{Libraries}OpenTptInet.o"
|
||||||
|
|
||||||
Libs¥PPC = "{SharedLibraries}InterfaceLib" ¶
|
Libs¥PPC = "{SharedLibraries}InterfaceLib" ¶
|
||||||
"{SharedLibraries}StdCLib" ¶
|
"{SharedLibraries}StdCLib" ¶
|
||||||
"{SharedLibraries}MathLib" ¶
|
"{SharedLibraries}MathLib" ¶
|
||||||
"{SharedLibraries}AppearanceLib" -weaklib AppearanceLib ¶
|
"{SharedLibraries}AppearanceLib" ¶
|
||||||
|
-weaklib AppearanceLib ¶
|
||||||
|
"{SharedLibraries}OpenTransportLib" ¶
|
||||||
|
-weaklib OTGlobalLib ¶
|
||||||
|
-weaklib OTUtilityLib ¶
|
||||||
|
-weaklib OTClientUtilLib ¶
|
||||||
|
-weaklib OTClientLib ¶
|
||||||
|
-weaklib OTStreamUnixLib ¶
|
||||||
|
-weaklib OTXTILib ¶
|
||||||
|
-weaklib OTConfigLib ¶
|
||||||
|
-weaklib OTNtvUtilLib ¶
|
||||||
|
-weaklib OTNativeClientLib ¶
|
||||||
|
"{SharedLibraries}OpenTptInternetLib" ¶
|
||||||
|
-weaklib OTInetClientLib ¶
|
||||||
"{PPCLibraries}StdCRuntime.o" ¶
|
"{PPCLibraries}StdCRuntime.o" ¶
|
||||||
"{PPCLibraries}PPCCRuntime.o"
|
"{PPCLibraries}PPCCRuntime.o" ¶
|
||||||
|
"{PPCLibraries}OpenTransportAppPPC.o" ¶
|
||||||
|
"{PPCLibraries}OpenTptInetPPC.o"
|
||||||
|
|
||||||
# pseudo-targets
|
# pseudo-targets
|
||||||
all Ä 68k ppc fat
|
all Ä 68k ppc fat
|
||||||
@ -130,6 +149,7 @@ maccfg.c.o maccfg.c.x
|
|||||||
macnet.c.o macnet.c.x Ä putty.h
|
macnet.c.o macnet.c.x Ä putty.h
|
||||||
macterm.c.o macterm.c.x Ä putty.h mac.h
|
macterm.c.o macterm.c.x Ä putty.h mac.h
|
||||||
misc.c.o misc.c.x Ä putty.h
|
misc.c.o misc.c.x Ä putty.h
|
||||||
|
opentpt.c.o opentpt.c.x Ä putty.h mac.h
|
||||||
ssh.c.o ssh.c.x Ä putty.h ssh.h
|
ssh.c.o ssh.c.x Ä putty.h ssh.h
|
||||||
sshcrc.c.o sshcrc.c.x Ä
|
sshcrc.c.o sshcrc.c.x Ä
|
||||||
sshdes.c.o sshdes.c.x Ä ssh.h
|
sshdes.c.o sshdes.c.x Ä ssh.h
|
||||||
|
21
mac.c
21
mac.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: mac.c,v 1.1.2.24 1999/04/04 18:23:33 ben Exp $ */
|
/* $Id: mac.c,v 1.1.2.25 1999/08/02 08:04:31 ben Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Ben Harris
|
* Copyright (c) 1999 Ben Harris
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -145,6 +145,22 @@ static void mac_startup(void) {
|
|||||||
InitCursor();
|
InitCursor();
|
||||||
windows.about = NULL;
|
windows.about = NULL;
|
||||||
windows.licence = NULL;
|
windows.licence = NULL;
|
||||||
|
|
||||||
|
/* Initialise networking */
|
||||||
|
#ifdef WITH_OPENTRANSPORT
|
||||||
|
if ((*opentpt_stack.init)() == 0)
|
||||||
|
net_stack = &opentpt_stack;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
#ifdef WITH_MACTCP
|
||||||
|
if ((*mactcp_stack.init)() == 0)
|
||||||
|
net_stack = &mactcp_stack;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
fatalbox("No useful TCP/IP stack found");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mac_eventloop(void) {
|
static void mac_eventloop(void) {
|
||||||
@ -159,7 +175,7 @@ static void mac_eventloop(void) {
|
|||||||
mac_adjustcursor(cursrgn);
|
mac_adjustcursor(cursrgn);
|
||||||
if (gotevent)
|
if (gotevent)
|
||||||
mac_event(&event);
|
mac_event(&event);
|
||||||
macnet_eventcheck();
|
net_poll();
|
||||||
}
|
}
|
||||||
DisposeRgn(cursrgn);
|
DisposeRgn(cursrgn);
|
||||||
}
|
}
|
||||||
@ -494,6 +510,7 @@ static void mac_adjustcursor(RgnHandle cursrgn) {
|
|||||||
|
|
||||||
static void mac_shutdown(void) {
|
static void mac_shutdown(void) {
|
||||||
|
|
||||||
|
net_shutdown();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
32
putty.h
32
putty.h
@ -111,7 +111,7 @@ typedef enum {
|
|||||||
} Net_Event_Type;
|
} Net_Event_Type;
|
||||||
|
|
||||||
#ifdef macintosh
|
#ifdef macintosh
|
||||||
typedef Socket *SOCKET;
|
typedef void *SOCKET;
|
||||||
#define INVALID_SOCKET NULL
|
#define INVALID_SOCKET NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -124,6 +124,29 @@ typedef struct {
|
|||||||
void (*shutdown) (Session *);
|
void (*shutdown) (Session *);
|
||||||
} Backend;
|
} Backend;
|
||||||
|
|
||||||
|
#ifdef macintosh
|
||||||
|
typedef struct {
|
||||||
|
int (*init)(void);
|
||||||
|
SOCKET (*open)(Session *, char const *, int);
|
||||||
|
int (*recv)(SOCKET, void *, int, int);
|
||||||
|
int (*send)(SOCKET, void *, int, int);
|
||||||
|
void (*poll)(void);
|
||||||
|
void (*close)(SOCKET);
|
||||||
|
void (*destroy)(SOCKET);
|
||||||
|
void (*shutdown)(void);
|
||||||
|
} Network_Stack;
|
||||||
|
|
||||||
|
GLOBAL Network_Stack *net_stack;
|
||||||
|
|
||||||
|
#define net_open(s, h, p) ((*net_stack->open)((s), (h), (p)))
|
||||||
|
#define net_recv(s, b, l, f) ((*net_stack->recv)((s), (b), (l), (f)))
|
||||||
|
#define net_send(s, b, l, f) ((*net_stack->send)((s), (b), (l), (f)))
|
||||||
|
#define net_poll() ((*net_stack->poll)())
|
||||||
|
#define net_close(s) ((*net_stack->close)(s))
|
||||||
|
#define net_destroy(s) ((*net_stack->destroy)(s))
|
||||||
|
#define net_shutdown() ((*net_stack->shutdown)())
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* Basic options */
|
/* Basic options */
|
||||||
char host[512];
|
char host[512];
|
||||||
@ -300,14 +323,17 @@ extern void lognegot(const char *);
|
|||||||
* Exports from the network system
|
* Exports from the network system
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef macintosh
|
||||||
extern Socket *net_open(Session *, char *host, int port);
|
extern Socket *net_open(Session *, char *host, int port);
|
||||||
extern char *net_realname(Socket *);
|
extern char *net_realname(Socket *);
|
||||||
extern int net_recv(Socket *, void *, int, int);
|
extern int net_recv(Socket *, void *, int, int);
|
||||||
extern int net_send(Socket *, void *, int, int);
|
extern int net_send(Socket *, void *, int, int);
|
||||||
#define SEND_PUSH 0x01
|
|
||||||
#define SEND_URG 0x02
|
|
||||||
extern void net_close(Socket *); /* ask the remote end to close */
|
extern void net_close(Socket *); /* ask the remote end to close */
|
||||||
extern void net_destroy(Socket *); /* Tidy up */
|
extern void net_destroy(Socket *); /* Tidy up */
|
||||||
|
#endif
|
||||||
|
#define SEND_PUSH 0x01
|
||||||
|
#define SEND_URG 0x02
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from noise.c.
|
* Exports from noise.c.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: testback.c,v 1.1.2.6 1999/04/04 18:23:35 ben Exp $ */
|
/* $Id: testback.c,v 1.1.2.7 1999/08/02 08:04:31 ben Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999 Simon Tatham
|
* Copyright (c) 1999 Simon Tatham
|
||||||
* Copyright (c) 1999 Ben Harris
|
* Copyright (c) 1999 Ben Harris
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
|
|
||||||
static char *null_init(Session *);
|
static char *null_init(Session *);
|
||||||
static int null_msg(Session *, Socket *, Net_Event_Type);
|
static int null_msg(Session *, SOCKET, Net_Event_Type);
|
||||||
static void null_send(Session *, char *, int);
|
static void null_send(Session *, char *, int);
|
||||||
static void loop_send(Session *, char *, int);
|
static void loop_send(Session *, char *, int);
|
||||||
static void hexdump_send(Session *, char *, int);
|
static void hexdump_send(Session *, char *, int);
|
||||||
@ -58,7 +58,7 @@ static char *null_init(Session *s) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int null_msg(Session *s, Socket *sock, Net_Event_Type ne) {
|
static int null_msg(Session *s, SOCKET sock, Net_Event_Type ne) {
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user