-# $Id: Makefile.mpw,v 1.1.2.13 1999/08/02 08:04:31 ben Exp $
+# $Id: Makefile.mpw,v 1.1.2.14 1999/08/02 22:32:38 ben Exp $
# This is the Makefile for building PuTTY for the Mac OS.
# Users of non-Mac systems will see some pretty strange characters around.
dnr.c.o ¶
mac.c.o ¶
maccfg.c.o ¶
-# macnet.c.o ¶
+# mactcp.c.o ¶
macterm.c.o ¶
misc.c.o ¶
opentpt.c.o ¶
dnr.c.x ¶
mac.c.x ¶
maccfg.c.x ¶
- macnet.c.x ¶
+# mactcp.c.x ¶
macterm.c.x ¶
misc.c.x ¶
opentpt.c.x ¶
"{Libraries}IntEnv.o" ¶
"{Libraries}Interface.o" ¶
"{Libraries}OpenTransport.o" ¶
+ "{Libraries}OpenTransportApp.o" ¶
"{Libraries}OpenTptInet.o"
Libs¥PPC = "{SharedLibraries}InterfaceLib" ¶
dnr.c.o dnr.c.x Ä
mac.c.o mac.c.x Ä putty.h mac.h macresid.h
maccfg.c.o maccfg.c.x Ä putty.h mac.h macresid.h
-macnet.c.o macnet.c.x Ä putty.h
+mactcp.c.o mactcp.c.x Ä putty.h
macterm.c.o macterm.c.x Ä putty.h mac.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
+sshblowf.c.o sshblowf.c.x Ä ssh.h
sshcrc.c.o sshcrc.c.x Ä
sshdes.c.o sshdes.c.x Ä ssh.h
sshmd5.c.o sshmd5.c.x Ä ssh.h
-/* $Id: mac.c,v 1.1.2.25 1999/08/02 08:04:31 ben Exp $ */
+/* $Id: mac.c,v 1.1.2.26 1999/08/02 22:32:38 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
/* Initialise networking */
#ifdef WITH_OPENTRANSPORT
- if ((*opentpt_stack.init)() == 0)
- net_stack = &opentpt_stack;
+ if ((*otpt_stack.init)() == 0)
+ net_stack = &otpt_stack;
else
#endif
#ifdef WITH_MACTCP
- if ((*mactcp_stack.init)() == 0)
- net_stack = &mactcp_stack;
+ if ((*mtcp_stack.init)() == 0)
+ net_stack = &mtcp_stack;
else
#endif
fatalbox("No useful TCP/IP stack found");
-/* $Id: opentpt.c,v 1.1.2.1 1999/08/02 08:06:32 ben Exp $ */
+/* $Id: opentpt.c,v 1.1.2.2 1999/08/02 22:32:39 ben Exp $ */
/*
* Copyright (c) 1999 Ben Harris
* All rights reserved.
*/
#include <MacTypes.h>
+#include <CodeFragments.h>
#include <OpenTransport.h>
#include <OpenTptInternet.h>
-#incldue <Processes.h>
-#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
#include "putty.h"
struct otpt_socket {
EndpointRef ep;
Session *sess;
- OTLIFO *sendq;
- OTLIFO *eventq;
+ OTLIFO sendq;
+ OTLIFO eventq;
long eventhandler;
};
struct otpt_netevent {
- OTLink *next;
+ OTLink next;
Net_Event_Type type;
};
-static int otpt_probe(void);
-static void otpt_init(void);
+static int otpt_init(void);
+static void otpt_shutdown(void);
+static void otpt_poll(void);
static void *otpt_open(Session *, char const *, int);
static int otpt_recv(void *, void *, int, int);
static int otpt_send(void *, void *, int, int);
otpt_destroy, otpt_shutdown
};
-static OTConfiguration *otpt_config = kOTInvalidCOnfigurationPtr;
+static OTConfiguration *otpt_config = kOTInvalidConfigurationPtr;
static int otpt_init(void) {
OSErr err;
+ /* Check that the OpenTransport libraries were there (really just ppc) */
+ if (&InitOpenTransport == kUnresolvedCFragSymbolAddress)
+ return 1;
err = InitOpenTransport();
if (err != noErr)
return err;
err = OTInstallNotifier(s->ep, otpt_notifier, (void *)s);
if (err != kOTNoError) goto splat;
s->eventhandler = OTCreateSystemTask(&otpt_rcvevent, (void *)s);
- if (s->eventhandler = 0) goto splat;
+ if (s->eventhandler == 0) goto splat;
/* Bind to any local address */
err = OTBind(s->ep, NULL, NULL);
remoteaddr = smalloc(sizeof(*remoteaddr) - sizeof(remoteaddr->fName) +
strlen(host) + 7); /* allow space for port no. */
remote.addr.buf = (UInt8 *)remoteaddr;
- remote.addr.len = OTInitDNSAddress(remoteaddr, host);
+ /* XXX: I don't _think_ OTInitDNSAddress can modify the hostname. */
+ remote.addr.len = OTInitDNSAddress(remoteaddr, (char *)host);
remote.addr.len += sprintf(&remoteaddr->fName[strlen(remoteaddr->fName)],
":%d", port);
/* Asynchronous blocking mode, so we don't have to wait */
static int otpt_recv(void *sock, void *buf, int buflen, int flags) {
struct otpt_socket *s = (struct otpt_socket *)sock;
OTResult result;
- OTFlags flags;
+ OTFlags otflags;
OTSetNonBlocking(s->ep);
OTSetSynchronous(s->ep);
- result = OTRcv(s->ep, buf, buflen, flags);
+ result = OTRcv(s->ep, buf, buflen, &otflags);
if (result >= 0)
return result;
- else if (result == kOTNoDataError)
+ else if (result == kOTNoDataErr)
return 0;
else /* confusion! */
return 0;
OTDestroySystemTask(s->eventhandler);
/* Flush the event and send queues */
- while ((link = OTLIFODequeue(s->eventq)) != NULL)
+ while ((link = OTLIFODequeue(&s->eventq)) != NULL)
OTFreeMem(link);
- while ((link = OTLIFODequeue(s->sendq)) != NULL)
+ while ((link = OTLIFODequeue(&s->sendq)) != NULL)
OTFreeMem(link);
/* Finally, free the socket record itself */
OTLink *link;
struct otpt_netevent *ne;
- /* idiom stolen from "Networking With Open Transport". Blame Apple. */
-
- while ((link = OTLIFOStealList(s->eventq)) != NULL) {
+ while ((link = OTLIFOStealList(&s->eventq)) != NULL) {
link = OTReverseList(link);
while (link != NULL) {
ne = (struct otpt_netevent *)link;
- link = ne->next;
+ link = ne->next.fNext;
switch (ne->type) {
default:
(s->sess->back->msg)(s->sess, s, ne->type);
OTFreeMem(ne);
}
}
-
+}
/*
* Local Variables: