User Tools

Site Tools


cdc:nos2.source:nam5871:ippbegn

IPPBEGN

Table Of Contents

  • [00003] PROC IPPBEGN (APPNAME, MESSCOUNT, HOSTUN, COMPSTATUS)
  • [00005] IPPBEGN - BEGIN NETWORK
  • [00038] FUNC IPUGHBN B
  • [00039] PROC IPUMCLR
  • [00040] PROC MACHID
  • [00041] PROC NETON
  • [00042] PROC NETREL

Source Code

IPPBEGN.txt
  1. *DECK IPPBEGN
  2. USETEXT TEXTIPL
  3. PROC IPPBEGN (APPNAME, MESSCOUNT, HOSTUN, COMPSTATUS);
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPPBEGN - BEGIN NETWORK #
  6.  
  7. BEGIN # IPPBEGN #
  8. #
  9. **** IPPBEGN BEGIN NETWORK
  10. *
  11. * THIS PROCEDURE ESTABLISHES A CONNENTION TO THE NETWORK VIA
  12. * NAM.
  13. *
  14. * PROC IPPBEGN
  15. *
  16. * ENTRY APPNAME = APPLICATION NAME. MUST BE DEFINED IN
  17. * SYSTEM COMMON DECK *COMTNAP*.
  18. * MESSCOUNT = INTEGER OF MESSAGE COUNT FOR RELEASING DEBUG
  19. * FILE. IF 0, DONT RELEASE.
  20. * HOSTUN = USERNAME OF TCPHOST FILE.
  21. *
  22. * EXIT COMPSTATUS = NETON STATUS.
  23. *
  24. * METHOD OBTAIN THE LOCAL HOST MACHINE ID. BASED ON THE ID
  25. * THE TCP/IP GATEWAY TITLE IS INITIALIZED AND THE LOCAL
  26. * HOSTNAME IS INTIALIZED. THE TCPHOST FILE IS ATTACHED
  27. * AND THE LOCAL HOST IP ADDRESS IS OBTAINED FROM THE FILE.
  28. * NETON IS CALLED TO INITIATE THE NAM CONNECTION.
  29. * IF THE NETON WAS SUCCESSFUL, THEN THE ACNST IS
  30. * INITIALIZED.
  31. #
  32.  
  33. #
  34. **** PROC IPPBEGN - XREF LIST
  35. #
  36. XREF
  37. BEGIN
  38. FUNC IPUGHBN B; # GET HOST BY NAME #
  39. PROC IPUMCLR; # CLEAR MEMORY #
  40. PROC MACHID; # -MACREL- TO GET MACHINE ID #
  41. PROC NETON; # CONNECT APPLICATION TO NETWORK #
  42. PROC NETREL; # RELEASE LOG FILE #
  43. END
  44. #
  45. **
  46. #
  47. ITEM APPNAME C(10); # NETON APPLICATION NAME #
  48. ITEM MESSCOUNT I; # NAM MESSGE COUNT FOR LOGGING #
  49. ITEM HOSTUN C(10); # TCPHOST USERNAME #
  50. ITEM COMPSTATUS S:NETON$STATUS; # STATUS RETURNED FROM *NETON* #
  51.  
  52. ITEM ACNENTRY I; # ACN LOOP COUNTER #
  53. ITEM HOSTNAME C(30); # LOCAL HOST NAME #
  54. CONTROL EJECT;
  55.  
  56. #
  57. **** START MAIN PROCEDURE
  58. #
  59.  
  60. IPMC = MESSCOUNT;
  61. IPHOSTUN = HOSTUN;
  62. NDLFILE = NLFILE;
  63. DFLAG = FALSE; # DEBUG FLAG #
  64.  
  65. MACHID (TGW$GWNAME); # SETUP TCP GATEWAY NAME #
  66. TGW$BASENAME [0] = BASENAME$;
  67. C<0,1>TGW$MID [0] = "H";
  68.  
  69. #
  70. **** SEARCH TCPHOST FILE FOR THE LOCAL HOST IP ADDRESS.
  71. #
  72.  
  73. C<0,30>HOSTNAME = HOSTNAME$;
  74. C<10,2>HOSTNAME = C<1,2>TGW$MID [0];
  75. IF NOT IPUGHBN (HOSTNAME, HST$ADDR, IPHOSTUN)
  76. THEN
  77. BEGIN # HOST FILE NOT FOUND #
  78. COMPSTATUS = NETON$STATUS"HSTNOTFOUND";
  79. RETURN;
  80. END
  81.  
  82. IF IPMC NQ 0
  83. THEN
  84. NETREL (NDLFILE, 0, 0); # INITIALIZE *ZZZZZDN* FILE #
  85.  
  86. NETON (APPNAME, NSUP, COMPSTATUS, MINACN$, MAXACN$);
  87.  
  88. #
  89. **** INITIALIZE THE ACN SOCKET TABLE IF NETTED ON
  90. #
  91. IF COMPSTATUS EQ S"SUCCESS"
  92. THEN
  93. BEGIN # NAM AVAILABLE #
  94. IPUMCLR (LOC (ACN$ST), MAXACN$ * ACNSIZE$);# CLEAR ACN TABLES #
  95.  
  96. #
  97. **** INITIALIZE FIXED FIELDS IN THE OUTPUT DATA ABH.
  98. #
  99.  
  100. P<ABH> = LOC(DABH); # OUTPUT DATA BLOCK ABH #
  101. ABHWORD [0] = 0; # CLEAR WHOLE ABH WORD #
  102. ABHABT [0] = APPQMSG; # BLOCK TYPE IS *MSG* #
  103. ABHACT [0] = CT8ASCII; # CHARACTER TYPE IS 8-BIT ASCII #
  104.  
  105. #
  106. **** INITIALIZE FIXED FIELDS IN THE OUTPUT SUPERVISORY MESSAGE ABH.
  107. #
  108.  
  109. P<ABH> = LOC(SABH); # OUTPUT SUPERVISORY MSG ABH #
  110. ABHWORD [0] = 0; # CLEAR WHOLE ABH WORD #
  111. ABHABT [0] = APPCMD; # BLOCK TYPE IS *CMD* #
  112. ABHACT [0] = CT60TRANS; # CHARACTER TYPE IS 60-BIT XPT #
  113.  
  114. UDP$VERSION [0] = UDPVERS$; # INITIALIZE UDP CALL HEADER #
  115. UDP$NOTUSED [0] = 0; # CLEAR UNUSED BYTE #
  116.  
  117. NUMACN = 0; # OUTSTANDING CONNECTIONS #
  118.  
  119. END # NAM AVAILABLE #
  120.  
  121. RETURN; # RETURN TO CALLER #
  122.  
  123. END # IPPBEGN #
  124.  
  125. TERM
cdc/nos2.source/nam5871/ippbegn.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator