AmendHub

Download:

jcs

/

wikipedia

/

amendments

/

39

tcp: Sync with upstream


jcs made amendment 39 about 1 year ago
--- tcp.c Wed Aug 31 16:20:08 2022 +++ tcp.c Wed Mar 29 13:34:11 2023 @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2020 joshua stein <jcs@jcs.org> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, 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 <stdio.h> #include <string.h> #include "tcp.h" @@ -11,8 +27,6 @@ short gIPPDriverRefNum; -unsigned long resolved_ip; - OSErr _TCPInit(void) { @@ -95,7 +109,6 @@ _TCPPassiveOpen(TCPiopb *pb, StreamPtr stream, ip_addr Ptr userData, TCPIOCompletionProc ioCompletion, Boolean async) { OSErr osErr; - short index; memset(pb, 0, sizeof(*pb)); @@ -452,6 +465,13 @@ _UDPRelease(UDPiopb *pb, StreamPtr stream, Ptr userDat /* convenience functions */ + +pascal void +StrToAddrMarkDone(struct hostInfo *hi, char *data) +{ + volatile int *done = (int *)data; + *done = 1; +} unsigned long ip2long(char *ip) --- tcp.h Wed Aug 31 16:20:10 2022 +++ tcp.h Wed Mar 8 10:07:09 2023 @@ -59,6 +59,10 @@ OSErr _UDPSend(UDPiopb *pb, StreamPtr stream, wdsEntry OSErr _UDPRelease(UDPiopb *pb, StreamPtr stream, Ptr userData, UDPIOCompletionProc ioCompletion, Boolean async); +OSErr DNSResolveName(char **name, unsigned long *ipAddress, + void (*yielder)(void)); +pascal void StrToAddrMarkDone(struct hostInfo *hi, char *data); + unsigned long ip2long(char *ip); void long2ip(unsigned long num, char *ip);