* bsdsocket.library emulation, 06-Sep-1998 * Author: Mathias Ortmann This feature makes a functional bsdsocket.library that sits on top of the host machine's protocol stack available at boot time. This means that you can use all kinds of AmigaOS TCP/IP apps without actually having a protocol stack (AmiTCP, Miami, Termite, etc.) installed on the Amiga side at all. This also means that UAE shares the host's network connection - it will sit on the same IP address(es), see the host's service and protocol databases, etc. Use your favourite web browser on the host side and your favourite IRC client under AmigaOS on a single dial-up or Ethernet connection. Do not expect this to work reliably under Windows 95/98. Software that uses UDP (ping, ICQ clients) will most likely crash UAE (NT is not affected). This executable is based on Brian King's 0.8.6 release 3 source tree. Picasso96 warnings and the GUI have been temporarily disabled. Compatibility ============= Voyager - works perfectly. Cache must not reside on a mounted volume. Move to a native file system or disable (FH_FROM_LOCK DOS packet not implemented). IBrowse - works perfectly. AWeb - works perfectly. AmIRC - works perfectly. Sometimes hangs on close, though. AmFTP - works perfectly telser.device - both outgoing calls and stand-alone daemon mode work. StrICQ - versions that are not Miami-specific work perfectly under Windows NT, but crash UAE under Windows 9x. AExplorer - works perfectly History ======= 980905 - Implemented ReleaseSocket(), ObtainSocket() and getpeername() - Enabled asynchronous notification on blocking sockets (This is an absolute nightmare and currently based on quite a couple of assumptions that real-life software may break.) 980903 - Changed WaitSelect() signal-mask semantics to match Olli Wagner's interpretation. Older versions of Voyager should work now. - Implemented inet_network() 980901 - Some in-depth research on the Windows 9x incompatibility problem reveals that the majority of the crashes were caused by the WSP/NSP starting up in a "magic stack" context, which was easily fixed by making a dummy WinSock call after initializing the socket layer with a regular stack pointer. Unfortunately, some WinSock functions would crash nevertheless (e.g. connect() and sendto()). I kludge-fixed connect() by running it in an extra thread, but then I got tired of wasting my time working around Microsoft's sloppy programming. - Added gethostname() and SetSocketSignals() - Some minor fixes and optimizations 980831 - Added IoctlSocket(FIOASYNC) and recvfrom() 980830 - Added asynchronous socket events (Cloanto's Amiga Explorer works) 980829 - Win32 part partially rewritten to circumvent strange WinSock behaviour (some problems with aborted hostname lookups remain) - OpenLibrary() now allocates a new library base every time it is called 980826 - Library now survives reboots 980825 - Initial release Status ====== Currently, only a subset of the bsdsocket.library API is implemented (as I am too lazy to provide functionality that no application will ever use): socket(d,t,p) ................ fully supported bind(s,n,nl) ................. fully supported listen(s,b) .................. fully supported accept(s,a,al) ............... fully supported connect(s,n,nl) .............. fully supported sendto(s,m,l,f,t,tl) ......... fully supported [NT only] send(s,m,l,f) ................ fully supported recvfrom(s,b,l,f,fr,frl) ..... fully supported recv(s,b,l,f) ................ fully supported shutdown(s,h) ................ fully supported setsockopt(s,l,o,ov,ol) ...... implemented, see (1) getsockopt(s,l,o,ov,ol) ...... implemented, see (1) getsockname(s,h,n) ........... fully supported getpeername(s,h,n) ........... fully supported IoctlSocket(d,r,a) ........... partially supported, see (2) CloseSocket(d) ............... fully supported WaitSelect(n,r,w,e,t,m) ...... fully supported SetSocketSignals(sin,sio,su) . partially supported getdtablesize() .............. fully supported ObtainSocket(i,d,t,p) ........ implemented (id lookup only) ReleaseSocket(f,i) ........... fully supported ReleaseCopyOfSocket(f,i) ..... not implemented Errno() ...................... fully supported SetErrnoPtr(e,s) ............. fully supported Inet_NtoA(i) ................. fully supported inet_addr(c) ................. fully supported Inet_LnaOf(i) ................ not implemented Inet_NetOf(i) ................ not implemented Inet_MakeAddr(n,h) ........... not implemented inet_network(c) .............. fully supported gethostbyname(n) ............. fully supported gethostbyaddr(a,l,t) ......... fully supported getnetbyname(n) .............. not implemented getnetbyaddr(n,t) ............ not implemented getservbyname(n,p) ........... fully supported getservbyport(p,pr) .......... fully supported getprotobyname(n) ............ fully supported getprotobynumber(p) .......... not implemented vsyslog(l,f,a) ............... not implemented Dup2Socket(fa,fb) ............ not implemented sendmsg(s,m,f) ............... not implemented recvmsg(s,m,f) ............... not implemented gethostname(h,s) ............. fully supported gethostid() .................. implemented, see (3) SocketBaseTagList(t) ......... partially supported, see (4) GetSocketEvents(e) ........... supported (5) (1) Not all socket options are supported by the host's protocol stack. Example: AmiTCP's 'traceroute' command will fail because WinSock usually does not support IP_HDRINCL/raw sockets. (2) Only FIONBIO, FIONREAD and FIOASYNC are implemented at this time. (3) This function is deprecated and will always return 127.0.0.1 (4) The following tags are supported: SBTC_BREAKMASK SBTC_ERRNO SBTC_HERRNO SBTC_ERRNOSTRPTR SBTC_HERRNOSTRPTR SBTC_ERRNOBYTEPTR SBTC_ERRNOWORDPTR SBTC_ERRNOLONGPTR SBTC_HERRNOLONGPTR SBTC_SIGEVENTMASK (5) The socket events are not returned in strictly chronological order. If this is a problem, please notify me. If an unknown or unsupported function is called, UAE will generate an appropriate log message, prefixed with "bsdsocket:". Limitations and known bugs ========================== Apart from the unimplemented functionality mentioned above, there are a few other things to be aware of: - You cannot disable it in this version. - The current method of chaining into the EXTER interrupt is lame. I know. - Expunge() currently does nothing. Feedback ======== Please bear in mind that this beta release is intended for experienced UAE users only. Feel free to email me with bug reports and suggestions of any kind, but do not expect me to answer every single mail individually. I do welcome feedback regarding missing functionality that is needed by existing applications. If you have an application that generates bsdsocket: messages in the UAE log, *please* contact me. My current email address (ortmann@informatik.tu-muenchen.de) will cease to work in a few months. The new address will be announced at http://www.uae.de/ when available. Thank you for using UAE.