INET_CMUTIL package - AF_INET synchronous sockets for CMUTEK ************************************************************ ************************************************************************ Copyright notice: (1) Distribute, copy or modify as you like, freely or for profit. (2) Do not restrict anyone else from doing the same. (3) Retain this copyright on all copies (4) No warranties expressed or implied. Dr. Bithead software May this be used to the Glory of God ************************************************************************ VMS *** VMS Installation: say you have the compressed saveset inet_cmutil.bck_z in your current directory. For worst case, assume the compression executable LZDCMP.EXE is there too (***N.B. FTP these using binary or get/t=i!) $ lzdc:==$'f$env("default")'lzdcmp $ lzdc inet_cmutil.bck_z inet_cmutil.bck !delete .bck_z after this if desired $ back/ver inet_cmutil.bck/sa [.*]*.*;* !*** N.B. saveset blocksize is 2048 $ set default [.inet_cmutil] ![.inet_cmutil] created by backup $ back/ver vmsobjexe.bck/sa *.*;* $ @make build !to build inet_cmutil on VMS (version 4 or 5): ! - assumes C compiler is available ! - ignore %CC-I-NONPORTABLE informational notices or $ copy *.obj_vN *.obj !to just use existing object file ! - N = 4 for VMS V4.5+ or N = 5 for VMS 5.3-1 ! (not tested on V5.0 to V5.1) VMS system specifics: VMS af_inet/tcp setup: If your IPACP device is not IP:, create logical name INET$DEVICE in LNM$SYSTEM_TABLE - e.g. $ DEFI/SYSTEM INET$DEVICE IQ: and ensure this is accomplished for subsequent reboots. Very few of you will have to deal with this. No action here results in default of IPACP device to IP:, which is the (hardcoded) default for standard cmutek. INET_CMUTIL.C/.OBJ_V4/.OBJ_V5 are your guides along with the include files cmutekinet.h, cmutekmacro.h, cmutekerr.h, tcpdefs.hcmu, debug.h, novms.h. To load the sockaddr struct in C programs, use macro (from cmutekinet.h): LOADSOCKADDR( (struct sockaddr *)SCKADR, (char *)ADDR, (short)PORT) see cmutekinet.h for explanation of LOADSOCKADDR parameters. SCKADR can be a sockaddr_in structure - in_addr is MostSig"Domain" first i.e. 128.1.2.3 -> 0x03020180 Call inet_socket/inet_bind/inet_accept for servers and inet_socket/inet_connect for clients and inet_send/inet_recv/inet_close the way you usually call socket/bind/accept/connect/send/recv/close. Optionally, for Eunuchs(tm) code, add #define socket inet_socket #define bind inet_bind &c to routines that use sockets. Link to INET_CMUTIL.OBJ and SYS$LIBRARY:NETERROR.OBJ (NETERROR.OBJ comes from NETERROR.MSG which is in your CMUTEK distribution: IPACP06n.B) PLEASE remember that these routines currently ONLY emulate sockets using RDWR & synchronous communications. Specifically, O_NDELAY and FNDELAY flags have no meaning. any calls to fcntl, write, read, sendto, readfrom, &c will give you undefined behavior. Brian Carcich - Galileo Project - Centre for Radiophysics & Space Research Cornell University | Internet: carcich@cuspif.tn.cornell.edu 422 Space Sciences Building | BITnet: btcx@crnlvax5 Ihtaca, NY 14853 | SPAN: CUSPIF::CARCICH (6287::CARCICH) | NYTel: +01(607)255-7453 The only things I don't like about C and Eunuchs(tm) are their proponents.