summaryrefslogtreecommitdiffstats
path: root/Mac/Unsupported/mactcp
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-05-10 12:17:03 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-05-10 12:17:03 (GMT)
commitd454b578e29e073250936948df5044e41fada772 (patch)
tree379ff07879dddaf262539ee01892c87a865494be /Mac/Unsupported/mactcp
parent95bf9390a488004f66db1eccaa049203ef8ab5b3 (diff)
downloadcpython-d454b578e29e073250936948df5044e41fada772.zip
cpython-d454b578e29e073250936948df5044e41fada772.tar.gz
cpython-d454b578e29e073250936948df5044e41fada772.tar.bz2
Has been dead so long that there's no use keeping it in the active bit of the repository.
Diffstat (limited to 'Mac/Unsupported/mactcp')
-rw-r--r--Mac/Unsupported/mactcp/MACTCPconst.py62
-rw-r--r--Mac/Unsupported/mactcp/MacTCPerrors.py35
-rw-r--r--Mac/Unsupported/mactcp/macdnrmodule.c459
-rw-r--r--Mac/Unsupported/mactcp/mactcpmodule.c990
-rw-r--r--Mac/Unsupported/mactcp/mactcpmodules.mu.exp2
-rw-r--r--Mac/Unsupported/mactcp/mactcpmodules.mu.hqx212
-rw-r--r--Mac/Unsupported/mactcp/socket.py304
-rw-r--r--Mac/Unsupported/mactcp/tcpglue.c477
-rw-r--r--Mac/Unsupported/mactcp/tcpglue.h68
9 files changed, 0 insertions, 2609 deletions
diff --git a/Mac/Unsupported/mactcp/MACTCPconst.py b/Mac/Unsupported/mactcp/MACTCPconst.py
deleted file mode 100644
index 47b9d68..0000000
--- a/Mac/Unsupported/mactcp/MACTCPconst.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# MACTCP - event codes for the mactcp module
-#
-
-# UDP asr event codes
-UDPDataArrival=1 # A datagram has arrived
-UDPICMPReceived=2 # An ICMP error was received
-
-# TCP asr event codes
-TCPClosing=1 # All incoming data has been received and read.
-TCPULPTimeout=2 # No response from remote process.
-TCPTerminate=3 # Connection terminated. Has a detail parameter.
-TCPDataArrival=4 # Data has arrived (and no Rcv call is outstanding)
-TCPUrgent=5 # Urgent data is outstanding
-TCPICMPReceived=6 # An ICMP error was received
-PassiveOpenDone=32766 # (python only) a PassiveOpen has completed.
-
-# TCP termination reasons
-TCPRemoteAbort=2
-TCPNetworkFailure=3
-TCPSecPrecMismatch=4
-TCPULPTimeoutTerminate=5
-TCPULPAbort=6
-TCPULPClose=7
-TCPServiceError=8
-
-# MacTCP/DNR errors
-ipBadLapErr = -23000 # bad network configuration
-ipBadCnfgErr = -23001 # bad IP configuration error
-ipNoCnfgErr = -23002 # missing IP or LAP configuration error
-ipLoadErr = -23003 # error in MacTCP load
-ipBadAddr = -23004 # error in getting address
-connectionClosing = -23005 # connection is closing
-invalidLength = -23006
-connectionExists = -23007 # request conflicts with existing connection
-connectionDoesntExist = -23008 # connection does not exist
-insufficientResources = -23009 # insufficient resources to perform request
-invalidStreamPtr = -23010
-streamAlreadyOpen = -23011
-connectionTerminated = -23012
-invalidBufPtr = -23013
-invalidRDS = -23014
-invalidWDS = -23014
-openFailed = -23015
-commandTimeout = -23016
-duplicateSocket = -23017
-
-# Error codes from internal IP functions
-ipDontFragErr = -23032 # Packet too large to send w/o fragmenting
-ipDestDeadErr = -23033 # destination not responding
-icmpEchoTimeoutErr = -23035 # ICMP echo timed-out
-ipNoFragMemErr = -23036 # no memory to send fragmented pkt
-ipRouteErr = -23037 # can't route packet off-net
-
-nameSyntaxErr = -23041
-cacheFault = -23042
-noResultProc = -23043
-noNameServer = -23044
-authNameErr = -23045
-noAnsErr = -23046
-dnrErr = -23047
-outOfMemory = -23048
diff --git a/Mac/Unsupported/mactcp/MacTCPerrors.py b/Mac/Unsupported/mactcp/MacTCPerrors.py
deleted file mode 100644
index 3f6e72b..0000000
--- a/Mac/Unsupported/mactcp/MacTCPerrors.py
+++ /dev/null
@@ -1,35 +0,0 @@
-ipBadLapErr = -23000 # bad network configuration
-ipBadCnfgErr = -23001 # bad IP configuration error
-ipNoCnfgErr = -23002 # missing IP or LAP configuration error
-ipLoadErr = -23003 # error in MacTCP load
-ipBadAddr = -23004 # error in getting address
-connectionClosing = -23005 # connection is closing
-invalidLength = -23006
-connectionExists = -23007 # request conflicts with existing connection
-connectionDoesntExist = -23008 # connection does not exist
-insufficientResources = -23009 # insufficient resources to perform request
-invalidStreamPtr = -23010
-streamAlreadyOpen = -23011
-connectionTerminated = -23012
-invalidBufPtr = -23013
-invalidRDS = -23014
-invalidWDS = -23014
-openFailed = -23015
-commandTimeout = -23016
-duplicateSocket = -23017
-
-# Error codes from internal IP functions
-ipDontFragErr = -23032 # Packet too large to send w/o fragmenting
-ipDestDeadErr = -23033 # destination not responding
-icmpEchoTimeoutErr = -23035 # ICMP echo timed-out
-ipNoFragMemErr = -23036 # no memory to send fragmented pkt
-ipRouteErr = -23037 # can't route packet off-net
-
-nameSyntaxErr = -23041
-cacheFault = -23042
-noResultProc = -23043
-noNameServer = -23044
-authNameErr = -23045
-noAnsErr = -23046
-dnrErr = -23047
-outOfMemory = -23048
diff --git a/Mac/Unsupported/mactcp/macdnrmodule.c b/Mac/Unsupported/mactcp/macdnrmodule.c
deleted file mode 100644
index fe89e03..0000000
--- a/Mac/Unsupported/mactcp/macdnrmodule.c
+++ /dev/null
@@ -1,459 +0,0 @@
-/***********************************************************
-Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
-The Netherlands.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Stichting Mathematisch
-Centrum or CWI not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior permission.
-
-STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
-FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-******************************************************************/
-
-#include "allobjects.h"
-#include "modsupport.h" /* For getargs() etc. */
-
-#include "macglue.h"
-#include <AddressXlation.h>
-#include <Desk.h>
-
-#ifndef HAVE_UNIVERSAL_HEADERS
-#define ResultUPP ResultProcPtr
-#define NewResultProc(x) (x)
-#define ResultProc2UPP ResultProc2Ptr
-#define NewResultProc2Proc(x) (x)
-#endif
-
-static object *ErrorObject;
-
-/* ----------------------------------------------------- */
-/* Declarations for objects of type MacTCP DNR Result */
-
-/* Types of records we have */
-#define DNR_ADDR 0
-#define DNR_HINFO 1
-#define DNR_MX 2
-
-typedef struct {
- OB_HEAD
- int type; /* DNR_XXX */
- int waiting; /* True while completion proc not called */
- struct returnRec hinfo;
-} dnrrobject;
-
-staticforward typeobject Dnrrtype;
-
-#define is_dnrrobject(v) ((v)->ob_type == &Dnrrtype)
-
-/* ---------------------------------------------------------------- */
-
-static pascal void
-dnrr_done(rrp, udp)
- struct hostInfo *rrp; /* Unused */
- dnrrobject *udp;
-{
- if ( !udp->waiting ) {
- printf("macdnr: dnrr_done: spurious completion call!\n");
- return;
- }
- udp->waiting = 0;
- DECREF(udp);
-}
-
-static int dnrwait(self)
- dnrrobject *self;
-{
- while ( self->waiting ) {
- if ( PyMac_Idle() )
- return 0;
- }
- return 1;
-}
-
-static object *
-dnrr_wait(self, args)
- dnrrobject *self;
- object *args;
-{
- if (!newgetargs(args, ""))
- return NULL;
- if ( !dnrwait(self) ) {
- /* XXX An interrupt is pending -- is this correct? */
- INCREF(None);
- return None;
- }
- if ( self->hinfo.rtnCode ) {
- PyErr_Mac(ErrorObject, self->hinfo.rtnCode);
- return NULL;
- }
- INCREF(None);
- return None;
-}
-
-static object *
-dnrr_isdone(self, args)
- dnrrobject *self;
- object *args;
-{
- if (!newgetargs(args, ""))
- return NULL;
- return newintobject(!self->waiting);
-}
-
-static struct methodlist dnrr_methods[] = {
- {"wait", (method)dnrr_wait, 1},
- {"isdone", (method)dnrr_isdone, 1},
-
- {NULL, NULL} /* sentinel */
-};
-
-/* ---------- */
-
-static dnrrobject *
-newdnrrobject(tp)
- int tp;
-{
- dnrrobject *self;
-
- self = NEWOBJ(dnrrobject, &Dnrrtype);
- if (self == NULL)
- return NULL;
- self->type = tp;
- self->waiting = 0;
- memset(&self->hinfo, 0, sizeof(self->hinfo));
- return self;
-}
-
-static void
-dnrr_dealloc(self)
- dnrrobject *self;
-{
- self->waiting = 0; /* Not really needed, since we incref for completion */
- DEL(self);
-}
-
-/* Code to access structure members by accessing attributes */
-
-#include "structmember.h"
-
-#define OFF(x) offsetof(struct returnRec, x)
-
-static struct memberlist dnrr_memberlist_addr[] = {
- { "rtnCode", T_INT, OFF(rtnCode), RO},
- { "cname", T_STRING_INPLACE, OFF(cname), RO},
- { "ip0", T_UINT, OFF(rdata.addr[0]), RO},
- { "ip1", T_UINT, OFF(rdata.addr[1]), RO},
- { "ip2", T_UINT, OFF(rdata.addr[2]), RO},
- { "ip3", T_UINT, OFF(rdata.addr[3]), RO},
- {NULL} /* Sentinel */
-};
-
-static struct memberlist dnrr_memberlist_hinfo[] = {
- { "rtnCode", T_INT, OFF(rtnCode), RO},
- { "cname", T_STRING_INPLACE, OFF(cname), RO},
- { "cpuType", T_STRING_INPLACE, OFF(rdata.hinfo.cpuType), RO},
- { "osType", T_STRING_INPLACE, OFF(rdata.hinfo.osType), RO},
- {NULL} /* Sentinel */
-};
-
-static struct memberlist dnrr_memberlist_mx[] = {
- { "rtnCode", T_INT, OFF(rtnCode), RO},
- { "cname", T_STRING_INPLACE, OFF(cname), RO},
- { "preference", T_USHORT, OFF(rdata.mx.preference), RO},
- { "exchange", T_STRING_INPLACE, OFF(rdata.mx.exchange), RO},
- {NULL} /* Sentinel */
-};
-
-static struct memberlist *dnrr_mlists[3] = {
- dnrr_memberlist_addr,
- dnrr_memberlist_hinfo,
- dnrr_memberlist_mx
-};
-
-static object *
-dnrr_getattr(self, name)
- dnrrobject *self;
- char *name;
-{
- object *rv;
- int tp;
-
- rv = findmethod(dnrr_methods, (object *)self, name);
- if ( rv ) return rv;
- err_clear();
- if ( self->waiting )
- if ( !dnrwait(self) ) {
- /* XXX An interrupt is pending -- is this correct? */
- err_setstr(ErrorObject, "Resolver busy");
- return NULL;
- }
- tp = self->type;
- return getmember((char *)&self->hinfo, dnrr_mlists[tp], name);
-}
-
-
-static typeobject Dnrrtype = {
- OB_HEAD_INIT(&Typetype)
- 0, /*ob_size*/
- "MacTCP DNR Result", /*tp_name*/
- sizeof(dnrrobject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)dnrr_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
- (getattrfunc)dnrr_getattr, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc)0, /*tp_compare*/
- (reprfunc)0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
-};
-
-/* End of code for MacTCP DNR Result objects */
-/* -------------------------------------------------------- */
-
-int dnr_is_open;
-
-static int
-opendnr(fn)
- char *fn;
-{
- OSErr err;
-
- if ( dnr_is_open ) return 1;
- if ( (err=OpenResolver(fn)) ) {
- PyErr_Mac(ErrorObject, err);
- return 0;
- }
- dnr_is_open = 1;
- return 1;
-}
-
-static object *
-dnr_Open(self, args)
- object *self; /* Not used */
- object *args;
-{
- char *fn = NULL;
-
- if (!newgetargs(args, "|s", &fn))
- return NULL;
- if ( dnr_is_open ) {
- err_setstr(ErrorObject, "DNR already open");
- return NULL;
- }
- if ( !opendnr(fn) )
- return NULL;
- INCREF(None);
- return None;
-}
-
-static object *
-dnr_Close(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
-
- if (!newgetargs(args, ""))
- return NULL;
- dnr_is_open = 0;
- if ( (err=CloseResolver()) ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- return None;
-}
-
-static object *
-dnr_StrToAddr(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- char *hostname;
- dnrrobject *rv;
- ResultUPP cb_upp = NewResultProc(dnrr_done);
-
- if (!newgetargs(args, "s", &hostname))
- return NULL;
- if ( !opendnr(NULL) )
- return NULL;
- if ( (rv=newdnrrobject(DNR_ADDR)) == NULL )
- return NULL;
- err = StrToAddr(hostname, (struct hostInfo *)&rv->hinfo, cb_upp, (char *)rv);
- if ( err == cacheFault ) {
- rv->waiting++;
- INCREF(rv);
- } else if ( err ) {
- DECREF(rv);
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- return (object *)rv;
-}
-
-static object *
-dnr_AddrToName(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- unsigned long ipaddr;
- dnrrobject *rv;
- ResultUPP cb_upp = NewResultProc(dnrr_done);
-
- if (!newgetargs(args, "l", &ipaddr))
- return NULL;
- if ( !opendnr(NULL) )
- return NULL;
- if ( (rv=newdnrrobject(DNR_ADDR)) == NULL )
- return NULL;
- err = AddrToName(ipaddr, (struct hostInfo *)&rv->hinfo, cb_upp, (char *)rv);
- if ( err == cacheFault ) {
- rv->waiting++;
- INCREF(rv);
- } else if ( err ) {
- DECREF(rv);
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- return (object *)rv;
-}
-
-static object *
-dnr_AddrToStr(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- unsigned long ipaddr;
- char ipname[16];
-
- if (!newgetargs(args, "l", &ipaddr))
- return NULL;
- if ( !opendnr(NULL) )
- return NULL;
- if ( (err=AddrToStr(ipaddr, ipname)) ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- return newstringobject(ipname);
-}
-
-static object *
-dnr_HInfo(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- char *hostname;
- dnrrobject *rv;
- ResultProc2UPP cb_upp = NewResultProc2Proc(dnrr_done);
-
- if (!newgetargs(args, "s", &hostname))
- return NULL;
- if ( !opendnr(NULL) )
- return NULL;
- if ( (rv=newdnrrobject(DNR_HINFO)) == NULL )
- return NULL;
- err = HInfo(hostname, &rv->hinfo, cb_upp, (char *)rv);
- if ( err == cacheFault ) {
- rv->waiting++;
- INCREF(rv);
- } else if ( err ) {
- DECREF(rv);
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- return (object *)rv;
-
- if (!newgetargs(args, ""))
- return NULL;
- INCREF(None);
- return None;
-}
-
-static object *
-dnr_MXInfo(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- char *hostname;
- dnrrobject *rv;
- ResultProc2UPP cb_upp = NewResultProc2Proc(dnrr_done);
-
- if (!newgetargs(args, "s", &hostname))
- return NULL;
- if ( !opendnr(NULL) )
- return NULL;
- if ( (rv=newdnrrobject(DNR_MX)) == NULL )
- return NULL;
- err = MXInfo(hostname, &rv->hinfo, cb_upp, (char *)rv);
- if ( err == cacheFault ) {
- rv->waiting++;
- INCREF(rv);
- } else if ( err ) {
- DECREF(rv);
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- return (object *)rv;
-}
-
-/* List of methods defined in the module */
-
-static struct methodlist dnr_methods[] = {
- {"Open", dnr_Open, 1},
- {"Close", dnr_Close, 1},
- {"StrToAddr", dnr_StrToAddr, 1},
- {"AddrToStr", dnr_AddrToStr, 1},
- {"AddrToName", dnr_AddrToName, 1},
- {"HInfo", dnr_HInfo, 1},
- {"MXInfo", dnr_MXInfo, 1},
-
- {NULL, NULL} /* sentinel */
-};
-
-
-/* Initialization function for the module (*must* be called initmacdnr) */
-
-void
-initmacdnr()
-{
- object *m, *d;
-
- /* Create the module and add the functions */
- m = initmodule("macdnr", dnr_methods);
-
- /* Add some symbolic constants to the module */
- d = getmoduledict(m);
- ErrorObject = newstringobject("macdnr.error");
- dictinsert(d, "error", ErrorObject);
-#if 0
-/* Not needed, after all */
-#define CONST(name, value) o = newintobject(value); dictinsert(d, name, o);
- CONST("ADDR", DNR_ADDR);
- CONST("HINFO", DNR_HINFO);
- CONST("MX", DNR_MX);
-#endif
- /* Check for errors */
- if (err_occurred())
- fatal("can't initialize module macdnr");
-}
diff --git a/Mac/Unsupported/mactcp/mactcpmodule.c b/Mac/Unsupported/mactcp/mactcpmodule.c
deleted file mode 100644
index fc07f1e..0000000
--- a/Mac/Unsupported/mactcp/mactcpmodule.c
+++ /dev/null
@@ -1,990 +0,0 @@
-/***********************************************************
-Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
-Amsterdam, The Netherlands.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Stichting Mathematisch
-Centrum or CWI not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior permission.
-
-STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
-FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-******************************************************************/
-
-#include "allobjects.h"
-#include "modsupport.h" /* For getargs() etc. */
-
-#include "macglue.h"
-#include "tcpglue.h"
-
-#include <Desk.h>
-
-/* State of a tcp stream, in the connectionState field */
-#define STATE_CLOSED 0
-#define STATE_LISTEN 2
-#define STATE_ESTAB 8
-#define STATE_CWAIT 18
-
-/* Python code has an additional reason for asr call: open done */
-#define MY_OPEN_DONE 32766
-
-static object *ErrorObject;
-
-TCPIOCompletionUPP upp_tcp_done;
-TCPNotifyUPP upp_tcp_asr;
-#if 0
-UDPIOCompletionUPP upp_udp_done;
-#endif
-UDPNotifyUPP upp_udp_asr;
-
-/* ----------------------------------------------------- */
-/* Declarations for objects of type MacTCP connection status */
-
-typedef struct {
- OB_HEAD
- TCPStatusPB status;
-} tcpcsobject;
-
-staticforward typeobject Tcpcstype;
-
-#define is_tcpcsobject(v) ((v)->ob_type == &Tcpcstype)
-
-/* ---------------------------------------------------------------- */
-/* Declarations for objects of type MacTCP global status */
-
-#ifdef TCP_GS
-typedef struct {
- OB_HEAD
- TCPParam *ptr;
-} tcpgsobject;
-
-staticforward typeobject Tcpgstype;
-
-#define is_tcpgsobject(v) ((v)->ob_type == &Tcpgstype)
-#endif /* TCP_GS */
-
-/* ---------------------------------------------------------------- */
-/* Declarations for objects of type MacTCP TCP stream */
-
-typedef struct {
- OB_HEAD
- TCPiopb iop;
- long localhost; /* Our IP address */
- short localport; /* Our port number */
- object *asr; /* Optional async notification routine */
- int asr_ec; /* error code parameter to asr */
- int asr_reason; /* detail for some errors */
- int async_busy; /* True when completion routine pending */
- int async_err; /* the error for the async call */
-} tcpsobject;
-
-staticforward typeobject Tcpstype;
-
-#define is_tcpsobject(v) ((v)->ob_type == &Tcpstype)
-
-/* ---------------------------------------------------------------- */
-/* Declarations for objects of type MacTCP UDP stream */
-
-typedef struct {
- OB_HEAD
- UDPiopb iop;
- object *asr;
- int asr_ec; /* error code parameter to asr */
- ip_port port;
-} udpsobject;
-
-staticforward typeobject Udpstype;
-
-#define is_udpsobject(v) ((v)->ob_type == &Udpstype)
-
-/* ---------------------------------------------------------------- */
-
-static tcpcsobject *
-newtcpcsobject(ptr)
- TCPStatusPB *ptr;
-{
- tcpcsobject *self;
-
- self = NEWOBJ(tcpcsobject, &Tcpcstype);
- if (self == NULL)
- return NULL;
- self->status = *ptr;
- return self;
-}
-
-static void
-tcpcs_dealloc(self)
- tcpcsobject *self;
-{
- DEL(self);
-}
-/* Code to access structure members by accessing attributes */
-
-#include "structmember.h"
-
-#define OFF(x) offsetof(TCPStatusPB, x)
-
-static struct memberlist tcpcs_memberlist[] = {
- {"remoteHost", T_ULONG, OFF(remoteHost), RO},
- {"remotePort", T_USHORT, OFF(remotePort), RO},
- {"localHost", T_UINT, OFF(localHost), RO},
- {"localPort", T_USHORT, OFF(localPort), RO},
- {"tosFlags", T_BYTE, OFF(tosFlags), RO},
-#if 0 /* Bug in header file: cannot access precedence */
- {"precedence" T_BYTE, OFF(precedence), RO},
-#endif
- {"connectionState", T_BYTE, OFF(connectionState), RO},
- {"sendWindow", T_USHORT, OFF(sendWindow), RO},
- {"rcvWindow", T_USHORT, OFF(rcvWindow), RO},
- {"amtUnackedData", T_USHORT, OFF(amtUnackedData), RO},
- {"amtUnreadData", T_USHORT, OFF(amtUnreadData), RO},
- {"sendUnacked", T_UINT, OFF(sendUnacked), RO},
- {"sendNext", T_UINT, OFF(sendNext), RO},
- {"congestionWindow", T_UINT, OFF(congestionWindow), RO},
- {"rcvNext", T_UINT, OFF(rcvNext), RO},
- {"srtt", T_UINT, OFF(srtt), RO},
- {"lastRTT", T_UINT, OFF(lastRTT), RO},
- {"sendMaxSegSize", T_UINT, OFF(sendMaxSegSize), RO},
- {NULL} /* Sentinel */
-};
-
-static object *
-tcpcs_getattr(self, name)
- tcpcsobject *self;
- char *name;
-{
- return getmember((char *)&self->status, tcpcs_memberlist, name);
-}
-
-
-static typeobject Tcpcstype = {
- OB_HEAD_INIT(&Typetype)
- 0, /*ob_size*/
- "MacTCP connection status", /*tp_name*/
- sizeof(tcpcsobject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)tcpcs_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
- (getattrfunc)tcpcs_getattr, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc)0, /*tp_compare*/
- (reprfunc)0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
-};
-
-/* End of code for MacTCP connection status objects */
-/* -------------------------------------------------------- */
-
-#ifdef TCP_GS
-static tcpgsobject *
-newtcpgsobject(ptr)
- TCPParam *ptr;
-{
- tcpgsobject *self;
-
- self = NEWOBJ(tcpgsobject, &Tcpgstype);
- if (self == NULL)
- return NULL;
- self->ptr = ptr;
- return self;
-}
-
-static void
-tcpgs_dealloc(self)
- tcpgsobject *self;
-{
- DEL(self);
-}
-/* Code to access structure members by accessing attributes */
-#undef OFF
-#define OFF(x) offsetof(TCPParam, x)
-
-static struct memberlist tcpgs_memberlist[] = {
- {"RtoA", T_UINT, OFF(tcpRtoA), RO},
- {"RtoMin", T_UINT, OFF(tcpRtoMin), RO},
- {"RtoMax", T_UINT, OFF(tcpRtoMax), RO},
- {"MaxSegSize", T_UINT, OFF(tcpMaxSegSize), RO},
- {"MaxConn", T_UINT, OFF(tcpMaxConn), RO},
- {"MaxWindow", T_UINT, OFF(tcpMaxWindow), RO},
- {NULL} /* Sentinel */
-};
-
-static object *
-tcpgs_getattr(self, name)
- tcpgsobject *self;
- char *name;
-{
- object *rv;
-
- return getmember((char *)self->ptr, tcpgs_memberlist, name);
-}
-
-static typeobject Tcpgstype = {
- OB_HEAD_INIT(&Typetype)
- 0, /*ob_size*/
- "MacTCP global status", /*tp_name*/
- sizeof(tcpgsobject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)tcpgs_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
- (getattrfunc)tcpgs_getattr, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc)0, /*tp_compare*/
- (reprfunc)0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
-};
-#endif /* TCP_GS */
-
-/* End of code for MacTCP global status objects */
-/* -------------------------------------------------------- */
-
-static int
-tcps_checkstate(self, state, state2)
- tcpsobject *self;
- int state, state2;
-{
- OSErr err;
- TCPStatusPB *pb;
- char buf[80];
-
- if ( self->async_busy ) {
- err_setstr(ErrorObject, "Operation not allowed, PassiveOpen in progress");
- return -1;
- }
- if ( state < 0 && state2 < 0 )
- return 0;
- err = xTCPStatus(&self->iop, &pb);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return -1;
- }
- if ( state == pb->connectionState ||
- state2 == pb->connectionState )
- return 0;
- sprintf(buf, "Operation not allowed, connection state=%d", pb->connectionState);
- err_setstr(ErrorObject, buf);
- return -1;
-}
-
-static int
-tcps_asr_safe(arg)
- void *arg;
-{
- tcpsobject *self = (tcpsobject *)arg;
- object *args, *rv;
-
- if ( self->asr == None )
- return 0;
- args = mkvalue("(ii)", self->asr_ec, self->asr_reason);
- rv = call_object(self->asr, args);
- DECREF(args);
- if ( rv ) {
- DECREF(rv);
- return 0;
- }
- return -1;
-}
-
-static pascal void
-tcps_asr(str, ec, self, reason, icmp)
- StreamPtr str;
- unsigned short ec;
- tcpsobject *self;
- unsigned short reason;
- struct ICMPReport icmp;
-{
- if ( self->asr == None )
- return;
- self->asr_ec = ec;
- self->asr_reason = reason;
- Py_AddPendingCall(tcps_asr_safe, (void *)self);
-}
-
-static void
-tcps_done(pb)
- TCPiopb *pb;
-{
- tcpsobject *self = (tcpsobject *)pb->csParam.open.userDataPtr;
-
- if ( pb != &self->iop || !self->async_busy ) {
- /* Oops... problems */
- printf("tcps_done: unexpected call\n");
- return;
- }
- self->async_busy = 0;
- self->async_err = pb->ioResult;
- /* Extension of mactcp semantics: also call asr on open complete */
- if ( self->asr == None )
- return;
- self->asr_ec = MY_OPEN_DONE;
- self->asr_reason = 0;
- Py_AddPendingCall(tcps_asr_safe, (void *)self);
-}
-
-static object *
-tcps_isdone(self, args)
- tcpsobject *self;
- object *args;
-{
- if (!newgetargs(args, ""))
- return NULL;
- return newintobject(!self->async_busy);
-}
-
-static object *
-tcps_wait(self, args)
- tcpsobject *self;
- object *args;
-{
- if (!newgetargs(args, ""))
- return NULL;
- while ( self->async_busy ) {
- if ( PyMac_Idle() ) {
- INCREF(None);
- return None;
- }
- }
- if ( self->async_err ) {
- PyErr_Mac(ErrorObject, self->async_err);
- self->async_err = 0;
- return NULL;
- }
- INCREF(None);
- return None;
-}
-
-
-static object *
-tcps_PassiveOpen(self, args)
- tcpsobject *self;
- object *args;
-{
- short port;
- OSErr err;
-
- if (!newgetargs(args, "h", &port))
- return NULL;
- if ( tcps_checkstate(self, -1, -1) < 0 )
- return NULL;
- self->async_busy = 1;
- self->async_err = 0;
- err = xTCPPassiveOpen(&self->iop, port, upp_tcp_done,
- (void *)self);
- if ( err ) {
- self->async_busy = 0;
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- self->localhost = self->iop.csParam.open.localHost;
- self->localport = self->iop.csParam.open.localPort;
- INCREF(None);
- return None;
-}
-
-static object *
-tcps_ActiveOpen(self, args)
- tcpsobject *self;
- object *args;
-{
- short lport, rport;
- long rhost;
- OSErr err;
-
- if (!newgetargs(args, "hlh", &lport, &rhost, &rport))
- return NULL;
- if ( tcps_checkstate(self, -1, -1) < 0 )
- return NULL;
- err = xTCPActiveOpen(&self->iop, lport, rhost, rport, (TCPIOCompletionUPP)0);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- self->localhost = self->iop.csParam.open.localHost;
- self->localport = self->iop.csParam.open.localPort;
- INCREF(None);
- return None;
-}
-
-static object *
-tcps_Send(self, args)
- tcpsobject *self;
- object *args;
-{
- char *buf;
- int bufsize;
- int push = 0, urgent = 0;
- OSErr err;
- miniwds wds;
-
- if (!newgetargs(args, "s#|ii", &buf, &bufsize, &push, &urgent))
- return NULL;
- if ( tcps_checkstate(self, STATE_ESTAB, STATE_CWAIT) < 0 )
- return NULL;
- wds.length = bufsize;
- wds.ptr = buf;
- wds.terminus = 0;
- err = xTCPSend(&self->iop, (wdsEntry *)&wds, (Boolean)push, (Boolean)urgent,
- (TCPIOCompletionUPP)0);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- return None;
-}
-
-static object *
-tcps_Rcv(self, args)
- tcpsobject *self;
- object *args;
-{
- int timeout;
- rdsEntry rds[2];
- OSErr err;
- object *rv;
- int urgent, mark;
-
- if (!newgetargs(args, "i", &timeout))
- return NULL;
- if ( tcps_checkstate(self, -1, -1) < 0 )
- return NULL;
- memset((char *)&rds, 0, sizeof(rds));
- err = xTCPNoCopyRcv(&self->iop, rds, 1, timeout, (TCPIOCompletionUPP)0);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- urgent = self->iop.csParam.receive.urgentFlag;
- mark = self->iop.csParam.receive.markFlag;
- rv = newsizedstringobject((char *)rds[0].ptr, rds[0].length);
- err = xTCPBufReturn(&self->iop, rds, (TCPIOCompletionUPP)0);
- if ( err ) {
- /* Should not happen */printf("mactcp module: BufReturn failed?\n");
- PyErr_Mac(ErrorObject, err);
- DECREF(rv);
- return NULL;
- }
- return mkvalue("(Oii)", rv, urgent, mark);
-}
-
-static object *
-tcps_Close(self, args)
- tcpsobject *self;
- object *args;
-{
- OSErr err;
-
- if (!newgetargs(args, ""))
- return NULL;
- err = xTCPClose(&self->iop, (TCPIOCompletionUPP)0);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- return None;
-}
-
-static object *
-tcps_Abort(self, args)
- tcpsobject *self;
- object *args;
-{
- OSErr err;
-
- if (!newgetargs(args, ""))
- return NULL;
- err = xTCPAbort(&self->iop);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- return None;
-}
-
-static object *
-tcps_Status(self, args)
- tcpsobject *self;
- object *args;
-{
- OSErr err;
- TCPStatusPB *pb;
-
- if (!newgetargs(args, ""))
- return NULL;
- if ( tcps_checkstate(self, -1, -1) < 0 )
- return NULL;
- err = xTCPStatus(&self->iop, &pb);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- return (object *)newtcpcsobject(pb);
-}
-
-static object *
-tcps_GetSockName(self, args)
- tcpsobject *self;
- object *args;
-{
- /* This routine is needed so we can get at the local port even when
- ** a PassiveOpen is in progress (when we can't do a Status call).
- ** This is needed for socket listen(); getsockname(); accept() emulation
- ** as used by ftp and the like.
- */
- if (!newgetargs(args, ""))
- return NULL;
- return mkvalue("(lh)", self->localhost, self->localport);
-}
-
-static struct methodlist tcps_methods[] = {
- {"isdone", (method)tcps_isdone, 1},
- {"wait", (method)tcps_wait, 1},
- {"PassiveOpen", (method)tcps_PassiveOpen, 1},
- {"ActiveOpen", (method)tcps_ActiveOpen, 1},
- {"Send", (method)tcps_Send, 1},
- {"Rcv", (method)tcps_Rcv, 1},
- {"Close", (method)tcps_Close, 1},
- {"Abort", (method)tcps_Abort, 1},
- {"Status", (method)tcps_Status, 1},
- {"GetSockName", (method)tcps_GetSockName, 1},
- {NULL, NULL} /* sentinel */
-};
-
-/* ---------- */
-
-static object *
-tcps_getattr(self, name)
- tcpsobject *self;
- char *name;
-{
- if ( strcmp(name, "asr") == 0 ) {
- INCREF(self->asr);
- return self->asr;
- }
- return findmethod(tcps_methods, (object *)self, name);
-}
-
-static int
-tcps_setattr(self, name, value)
- tcpsobject *self;
- char *name;
- object *value;
-{
- if ( strcmp(name, "asr") != 0 || value == NULL )
- return -1;
- self->asr = value; /* XXXX Assuming I don't have to incref */
- return 0;
-}
-
-static tcpsobject *
-newtcpsobject(bufsize)
- int bufsize;
-{
- tcpsobject *self;
- OSErr err;
-
- self = NEWOBJ(tcpsobject, &Tcpstype);
- if (self == NULL)
- return NULL;
- memset((char *)&self->iop, 0, sizeof(self->iop));
- err= xTCPCreate(bufsize, upp_tcp_asr, (void *)self, &self->iop);
- if ( err ) {
- DEL(self);
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- self->localhost = 0;
- self->localport = 0;
- self->asr = None;
- self->async_busy = 0;
- self->async_err = 0;
- return self;
-}
-
-static void
-tcps_dealloc(self)
- tcpsobject *self;
-{
- if ( self->async_busy ) {
- printf("mactcp module: error: dealloc with async busy\n");
- return;
- }
- xTCPRelease(&self->iop);
- DEL(self);
-}
-
-static typeobject Tcpstype = {
- OB_HEAD_INIT(&Typetype)
- 0, /*ob_size*/
- "MacTCP TCP stream", /*tp_name*/
- sizeof(tcpsobject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)tcps_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
- (getattrfunc)tcps_getattr, /*tp_getattr*/
- (setattrfunc)tcps_setattr, /*tp_setattr*/
- (cmpfunc)0, /*tp_compare*/
- (reprfunc)0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
-};
-
-/* End of code for MacTCP TCP stream objects */
-/* -------------------------------------------------------- */
-
-static int
-udps_asr_safe(arg)
- void *arg;
-{
- udpsobject *self = (udpsobject *)arg;
- object *args, *rv;
-
- if ( self->asr == None )
- return 0;
- args = mkvalue("(i)", self->asr_ec);
- rv = call_object(self->asr, args);
- DECREF(args);
- if ( rv ) {
- DECREF(rv);
- return 0;
- }
- return -1;
-}
-
-static pascal void
-udps_asr(str, ec, self, icmp)
- StreamPtr str;
- unsigned short ec;
- udpsobject *self;
- struct ICMPReport icmp;
-{
- if ( self->asr == None )
- return;
- self->asr_ec = ec;
- Py_AddPendingCall(udps_asr_safe, (void *)self);
-}
-
-
-static object *
-udps_Read(self, args)
- udpsobject *self;
- object *args;
-{
- OSErr err;
- object *rv;
- int timeout;
-
- if (!newgetargs(args, "i", &timeout))
- return NULL;
- err = xUDPRead(&self->iop, timeout, (UDPIOCompletionUPP)0);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- rv = newsizedstringobject((char *)self->iop.csParam.receive.rcvBuff,
- self->iop.csParam.receive.rcvBuffLen);
- err = xUDPBfrReturn(&self->iop, self->iop.csParam.receive.rcvBuff);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- DECREF(rv);
- return NULL;
- }
- return rv;
-}
-
-static object *
-udps_Write(self, args)
- udpsobject *self;
- object *args;
-{
- unsigned long host;
- unsigned short port;
- char *buf;
- int bufsize;
- OSErr err;
- miniwds wds;
-
- if (!newgetargs(args, "lhs#", &host, &port, &buf, &bufsize))
- return NULL;
- wds.length = bufsize;
- wds.ptr = buf;
- wds.terminus = 0;
- err = xUDPWrite(&self->iop, host, port, &wds, (UDPIOCompletionUPP)0);
- if ( err ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- return None;
-}
-static struct methodlist udps_methods[] = {
- {"Read", (method)udps_Read, 1},
- {"Write", (method)udps_Write, 1},
-
- {NULL, NULL} /* sentinel */
-};
-
-/* ---------- */
-
-static object *
-udps_getattr(self, name)
- udpsobject *self;
- char *name;
-{
- if ( strcmp(name, "asr") == 0 ) {
- INCREF(self->asr);
- return self->asr;
- }
- if ( strcmp(name, "port") == 0 )
- return newintobject((int)self->port);
- return findmethod(udps_methods, (object *)self, name);
-}
-
-static int
-udps_setattr(self, name, value)
- udpsobject *self;
- char *name;
- object *value;
-{
- if ( strcmp(name, "asr") != 0 || value == NULL )
- return -1;
- self->asr = value; /* XXXX Assuming I don't have to incref */
- return 0;
-}
-
-static udpsobject *
-newudpsobject(bufsize, port)
- int bufsize;
- int port;
-{
- udpsobject *self;
- OSErr err;
-
- self = NEWOBJ(udpsobject, &Udpstype);
- if (self == NULL)
- return NULL;
- memset((char *)&self->iop, 0, sizeof(self->iop));
- self->port = port;
- err= xUDPCreate(&self->iop, bufsize, &self->port, upp_udp_asr,
- (void *)self);
- if ( err ) {
- DEL(self);
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- INCREF(None);
- self->asr = None;
- return self;
-}
-
-static void
-udps_dealloc(self)
- udpsobject *self;
-{
- xUDPRelease(&self->iop);
- DEL(self);
-}
-
-static typeobject Udpstype = {
- OB_HEAD_INIT(&Typetype)
- 0, /*ob_size*/
- "MacTCP UDP stream", /*tp_name*/
- sizeof(udpsobject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)udps_dealloc, /*tp_dealloc*/
- (printfunc)0, /*tp_print*/
- (getattrfunc)udps_getattr, /*tp_getattr*/
- (setattrfunc)udps_setattr, /*tp_setattr*/
- (cmpfunc)0, /*tp_compare*/
- (reprfunc)0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
-};
-
-/* End of code for MacTCP UDP stream objects */
-/* -------------------------------------------------------- */
-
-static object *
-mactcp_TCPCreate(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- object *rv;
- int bufsize;
-
- if (!newgetargs(args, "i", &bufsize))
- return NULL;
- if ( (err = xOpenDriver()) != noErr ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- rv = (object *)newtcpsobject(bufsize);
- return rv;
-}
-
-static object *
-mactcp_UDPCreate(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- object *rv;
- int bufsize, port;
-
- if (!newgetargs(args, "ii", &bufsize, &port))
- return NULL;
- if ( (err = xOpenDriver()) != noErr ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- rv = (object *)newudpsobject(bufsize, port);
- return rv;
-}
-
-static object *
-mactcp_MTU(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- unsigned short mtu;
-
- if (!newgetargs(args, ""))
- return NULL;
- if ( (err = xOpenDriver()) != noErr ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- mtu = xMaxMTU();
- return newintobject((int)mtu);
-}
-
-static object *
-mactcp_IPAddr(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- unsigned long rv;
-
- if (!newgetargs(args, ""))
- return NULL;
- if ( (err = xOpenDriver()) != noErr ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- rv = xIPAddr();
- return newintobject((int)rv);
-}
-
-static object *
-mactcp_NetMask(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
- unsigned long rv;
-
- if (!newgetargs(args, ""))
- return NULL;
- if ( (err = xOpenDriver()) != noErr ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- rv = xNetMask();
- return newintobject((int)rv);
-}
-
-#ifdef TCP_GS
-static object *
-mactcp_GlobalInfo(self, args)
- object *self; /* Not used */
- object *args;
-{
- OSErr err;
-
- if (!newgetargs(args, ""))
- return NULL;
- if ( (err = xOpenDriver()) != noErr ) {
- PyErr_Mac(ErrorObject, err);
- return NULL;
- }
- /* XXXX Allocate, fill */
- INCREF(None);
- return None;
-}
-#endif /* TCP_GS */
-
-/* List of methods defined in the module */
-
-static struct methodlist mactcp_methods[] = {
- {"TCPCreate", mactcp_TCPCreate, 1},
- {"UDPCreate", mactcp_UDPCreate, 1},
- {"MTU", mactcp_MTU, 1},
- {"IPAddr", mactcp_IPAddr, 1},
- {"NetMask", mactcp_NetMask, 1},
-#ifdef TCP_GS
- {"GlobalInfo", mactcp_GlobalInfo, 1},
-#endif
-
- {NULL, NULL} /* sentinel */
-};
-
-
-/* Initialization function for the module (*must* be called initmactcp) */
-
-void
-initmactcp()
-{
- object *m, *d;
-
- /* Create the module and add the functions */
- m = initmodule("mactcp", mactcp_methods);
-
- /* Add some symbolic constants to the module */
- d = getmoduledict(m);
- ErrorObject = newstringobject("mactcp.error");
- dictinsert(d, "error", ErrorObject);
-
- upp_tcp_done = NewTCPIOCompletionProc(tcps_done);
- upp_tcp_asr = NewTCPNotifyProc(tcps_asr);
-#if 0
- upp_udp_done = NewUDPIOCompletionProc(udps_done);
-#endif
- upp_udp_asr = NewUDPNotifyProc(udps_asr);
-
- /* XXXX Add constants here */
-
- /* Check for errors */
- if (err_occurred())
- fatal("can't initialize module mactcp");
-}
diff --git a/Mac/Unsupported/mactcp/mactcpmodules.mu.exp b/Mac/Unsupported/mactcp/mactcpmodules.mu.exp
deleted file mode 100644
index 4cf9f52..0000000
--- a/Mac/Unsupported/mactcp/mactcpmodules.mu.exp
+++ /dev/null
@@ -1,2 +0,0 @@
-initmacdnr
-initmactcp
diff --git a/Mac/Unsupported/mactcp/mactcpmodules.mu.hqx b/Mac/Unsupported/mactcp/mactcpmodules.mu.hqx
deleted file mode 100644
index b784006..0000000
--- a/Mac/Unsupported/mactcp/mactcpmodules.mu.hqx
+++ /dev/null
@@ -1,212 +0,0 @@
-(This file must be converted with BinHex 4.0)
-
-:%'eKBh4MF'e[C(9XCA-ZEA8!68e38N0A588!N!3Dd!!!+q@Mh@0[Ef`!!!!"!!!
-!(!!!'Q3!!"U!!!!!8!!!!!3!!!"S!!)!-!!#!"`(8fpeFQ0PFpf3#!#3'3)!-!!
-#!#J*6'PLFQ&bD@9chC!'!*!C!J!!!!)!+!P-D@*bBA*TCA2GN!B!N"d#!#J!q2r
-`!*!&!G58!*!'-XB!!!!"!*5fU!#3$3)!!-c-!$,-c*Q3"!!cc-bCQ@CQ!$6-c*Q
-C-c-!0Fc-QCN!!!!fc-aQC[rr!$I-c'CQc-`!1-c-CQB!!`!"3!F!N!3-5@jdCA*
-QB@0P6'PL!*!6V%qP3!'"Fh4eBUa2T8!!!J!$!*!%$QeKBf4ZFQe[C(9XC5jM!*!
-4VA-b@3'"9%9B9+ec-PN!!`!$!*!%$QeKBh4MF'e[C(9XC5jM!*!4VA-b@J'"9%9
-B9+ec-PS!"!!$!*!%#A4MF'GXG@8ZB`#3&Uec-PS"J94&@&5YFc*D!!8!!`#3"!a
-KE'a[BQTPBh4c,QJ!N"1Z#C!!13'!9%9B9+i*N!!j!!B!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-"""socket.py for mac - Emulate socket module with mactcp and macdnr
-
-Currently only implements TCP sockets (AF_INET, SOCK_STREAM).
-Esoteric things like socket options don't work,
-but getpeername() and makefile() do work; everything used by ftplib works!
-"""
-
-# Jack Jansen, CWI, November 1994 (initial version)
-# Guido van Rossum, CWI, March 1995 (bug fixes and lay-out)
-
-
-import mactcp
-import MACTCPconst
-import macdnr
-
-
-# Exported constants
-
-_myerror = 'socket_wrapper.error'
-error = (mactcp.error, macdnr.error, _myerror)
-
-SOCK_DGRAM = 1
-SOCK_STREAM = 2
-
-AF_INET = 1
-
-
-# Internal constants
-
-_BUFSIZE = 15*1024 # Size of TCP/UDP input buffer
-
-_myaddress = None
-_myname = None
-_myaddrstr = None
-
-
-def _myipaddress():
- global _myaddress
- if _myaddress == None:
- _myaddress = mactcp.IPAddr()
- return _myaddress
-
-
-def _ipaddress(str):
- if type(str) == type(1):
- return str # Already numeric
- ptr = macdnr.StrToAddr(str)
- ptr.wait()
- return ptr.ip0
-
-
-def gethostbyname(str):
- id = _ipaddress(str)
- return macdnr.AddrToStr(id)
-
-
-def gethostbyaddr(str):
- id = _ipaddress(str)
- ptr = macdnr.AddrToName(id)
- ptr.wait()
- name = ptr.cname
- if name[-1:] == '.': name = name[:-1]
- names, addresses = [], [str]
- return name, names, addresses
-
-def gethostname():
- global _myname
- if _myname == None:
- id = _myipaddress()
- ptr = macdnr.AddrToName(id)
- ptr.wait()
- _myname = ptr.cname
- return _myname
-
-
-def _gethostaddress():
- global _myaddrstr
- if _myaddrstr == None:
- id = _myipaddress()
- _myaddrstr = macdnr.AddrToStr(id)
- return _myaddrstr
-
-
-def socket(family, type, *which):
- if family <> AF_INET:
- raise _myerror, 'Protocol family %d not supported' % type
- if type == SOCK_DGRAM:
- return _udpsocket()
- elif type == SOCK_STREAM:
- return _tcpsocket()
- raise _myerror, 'Protocol type %d not supported' % type
-
-
-def fromfd(*args):
- raise _myerror, 'Operation not supported on a mac'
-
-
-class _socket:
- def unsupported(self, *args):
- raise _myerror, 'Operation not supported on this socket'
-
- accept = unsupported
- bind = unsupported
- close = unsupported
- connect = unsupported
- fileno = unsupported
- getpeername = unsupported
- getsockname = unsupported
- getsockopt = unsupported
- listen = unsupported
- recv = unsupported
- recvfrom = unsupported
- send = unsupported
- sendto = unsupported
- setblocking = unsupported
- setsockopt = unsupported
- shutdown = unsupported
-
-
-class _tcpsocket(_socket):
-
- def __init__(self):
- self.stream = mactcp.TCPCreate(_BUFSIZE)
- ##self.stream.asr = self.asr
- self.databuf = ''
- self.udatabuf = ''
- self.port = 0
- self.accepted = 0
- self.listening = 0
-
- def accept(self):
- if not self.listening:
- raise _myerror, 'Not listening'
- self.listening = 0
- self.stream.wait()
- self.accepted = 1
- return self, self.getsockname()
-
- # bind has two ways of calling: s.bind(host, port) or s.bind((host, port));
- # the latter is more proper but the former more common
- def bind(self, a1, a2=None):
- if a2 is None:
- host, port = a1
- else:
- host, port = a1, a2
- self.port = port
-
- def close(self):
- if self.accepted:
- self.accepted = 0
- return
- self.stream.Abort()
-
- # connect has the same problem as bind (see above)
- def connect(self, a1, a2=None):
- if a2 is None:
- host, port = a1
- else:
- host, port = a1, a2
- self.stream.ActiveOpen(self.port, _ipaddress(host), port)
-
- def getsockname(self):
- host, port = self.stream.GetSockName()
- host = macdnr.AddrToStr(host)
- return host, port
-
- def getpeername(self):
- st = self.stream.Status()
- host = macdnr.AddrToStr(st.remoteHost)
- return host, st.remotePort
-
- def listen(self, backlog):
- self.stream.PassiveOpen(self.port)
- self.listening = 1
-
- def makefile(self, rw = 'r', bs = 512):
- return _socketfile(self, rw, bs)
-
- def recv(self, bufsize, flags=0):
- if flags:
- raise _myerror, 'recv flags not yet supported on mac'
- if not self.databuf:
- try:
- self.databuf, urg, mark = self.stream.Rcv(0)
- except mactcp.error, arg:
- if arg[0] != MACTCPconst.connectionClosing:
- raise mactcp.error, arg
- rv = self.databuf[:bufsize]
- self.databuf = self.databuf[bufsize:]
- return rv
-
- def send(self, buf):
- self.stream.Send(buf)
- return len(buf)
-
- def shutdown(self, how):
- if how == 0:
- return
- self.stream.Close()
-
- def bytes_readable(self):
- st = self.stream.Status()
- return st.amtUnreadData
-
- def bytes_writeable(self):
- st = self.stream.Status()
- return st.sendWindow - st.sendUnacked;
-
-
-class _udpsocket(_socket):
-
- def __init__(self):
- pass
-
-
-class _socketfile:
-
- def __init__(self, sock, rw, bs):
- if rw[1:] == 'b': rw = rw[:1]
- if rw not in ('r', 'w'): raise _myerror, "mode must be 'r' or 'w'"
- self.sock = sock
- self.rw = rw
- self.bs = bs
- self.buf = ''
-
- def read(self, length = -1):
- if length < 0:
- length = 0x7fffffff
- while len(self.buf) < length:
- new = self.sock.recv(0x7fffffff)
- if not new:
- break
- self.buf = self.buf + new
- rv = self.buf[:length]
- self.buf = self.buf[length:]
- return rv
-
- def readline(self):
- import string
- while not '\n' in self.buf:
- new = self.sock.recv(0x7fffffff)
- if not new:
- break
- self.buf = self.buf + new
- if not '\n' in self.buf:
- rv = self.buf
- self.buf = ''
- else:
- i = string.index(self.buf, '\n')
- rv = self.buf[:i+1]
- self.buf = self.buf[i+1:]
- return rv
-
- def readlines(self):
- list = []
- line = self.readline()
- while line:
- list.append(line)
- line = self.readline()
- return list
-
- def write(self, buf):
- BS = self.bs
- if len(buf) >= BS:
- self.flush()
- self.sock.send(buf)
- elif len(buf) + len(self.buf) >= BS:
- self.flush()
- self.buf = buf
- else:
- self.buf = self.buf + buf
-
- def writelines(self, list):
- for line in list:
- self.write(line)
-
- def flush(self):
- if self.buf and self.rw == 'w':
- self.sock.send(self.buf)
- self.buf = ''
-
- def close(self):
- self.flush()
- ##self.sock.close()
- del self.sock
-
-
-def __test_tcp():
- s = socket(AF_INET, SOCK_STREAM)
- s.connect('poseidon.cwi.nl', 13)
- rv = s.recv(1000)
- print 'Time/date:', rv
- rv = s.recv(1000)
- if rv:
- print 'Unexpected extra data:', rv
- s.close()
-
-
-def __test_udp():
- s = socket(AF_INET, SOCK_DGRAM)
- print 'Sending data... (hello world)'
- s.sendto(('poseidon.cwi.nl', 7), 'hello world')
- rv, host = s.recvfrom(1000)
- print 'Got from ', host, ':', rv
diff --git a/Mac/Unsupported/mactcp/tcpglue.c b/Mac/Unsupported/mactcp/tcpglue.c
deleted file mode 100644
index 79042b4..0000000
--- a/Mac/Unsupported/mactcp/tcpglue.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/*
- * Glue routines for mactcp module.
- * Jack Jansen, CWI, 1994.
- *
- * Adapted from mactcp socket library, which was in turn
- * adapted from ncsa telnet code.
- *
- * Original authors: Tom Milligan, Charlie Reiman
- */
-
-# include <Memory.h>
-# include <Files.h>
-# include <Errors.h>
-
-#include "tcpglue.h"
-#include <Devices.h>
-
-static short driver = 0;
-
-#ifndef __powerc
-/*
- * Hack fix for MacTCP 1.0.X bug
- *
- * This hack doesn't work on the PPC. But then, people with new machines
- * shouldn't run ancient buggy software. -- Jack.
- */
-
-pascal char *ReturnA5(void) = {0x2E8D};
-#endif /* !__powerc */
-
-OSErr xOpenDriver()
-{
- if (driver == 0)
- {
- ParamBlockRec pb;
- OSErr io;
-
- pb.ioParam.ioCompletion = 0L;
- pb.ioParam.ioNamePtr = "\p.IPP";
- pb.ioParam.ioPermssn = fsCurPerm;
- io = PBOpen(&pb,false);
- if (io != noErr)
- return(io);
- driver = pb.ioParam.ioRefNum;
- }
- return noErr;
-}
-
-/*
- * create a TCP stream
- */
-OSErr xTCPCreate(buflen,notify,udp, pb)
- int buflen;
- TCPNotifyUPP notify;
- void *udp;
- TCPiopb *pb;
-{
- pb->ioCRefNum = driver;
- pb->csCode = TCPCreate;
- pb->csParam.create.rcvBuff = (char *)NewPtr(buflen);
- pb->csParam.create.rcvBuffLen = buflen;
- pb->csParam.create.notifyProc = notify;
- pb->csParam.create.userDataPtr = udp;
- return (xPBControlSync(pb));
-}
-
-
-/*
- * start listening for a TCP connection
- */
-OSErr xTCPPassiveOpen(TCPiopb *pb, short port, TCPIOCompletionUPP completion,
- void *udp)
-{
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPPassiveOpen;
- pb->csParam.open.validityFlags = timeoutValue | timeoutAction;
- pb->csParam.open.ulpTimeoutValue = 255 /* seconds */;
- pb->csParam.open.ulpTimeoutAction = 0 /* 1:abort 0:report */;
- pb->csParam.open.commandTimeoutValue = 0 /* infinity */;
- pb->csParam.open.remoteHost = 0;
- pb->csParam.open.remotePort = 0;
- pb->csParam.open.localHost = 0;
- pb->csParam.open.localPort = port;
- pb->csParam.open.dontFrag = 0;
- pb->csParam.open.timeToLive = 0;
- pb->csParam.open.security = 0;
- pb->csParam.open.optionCnt = 0;
- pb->csParam.open.userDataPtr = udp;
- return (xPBControl(pb,completion));
-}
-
-/*
- * connect to a remote TCP
- */
-OSErr xTCPActiveOpen(TCPiopb *pb, short port, long rhost, short rport,
- TCPIOCompletionUPP completion)
-{
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPActiveOpen;
- pb->csParam.open.validityFlags = timeoutValue | timeoutAction;
- pb->csParam.open.ulpTimeoutValue = 60 /* seconds */;
- pb->csParam.open.ulpTimeoutAction = 1 /* 1:abort 0:report */;
- pb->csParam.open.commandTimeoutValue = 0;
- pb->csParam.open.remoteHost = rhost;
- pb->csParam.open.remotePort = rport;
- pb->csParam.open.localHost = 0;
- pb->csParam.open.localPort = port;
- pb->csParam.open.dontFrag = 0;
- pb->csParam.open.timeToLive = 0;
- pb->csParam.open.security = 0;
- pb->csParam.open.optionCnt = 0;
- return (xPBControl(pb,completion));
-}
-
-OSErr xTCPNoCopyRcv(pb,rds,rdslen,timeout,completion)
- TCPiopb *pb;
- rdsEntry *rds;
- int rdslen;
- int timeout;
- TCPIOCompletionUPP completion;
-{
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPNoCopyRcv;
- pb->csParam.receive.commandTimeoutValue = timeout; /* seconds, 0 = blocking */
- pb->csParam.receive.rdsPtr = (Ptr)rds;
- pb->csParam.receive.rdsLength = rdslen;
- return (xPBControl(pb,completion));
-}
-
-OSErr xTCPBufReturn(TCPiopb *pb,rdsEntry *rds,TCPIOCompletionUPP completion)
- {
- pb->ioCRefNum = driver;
- pb->csCode = TCPRcvBfrReturn;
- pb->csParam.receive.rdsPtr = (Ptr)rds;
-
- return (xPBControl(pb,completion));
- }
-
-/*
- * send data
- */
-OSErr xTCPSend(TCPiopb *pb, wdsEntry *wds, Boolean push, Boolean urgent, TCPIOCompletionUPP completion)
-{
- if (driver == 0)
- return invalidStreamPtr;
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPSend;
- pb->csParam.send.validityFlags = timeoutValue | timeoutAction;
- pb->csParam.send.ulpTimeoutValue = 60 /* seconds */;
- pb->csParam.send.ulpTimeoutAction = 0 /* 0:abort 1:report */;
- pb->csParam.send.pushFlag = push;
- pb->csParam.send.urgentFlag = urgent;
- pb->csParam.send.wdsPtr = (Ptr)wds;
- return (xPBControl(pb,completion));
-}
-
-
-/*
- * close a connection
- */
-OSErr xTCPClose(TCPiopb *pb,TCPIOCompletionUPP completion)
-{
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPClose;
- pb->csParam.close.validityFlags = timeoutValue | timeoutAction;
- pb->csParam.close.ulpTimeoutValue = 60 /* seconds */;
- pb->csParam.close.ulpTimeoutAction = 1 /* 1:abort 0:report */;
- return (xPBControl(pb,completion));
-}
-
-/*
- * abort a connection
- */
-OSErr xTCPAbort(TCPiopb *pb)
-{
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPAbort;
- return (xPBControlSync(pb));
-}
-
-/*
- * close down a TCP stream (aborting a connection, if necessary)
- */
-OSErr xTCPRelease(pb)
- TCPiopb *pb;
-{
- OSErr io;
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPRelease;
- io = xPBControlSync(pb);
- if (io == noErr)
- DisposPtr(pb->csParam.create.rcvBuff); /* there is no release pb */
- return(io);
-}
-
-#if 0
-
-int
-xTCPBytesUnread(sp)
- SocketPtr sp;
-{
- TCPiopb *pb;
- OSErr io;
-
- if (!(pb = sock_fetch_pb(sp)))
- return -1; /* panic */
-
- if (driver == 0)
- return(-1);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPStatus;
- io = xPBControlSync(pb);
- if (io != noErr)
- return(-1);
- return(pb->csParam.status.amtUnreadData);
-}
-
-int
-xTCPBytesWriteable(sp)
- SocketPtr sp;
- {
- TCPiopb *pb;
- OSErr io;
- long amount;
-
- if (!(pb = sock_fetch_pb(sp)))
- return -1; /* panic */
-
- if (driver == 0)
- return(-1);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPStatus;
- io = xPBControlSync(pb);
- if (io != noErr)
- return(-1);
- amount = pb->csParam.status.sendWindow-pb->csParam.status.amtUnackedData;
- if (amount < 0)
- amount = 0;
- return amount;
- }
-
-int xTCPWriteBytesLeft(SocketPtr sp)
- {
- TCPiopb *pb;
- OSErr io;
-
- if (!(pb = sock_fetch_pb(sp)))
- return -1; /* panic */
-
- if (driver == 0)
- return(-1);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPStatus;
- io = xPBControlSync(pb);
- if (io != noErr)
- return(-1);
- return (pb->csParam.status.amtUnackedData);
- }
-#endif
-
-OSErr xTCPStatus(TCPiopb *pb, TCPStatusPB **spb)
- {
- OSErr io;
-
- if (driver == 0)
- return(-1);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPStatus;
- io = xPBControlSync(pb);
- if (io == noErr)
- *spb = &pb->csParam.status;
- return(io);
- }
-
-
-/*
- * create a UDP stream, hook it to a socket.
- */
-OSErr xUDPCreate(UDPiopb *pb,int buflen,ip_port *port, UDPNotifyUPP asr, void *udp)
- {
- OSErr io;
-
- pb->ioCRefNum = driver;
- pb->csCode = UDPCreate;
- pb->csParam.create.rcvBuff = (char *)NewPtr(buflen);
- pb->csParam.create.rcvBuffLen = buflen;
- pb->csParam.create.notifyProc = asr;
- pb->csParam.create.userDataPtr = udp;
- pb->csParam.create.localPort = *port;
- if ( (io = xPBControlSync( (TCPiopb *)pb ) ) != noErr)
- return io;
-
- *port = pb->csParam.create.localPort;
- return noErr;
- }
-
-/*
- * ask for incoming data
- */
-OSErr xUDPRead(UDPiopb *pb, int timeout, UDPIOCompletionUPP completion)
- {
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = UDPRead;
- pb->csParam.receive.timeOut = timeout;
- pb->csParam.receive.secondTimeStamp = 0/* must be zero */;
- return (xPBControl ( (TCPiopb *)pb, (TCPIOCompletionUPP)completion ));
- }
-
-OSErr xUDPBfrReturn(UDPiopb *pb, char *buff)
- {
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = UDPBfrReturn;
- pb->csParam.receive.rcvBuff = buff;
- return ( xPBControl( (TCPiopb *)pb,(TCPIOCompletionUPP)-1 ) );
- }
-
-/*
- * send data
- */
-OSErr xUDPWrite(UDPiopb *pb,ip_addr host,ip_port port,miniwds *wds,
- UDPIOCompletionUPP completion)
- {
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = UDPWrite;
- pb->csParam.send.remoteHost = host;
- pb->csParam.send.remotePort = port;
- pb->csParam.send.wdsPtr = (Ptr)wds;
- pb->csParam.send.checkSum = true;
- pb->csParam.send.sendLength = 0/* must be zero */;
- return (xPBControl( (TCPiopb *)pb, (TCPIOCompletionUPP)completion));
- }
-
-/*
- * close down a UDP stream (aborting a read, if necessary)
- */
-OSErr xUDPRelease(UDPiopb *pb) {
- OSErr io;
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = UDPRelease;
- io = xPBControlSync( (TCPiopb *)pb );
- if (io == noErr) {
- DisposPtr(pb->csParam.create.rcvBuff);
- }
- return(io);
- }
-
-ip_addr xIPAddr(void)
-{
- struct GetAddrParamBlock pbr;
- OSErr io;
-
- pbr.ioCRefNum = driver;
- pbr.csCode = ipctlGetAddr;
- io = xPBControlSync( (TCPiopb *)&pbr );
- if (io != noErr)
- return(0);
- return(pbr.ourAddress);
-}
-
-long xNetMask()
-{
- struct GetAddrParamBlock pbr;
- OSErr io;
-
- pbr.ioCRefNum = driver;
- pbr.csCode = ipctlGetAddr;
- io = xPBControlSync( (TCPiopb *)&pbr);
- if (io != noErr)
- return(0);
- return(pbr.ourNetMask);
-}
-
-unsigned short xMaxMTU()
-{
- struct UDPiopb pbr;
- OSErr io;
-
- pbr.ioCRefNum = driver;
- pbr.csCode = UDPMaxMTUSize;
- pbr.csParam.mtu.remoteHost = xIPAddr();
- io = xPBControlSync( (TCPiopb *)&pbr );
- if (io != noErr)
- return(0);
- return(pbr.csParam.mtu.mtuSize);
-}
-
-OSErr xPBControlSync(TCPiopb *pb)
-{
- (pb)->ioCompletion = 0L;
- return PBControl((ParmBlkPtr)(pb),false);
-}
-
-#pragma segment SOCK_RESIDENT
-
-OSErr xTCPRcv(pb,buf,buflen,timeout,completion)
- TCPiopb *pb;
- Ptr buf;
- int buflen;
- int timeout;
- TCPIOCompletionUPP completion;
-{
-
- if (driver == 0)
- return(invalidStreamPtr);
-
- pb->ioCRefNum = driver;
- pb->csCode = TCPRcv;
- pb->csParam.receive.commandTimeoutValue = timeout; /* seconds, 0 = blocking */
- pb->csParam.receive.rcvBuff = buf;
- pb->csParam.receive.rcvBuffLen = buflen;
- return (xPBControl(pb,completion));
-}
-
-OSErr xPBControl(TCPiopb *pb,TCPIOCompletionUPP completion)
-{
-#ifndef __MWERKS__
- pb->ioNamePtr = ReturnA5();
-#endif
-
- if (completion == 0L)
- {
- (pb)->ioCompletion = 0L;
- return(PBControl((ParmBlkPtr)(pb),false)); /* sync */
- }
- else if (completion == (TCPIOCompletionUPP)-1L)
- {
- (pb)->ioCompletion = 0L;
- return(PBControl((ParmBlkPtr)(pb),true)); /* async */
- }
- else
- {
- (pb)->ioCompletion = completion;
- return(PBControl((ParmBlkPtr)(pb),true)); /* async */
- }
-}
-
diff --git a/Mac/Unsupported/mactcp/tcpglue.h b/Mac/Unsupported/mactcp/tcpglue.h
deleted file mode 100644
index ef9e133..0000000
--- a/Mac/Unsupported/mactcp/tcpglue.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Prototypes for mactcpglue routines and includes/structures needed
- * by those.
- *
- * Jack Jansen, CWI, 1994.
- *
- * Adapted from mac socket library, which has in turn adapted from ncsa telnet.
- * Original authors: Tom Milligan, Charlie Reiman
- */
-
-#include <MacTCPCommonTypes.h>
-#include <GetMyIPAddr.h>
-#include <TCPPB.h>
-#include <UDPPB.h>
-#include <AddressXlation.h>
-
-#ifndef __MWERKS__
-#define TCPIOCompletionUPP TCPIOCompletionProc
-#define TCPNotifyUPP TCPNotifyProc
-#define UDPIOCompletionUPP UDPIOCompletionProc
-#define UDPNotifyUPP UDPNotifyProc
-#define NewTCPIOCompletionProc(x) (x)
-#define NewTCPNotifyProc(x) (x)
-#define NewUDPIOCompletionProc(x) (x)
-#define NewUDPNotifyProc(x) (x)
-#endif /* __MWERKS__ */
-
-#if defined(powerc) || defined (__powerc)
-#pragma options align=mac68k
-#endif
-
-typedef struct miniwds
- {
- unsigned short length;
- char * ptr;
- unsigned short terminus; /* must be zero'd for use */
- } miniwds;
-
-#if defined(powerc) || defined(__powerc)
-#pragma options align=reset
-#endif
-
-
-OSErr xOpenDriver(void);
-OSErr xPBControl(TCPiopb *pb, TCPIOCompletionUPP completion);
-OSErr xPBControlSync(TCPiopb *pb);
-OSErr xTCPCreate(int buflen, TCPNotifyUPP notify, void *udp, TCPiopb *pb);
-OSErr xTCPPassiveOpen(TCPiopb *pb, short port, TCPIOCompletionUPP completion, void *udp);
-OSErr xTCPActiveOpen(TCPiopb *pb, short port, long rhost, short rport, TCPIOCompletionUPP completion);
-OSErr xTCPRcv(TCPiopb *pb, char *buf, int buflen, int timeout, TCPIOCompletionUPP completion);
-OSErr xTCPNoCopyRcv(TCPiopb *,rdsEntry *,int,int,TCPIOCompletionUPP);
-OSErr xTCPBufReturn(TCPiopb *pb,rdsEntry *rds,TCPIOCompletionUPP completion);
-OSErr xTCPSend(TCPiopb *pb, wdsEntry *wds, Boolean push, Boolean urgent, TCPIOCompletionUPP completion);
-OSErr xTCPClose(TCPiopb *pb,TCPIOCompletionUPP completion);
-OSErr xTCPAbort(TCPiopb *pb);
-OSErr xTCPRelease(TCPiopb *pb);
-
-OSErr xUDPCreate(UDPiopb *pb,int buflen,ip_port *port, UDPNotifyUPP asr, void *udp);
-OSErr xUDPRead(UDPiopb *pb,int timeout, UDPIOCompletionUPP completion);
-OSErr xUDPBfrReturn(UDPiopb *pb, char *buff);
-OSErr xUDPWrite(UDPiopb *pb,ip_addr host,ip_port port,miniwds *wds,
- UDPIOCompletionUPP completion);
-OSErr xUDPRelease(UDPiopb *pb);
-
-ip_addr xIPAddr(void);
-long xNetMask(void);
-unsigned short xMaxMTU(void);
-