*DECK TEXTIPL PROC TEXTIPL; *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992. # TITLE TEXTIPL - SYMPL TEXT FOR THE IP SOCKET LIBRARY # CONTROL STEXT; BEGIN # TEXTIPL # # **** TEXTIPL SYMPL TEXT FOR THE IP SOCKET LIBRARY * * THIS PROCEDURE GENERATES A SYMPL TEXT FOR COMPILING THE IP * SOCKET LIBRARY FOR TCP AND UDP INTERFACES. * IT CONTAINS DEFINITIONS OF SYMBOLS, PARAMETERS, COMMON BLOCKS, * ETC THROUGHOUT THE PROGRAM. * * # *CALL COPYRITC # **** MISCELLANEOUS DEFINITIONS # DEF SM$ # 0 #; # SUPERVISORY MESSAGE LIST NUMB # DEF DATA$ # 1 #; # DATA MESSAGE LIST NUMBER # DEF ACNSIZE$ # 7 #; # ACN CONNECTION BLOCK SIZE # DEF MINACN$ # 1 #; # MINIMUM NAM CONNECTION NUMBER # DEF MAXACN$ # 5 #; # MAXIMUM NAM CONNECTION NUMBER # DEF INPSIZE$ # 273 #; # SIZE OF INPUT BUFFER # DEF OUTSIZE$ # 273 #; # SIZE OF OUTPUT BUFFER # DEF NORMWAIT$ # 2 #; # NORMAL NETWAIT TIME # DEF NOWAIT$ # 1 #; # NO WAIT REQUESTED NETWAIT TIME# DEF CONNECTABN$ # 1 #; # CON/ACRQ ABN VALUE # DEF BLOCKWAIT$ # 60 #; # DEFAULT BLOCKING VALUE 60 SEC # DEF HOSTNAME$ # "LOCALHOST_" #; # LOCAL HOST NAME IN TCPHOST FIL# DEF HOSTSIZE$ # 30 #; # MAXIMUM HOST NAME SIZE # DEF NLFILE #O"16220634000000000000"#;# LOG FILE NAME # # **** DISPLAY CHARACTERS # DEF CHARA$ # "A" #; # UPPER CASE "A" # DEF CHARZ$ # "Z" #; # UPPER CASE "Z" # DEF CHARNUL$ # 0 #; # NULL CHARACTER # DEF CHARNSIGN$ # O"60" #; # NUMBER SIGN # DEF CHARSP$ # " " #; # SPACE CHARACTER # DEF CHAR0$ # "0" #; # CHARACTER "0" # DEF CHAR9$ # "9" #; # CHARACTER "9" # DEF ESC76$ # O"76" #; # ESCAPE CHARACTER - OCTAL 76 # # **** TCPHOST FILE INFORMATION. # DEF TCPHFN$ # "TCPHOST" #; # TCP HOST FILE NAME # # **** SOCKET APPLICATION ABORT CODES # DEF ERRLGL$ # 0 #; # ERR/LGL RECEIVED # DEF NAKERR$ # 1 #; # FC/NAK RECEIVED # DEF NCONACRQA$ # 2 #; # UNEXPECTED CON/ARCQ/A # DEF NCONCB$ # 3 #; # UNEXPECTED CON/CB/R # DEF NCONENDN$ # 4 #; # UNEXPECTED CON/END/N # DEF NCONREQ$ # 5 #; # INTERNAL ERROR # DEF NFCACK$ # 6 #; # UNEXPECTED FC/ACK # DEF NFCINIT$ # 7 #; # UNEXPECTED FC/INIT/R # DEF NDATA$ # 8 #; # UNEXPECTED DATA # DEF NINVALID$ # 9 #; # INVALID DATA OR UDP VERSION # DEF INTERROR$ # 10 #; # INTERNAL ERROR # DEF NLAST$ # 10 #; # LAST EXIT CONDITION # # **** NAM NETON STATUS # STATUS NETON$STATUS # NETON STATUS LIST # SUCCESS, # NETON SUCCESSFUL # UNAVAILABLE, # NAM UNAVAILABLE # DUPLICATE, # DUPLICATE NETON ATTEMPT # DISABLED, # APPLICATION DISABLED # HSTNOTFOUND; # HOST NOT FOUND IN TCPHOST FILE# # **** PROTOCOL TYPES SUPPORTED BY THE SOCKET LIBRARY # STATUS PTYPE SOCKETUDP, # UDP PACKET PROTOCOL # SOCKETTCP; # TCP STREAM PROTOCOL # # **** SOCKET CONNECTION STATE TO THE GATEWAY. # STATUS CONNECTSTATE IDLE, # GATEWAY CONN NOT ESTABLISHED # CONNECTED, # CONNECT EST, CON/REQ/R RECEIVD# OPEN, # CONNECTION OPEN, FC/INIT REC # BOUND, # SOCKET BOUND TO A PORT # CLOSING, # SENT THE CON/END/R MESSAGE # CLOSED; # THE SOCKET IS CLOSED # # **** SOCKET ROUTINES RETURN STATUS CODES # STATUS SOCKSTAT OK, # COMPLETE NO ERROR # WAIT, # CONNECTION INIT IN PROCESS # ABORT, # CONNECTION ABORTED # NODATA, # NO SM/DATA AVAILABLE # FLOWCTRL, # DATA NOT SENT, AT ABL # INVALIDST, # INVALID STATE FOR THE REQUEST # CONFIGERR, # SYSTEM CONFIGURED INCORRECTLY # UNAVGATE, # TCP/IP GATEWAY UNAVAILABLE # REQFAIL; # REQUEST FAILED # # **** TCP/IP UDP GATEWAY INTERFACE DECLARATIONS * * THE FOLLOWING CONTAIN CONSTANT AND STATUS DECLARATIONS RELATED * TO THE IP SOCKET LIBRARY INTERFACE TO THE CDCNET TCP/IP GATEWAY. * # DEF BASENAME$ # "TCPIPGW" #; # BASE TCPIP GW NAME # DEF ADDSIZE$ # 4 #; # IP ADDRESS RECORD SIZE # DEF UDPHEADSZ$ # 16 #; # BYTES IN A UDP HEADER RECORD # # **** TCP/IP UDP GATEWAY INTERFACE REQUEST/INDICATIONS # DEF CALLREQ$ # X"10" #; # UDP CALL REQUEST # DEF DATAREQ$ # X"11" #; # DATA REQUEST, NO DESTINATION # DEF DESTREQ$ # X"12" #; # DATA REQUEST WITH DESTINATION # DEF DATAIND$ # X"13" #; # DATA INDICATION FROM THE GW # DEF CALLRES$ # X"14" #; # CALL RESPONSE # DEF UDPVERS$ # X"2" #; # UDP PROTOCOL VERSION # STATUS IP$FIU # IP ADDRESS FIELDS IN USE # NONE, NETWORK, HOST, BOTH; # **** GW$INT$COM - GATEWAY INTERFACE COMMON AREA * * THIS LABELLED COMMON BLOCK CONTAINS THE ARRAY AND BASED ARRAY * AREAS USED TO COMMUNICATE WITH THE GATEWAY. * # COMMON GW$INT$COM; BEGIN # GW$INT$COM # ARRAY TGW$GWNAME [00:00] S(1); BEGIN ITEM TGW$BASENAME C(00,00,07); # BASE DEFAULT GATEWAY NAME # ITEM TGW$MID C(00,42,03); # MACHINE IDENTIFIER # END ARRAY UDP$HEAD$REC [00:00] S(UDPHEADSZ$); BEGIN ITEM UDP$HEADER U(00,52,08); # UDP DATAGRAM HEADER REQUEST # ITEM UDP$VERSION U(01,52,08); # UDP VERSION # ITEM UDP$NOTUSED U(02,52,08); # SPARE BYTE # ITEM UDP$FIU U(03,52,08); # IP ADDRESS FIELDS IN USE # END ARRAY REC$UDP [00:00] S(2); BEGIN # FIRST 2 BYTES OF RECEIVE HEAD # ITEM REC$REQ U(00,52,08); # UDP DATAGRAM HEADER REQUEST # ITEM REC$VER U(01,52,08); # UDP VERSION # END ARRAY HST$ADDR [00:00] S(ADDSIZE$);;# LOCAL HOST IP ADDRESS # BASED ARRAY IP$ADDR$REC [00:00] S(ADDSIZE$); BEGIN ITEM IP$IPFIU U(00,52,08); # FIELDS IN USE # ITEM IP$IPNET U(01,28,32); # NETWORK (O..0FFFFFFH) # ITEM IP$IPHOST U(02,28,32); # HOST (O..0FFFFFFH) # ITEM IP$PIU B(03,35,01); # PORT IN USE # ITEM IP$PORT U(03,36,24); # PORT NUMBER # ITEM IP$UDPORT U(03,28,32); # IN USE/PORT NUMBER # END END # GW$INT$COM # # **** FMTCOM - FILE MANAGEMENT COMMON BLOCK. * * THIS COMMON BLOCK CONTAINS THE DEFINITIONS REQUIRED TO INTERACT * WITH THE NOS PERMANANT FILE SYSTEM. * # # **** FET/CIO BUFFER DEFINITIONS. # DEF FBUFSIZ$ # 128 #; # CIO BUFFER SIZE = 2 PRUS # DEF FETSIZ$ # 16 #; # SIZE OF FET # DEF WORKSIZ$ # 24 #; # SIZE OF WORKING BUFFER # COMMON FMTCOM; BEGIN # FMTCOM # # **** FET - FILE ENVIRONMENT TABLE. * * THE FET BUFFER CONTAINS THE 16-WORD FET DEFINITION FOR READING * THE TCPHOST FILE. # ARRAY FET [00:00] S(FETSIZ$); BEGIN ITEM FET$WORD U(00,00,60); # FULL WORD REFERENCE # ITEM FET$LFN C(00,00,07); # LOCAL FILE NAME # ITEM FET$LFNU U(00,00,42); # LFN AS NUMERIC # ITEM FET$STAT U(00,42,18); # RETURNED STATUS CODE # ITEM FET$LEVN U(00,42,04); # EOR/EOF LEVEL NUMBER # ITEM FET$AT U(00,46,05); # ABNORMAL TERMINATION CODE # ITEM FET$FSTAT U(00,48,11); # REPLY FROM *STATUS* MACRO # ITEM FET$CODE U(00,51,09); # RETURN CODE # ITEM FET$COMPB B(00,59,01); # COMPLETION BIT # ITEM FET$FET1 U(01,00,60); # FULL WORD REFERENCE # ITEM FET$DT C(01,00,02); # DEVICE TYPE # ITEM FET$DTU U(01,00,12); # DEVICE TYPE INTEGER # ITEM FET$RANF B(01,12,01); # RANDOM ACCESS FLAG # ITEM FET$UP B(01,14,01); # USER PROCESSING FLAG # ITEM FET$EP B(01,15,01); # ERROR PROCESSING # ITEM FET$RT B(01,16,01); # REAL TIME PROCESSING # ITEM FET$A B(01,21,01); # CCESS LEVEL PROCESSING # ITEM FET$FB B(01,23,01); # FLUSH BIT # ITEM FET$LEN U(01,36,06); # LENGTH OF FET-5 # ITEM FET$FIRST U(01,42,18); # FIRST POINTER # ITEM FET$IN U(02,42,18); # IN POINTER # ITEM FET$OUT U(03,42,18); # OUT POINTER # ITEM FET$FET4 U(04,00,60); # FULL WORD REFERENCE # ITEM FET$AL U(04,22,03); # FULL WORD REFERENCE # ITEM FET$LIMIT U(04,42,18); # LIMIT POINTER # ITEM FET$FET5 U(05,00,60); # FULL WORD REFERENCE # ITEM FET$CAT U(05,30,30); # SECURITY CATEGORIES # ITEM FET$FET6 U(06,00,60); # FULL WORD REFERENCE # ITEM FET$PFN C(08,00,07); # PERMANNET FILE NAME # ITEM FET$SR U(08,42,06); # SPECIAL REQUEST # ITEM FET$CT U(08,48,06); # FILE CATEGORY # ITEM FET$M U(08,54,06); # FILE ACCESS MODE # ITEM FET$UN C(09,00,07); # ALTERNATE USER NAME # ITEM FET$UNU U(09,00,42); # ALTERNATE USER NAME (NUM) # ITEM FET$DN U(09,42,06); # DEVICE NUMBER FOR CATLIST # ITEM FET$S U(09,36,24); # NUMBER OF PRUS FOR FILE # ITEM FET$PW C(10,00,07); # FILE PASSWORD # ITEM FET$PWU U(10,00,42); # FILE PASSWORD AS INTEGER # ITEM FET$ERAD U(10,42,18); # ERROR MESSAGE ADDRESS # ITEM FET$UCW U(11,00,60); # USER CONTROL WORD # ITEM FET$PN C(12,00,07); # PACKNAME # ITEM FET$PNU U(12,00,42); # PACKNAME AS INTEGER # ITEM FET$UNIT U(12,48,12); # NUMBER OF UNITS ON DEVICE # ITEM FET$NFN C(13,00,07); # NEW FILE NAME # ITEM FET$XT U(13,42,18); # EXPIRATION TERM # ITEM FET$PR U(15,00,03); # PREFERRED RESIDENCE # ITEM FET$BR U(15,03,03); # BACKUP REQUIREMENT # ITEM FET$SS U(15,06,06); # SUBSYSTEM # ITEM FET$AC U(15,12,02); # ALTERNATE USER CATLIST # END # **** CIOBUF - CIRCULAR I/O BUFFER. * # ARRAY CIOBUF [00:00] S(FBUFSIZ$); BEGIN ITEM CIO$WORD U(00,00,60); END # **** WORKBUF - FILE I/O WORKING BUFFER FOR DATA TRANSFER. * # ARRAY WORKBUF [00:00] S(WORKSIZ$); BEGIN ITEM WORK$CHAR C(00,00,240); END END # FMTCOM # # **** NETWORK SUPERVISORY MESSAGE DEFINITIONS * * SUPERVISORY MESSAGE DEFINITIONS ARE SUPPLIED BY THE COMMON * DECKS: SMAPPFC, SMAPDEF, MISCOM. # *CALL SMAPPFC *CALL SMAPDEF *CALL MISCOM # **** BASESM$COM - BASED ARRAY POINTERS. * * THIS LABELLED COMMON BLOCK CONTAINS THE BASED ARRAY POINTERS * WHICH ARE USED DURING SUPERVISORY MESSAGE PROCESSING. * # COMMON BASESM$COM; BEGIN # BASESM$COM # # **** ABH - APPLICATION BLOCK HEADER DEFINITION. * * THE ABH FIELD DECLARATIONS ARE SUPPLIED BY THE COMMON DECK * *HEADER*. # BASED ARRAY ABH [00:00] S(1); BEGIN *CALL HEADER END # **** APSM - SUPERVISORY MESSAGES DEFINITION. * * THE SUPERVISORY MESSAGE FIELD DECLARATIONS ARE SUPPLIED * BY THE COMMON DECKS *SUPMSG* AND *SMAPPL*. # BASED ARRAY APSM [00:00] S(19); BEGIN *CALL SUPMSG *CALL SMAPPL END END # BASESM$COM # # **** SOCKET$COM - COMMON STORAGE AREA FOR THE SOCKET LIBRARY. * * THIS LABELLED COMMON BLOCK CONTAINS THE ACTUAL STORAGE AREA * REQUIRED BY THE SOCKET LIBRARY DURING PROCESSING. * # COMMON SOCKET$COM; BEGIN # SOCKET$COM # ITEM IPMC I; # LOGGING MESSAGE COUNT # ITEM IPHOSTUN C(10); # TCPHOST USERNAME # ITEM CURACN U; # CURRENT ACN NUMBER # ITEM NUMACN U; # NUMBER OF OUTSTANDING CONNECTS# ITEM BLOCK B; # WAIT FOR COMPLETION # ITEM NDLFILE I; # NETWORK DEBUG LOG FILE # ITEM DFLAG B; # DEBUG FLAG # # **** NSUP - NAM SUPERVISORY STATUS WORD * * NSUP IS THE WORD INTO WHICH NAM STORES THE STATE OF * NETWORK COMMUNICATIONS. * # ARRAY NSUP [00:00] S(1); BEGIN ITEM NSUP$W U(00,00,60); # FULL WORD REFERNECE # ITEM NSUP$C B(00,00,01); # COMPLETION BIT # ITEM NSUP$N B(00,02,01); # NAM AVAILABLE BIT # ITEM NSUP$D B(00,03,01); # DATA MESSAGE AVAILABLE BIT # ITEM NSUP$DU U(00,03,01); # DATA MESSAGE AVAILABLE BIT # ITEM NSUP$S B(00,04,01); # SUPERVISORY MESSAGE AVAIL BIT # ITEM NSUP$SU U(00,04,01); # SUPERVISORY MESSAGE AVAIL BIT # ITEM NSUP$MC U(00,30,30); # DEBUG LOG OPER MESSAGE COUNT # END # **** IABH - INPUT APPLICATION BLOCK HEADER * * IABH IS THE WORD INTO WHICH NAM STORES THE APPLICATION BLOCK * HEADER FOLLOWING A *NETGETL* OPERATION. * # ARRAY IABH [00:00] S(1); BEGIN ITEM IABH$WRD U(00,00,60); # FULL WORD REFERENCE # END # **** DABH - OUTPUT DATA APPLICATION BLOCK HEADER * * DABH IS THE WORD CONTAINING THE APPLICATION BLOCK HEADER WHICH * NAM INTERPRETS AFTER A *NETPUT* OPERATION FOR OUTGOING DATA TO * A MDI. * FIXED FIELDS IN THE ABH ARE SET UP AT INITIALIZATION TIME. * # ARRAY DABH [00:00] S(1); BEGIN ITEM DABH$WRD U(00,00,60); # FULL WORD REFERENCE # END # **** SABH - OUTPUT SUPERVISORY MESSAGE APPLICATION BLOCK HEADER * * SABH IS THE WORD CONTAINING THE APPLICATION BLOCK HEADER WHICH * NAM INTERPRETS AFTER A *NETPUT* OPERATION OF AN OUTGOING * ASYNCHRONOUS SUPERVISORY MESSAGE. * FIXED FIELDS IN THE ABH ARE SET UP AT INITIALIZATION TIME. * # ARRAY SABH [00:00] S(1); BEGIN ITEM SABH$WRD U(00,00,60); # FULL WORD REFERENCE # END # **** BWT - BLOCK WAIT TIME * * BWT IS THE WORDS CONTAINING THE TIME OF DAY USED TO DETERMINE * THE LENGTH OF TIME FOR THE IP SOCKET ROUTINES TO BLOCK WAITING * FOR A REQUEST TO BE PROCESSED. # ARRAY BWT$TIME [00:00] S(2); BEGIN ITEM BWT$WORD U(00,00,60); # FULL WORD REFERENCE # ITEM BWT$SECONDS U(00,00,24); # SECOND TIMER # ITEM BWT$MILLI U(00,24,36); # MILLISECOND TIMER # ITEM BWT$EXPIRE U(01,00,24); # SECOND EXPIRE TIME # END # **** ISS - INITIATING SOCKET STATUS * * ISS IS THE WORD CONTAINING THE SOCKET STATUS USED THROUGH THE * OPEN SOCKET PROCEDURE TO DETERMINE THE COMPLETION OF THE OPEN * SOCKET PROCESS. # ARRAY ISS$CONNECT [00:00] S(1); BEGIN ITEM ISS$WORD U(00,00,60); # FULL WORD REFERENCE # ITEM ISS$STATUS S:SOCKSTAT(00,00,03); # CURRENT SOCKET STATUS # ITEM ISS$ACN U(00,48,12); # NEW CONNECTION ACN # END # **** ACNST - APPLICATION CONNECTION SOCKET TABLE. * * ACNST IS THE TABLE USED TO KEEP TRACK OF THE SOCKET CONNECTIONS. * # ARRAY ACN$ST [1:MAXACN$] S(ACNSIZE$); BEGIN ITEM ACN$WORD0 U(00,00,60); # FULL WORD REFERENCE # ITEM ACN$ACN U(00,00,12); # CONNECTION NUMBER # ITEM ACN$PTYPE S:PTYPE(00,12,02); # PROTOCOL UDP OR TCP # ITEM ACN$CONTROL B(00,14,01); # CONTROL ACN FOR TCP ONLY # ITEM ACN$STATE S:CONNECTSTATE(00,15,03);# CURRENT CONNECT STATE# ITEM ACN$DATACN U(00,18,12); # DATA CONNECTION FOR TCP # ITEM ACN$CNTRLACN U(00,18,12); # CONTROL ACN IF DATA CONN # ITEM ACN$DBZ U(00,30,12); # DOWNLINE BLOCK SIZE # ITEM ACN$ABL U(00,42,03); # APPLICATION BLOCK LIMIT # ITEM ACN$OBC U(00,45,03); # OUTSTANDING BLOCK COUNT # ITEM ACN$CONNECT B(00,58,01); # SOCKET CONNECTED TO NAM # ITEM ACN$ABORT B(00,59,01); # CON/CB RECEIVED # ITEM ACN$ABN U(01,00,12); # CURRENT APPL BLOCK NUMBER# ITEM ACN$DATAV B(01,24,01); # DATA AVAILABLE IN BUFFER # ITEM ACN$MORE B(01,25,01); # DATA IS A BLK BLOCK # ITEM ACN$DATALNTH U(01,30,12); # BYTES IN RECEIVED BUFFER # ITEM ACN$BUFFER U(01,42,18); # DATA BUFFER POINTER # ITEM ACN$SIPADDR U(02,00,60); # SOURCE IP ADDRESS LOC # ITEM ACN$SIPFIU S:IP$FIU(02,57,03); # FIELDS IN USE # ITEM ACN$SIPNET U(03,36,24); # NETWORK (O..0FFFFFFH) # ITEM ACN$SIPHOST U(04,36,24); # HOST (O..0FFFFFFH) # ITEM ACN$SUDPIU B(05,35,01); # PORT IN USE # ITEM ACN$SUDPORT U(05,36,24); # PORT (O..0FFFFH) # ITEM ACN$SIUPORT U(05,28,32); # IN USE/PORT # ITEM ACN$WAITIME U(06,48,09); # BLOCK TIME IN SECONDS # ITEM ACN$BLOCK B(06,59,01); # SOCKET BLOCKING # END # **** INPUT BUFFER. * * THE INPUT BUFFER IS USED FOR RECEIVING DATA FROM THE NETWORK. * # ITEM INPLENGTH I; # INPUT LENGTH IN OCTETS # ARRAY INPBUF [00:INPSIZE$] S(1); # INPUT BUFFER # BEGIN ITEM INP$WORD U(00,00,60); END # **** OUTPUT BUFFER. * * THE OUTPUT BUFFER IS USED FOR WRITING TO A FILE AND SENDING * DATA TO THE NETWORK. * # ITEM OUTLENGTH I; # OUTPUT LENGTH IN OCTETS # ARRAY OUTBUF [00:OUTSIZE$] S(1); # OUTPUT BUFFER # BEGIN ITEM OUT$WORD U(00,00,60); END END # SOCKET$COM # COMMON QUEUE$COM; BEGIN # QUEUE$COM # # **** INPUT QUEUE STORAGE AREA. * * THIS ARRAY HOLDS ONE BLOCK OF DATA/CONNECTION TO BE PASSED TO * AN APPLICATION WHEN REQUESTED. ALSO CONTAINS A BASED ARRAY * POINTER USED TO MOVE DATA INTO THE ARRAY. * # BASED ARRAY REA$BUF [00:INPSIZE$] S(1); BEGIN ITEM REA$WORD U(00,00,60); # FULL WORD REFERENCE # END ARRAY QUE$BUF [00:INPSIZE$,MINACN$:MAXACN$] S(1); BEGIN ITEM QUE$WORD U(00,00,60); END END # QUEUE$COM # END # TEXTIPL # TERM