*DECK NETFUNC
USETEXT AIPDEF
USETEXT NP$GMB
USETEXT NP$MODE
USETEXT NP$NWL
USETEXT NP$STAT
PROC NETFUNC(FCODE,WSA);
BEGIN
#
*1DC NETFUNC
*
* 1. PROC NAME AUTHOR DATE
* NETFUNC E. GEE 01/30/85
*
* 2. FUNCTIONAL DESCRIPTION.
* THIS ROUTINE PROCESSES AIP FUNCTION CODES. CURRENTLY THE
* FOLLOWING FUNCTION CODES HAVE BEEN DEFINED.
*
* FCODE=1 SEND NETWAIT WORKLIST TO NIP EVEN IF DATA IS QUEUED
* IN NIP AS LONG AS THAT DATA IS NOT DELIVERABLE THROUGH
* LIST PROCESSING.
* FCODE=2 QUEUE MULTIPLE UPLINE MESSAGES WITHIN AIP-S FIELD
* LENGTH TO INCREASE THE THROUGHPUT FOR RECEIVING SMALL
* MESSAGES.
* FCODE=3 DO NOT ABORT APPLICATION PROGRAM AFTER A WORKLIST
* TRANSFER IS ATTEMPTED AND NAM IS NOT AVAILABLE.
* FCODE=4 QUEUE DOWNLINE MESSAGES IN AN APPLICATION-SUPPLIED
* BUFFER TO INCREASE THE THROUGHPUT FOR SENDING
* MULTIPLE LARGE MESSAGES TO NIP.
*
* 3. METHOD USED.
* IF VALID FUNCTION CODE,
* INDEX ACCORDING TO THE FUNCTION CODE SPECIFIED.
* FC=1 SET ISSUE-NETWAIT-IF-NO-DELIVERABLE-DATA FLAG.
* FC=2 SET MULTIPLE-MESSAGE-UPLINE-QUEUING FLAG.
* FC=3 SET NO-ABORT-IF-NAM-NOT-AVAILABLE FLAG.
* FC=4 SET MULTIPLE-MESSAGE-DOWNLINE-QUEUING FLAG.
* ELSE (BAD FUNCTION CODE WAS SPECIFIED),
* CALL NP$ERR TO ISSUE DAYFILE MSG AND ABORT APP.
*
* 4. ENTRY CONDITIONS.
* FCODE FUNCTION CODE TO PROCESS
* WSA ADDR OF BUFFER IF ONE IS NEEDED FOR
* PROCESSING THE FUNCTION CODE.
* FC=1 NOT USED.
* FC=2 ADDR OF BUF TO HOLD UPLINE DATA
* MESSAGES.
* FC=3 NOT USED.
* FC=4 ADDR OF BUF TO HOLD DOWNLINE DATA
* MESSAGES.
*
* 5. EXIT CONDITIONS.
* DOWNUSE UPDATED IF FC = 4.
* GMBUSE UPDATED IF FC = 2.
* WAITDEL UPDATED IF FC = 1.
*
* 6. COMDECKS AND SYMPL TEXT USED.
* AIPDEF CONSTANT DEFINITIONS
* NP$GMB UPLINE DATA BUFFER TEMPLATE
* NP$MODE GLOBAL VARIABLES
* NP$NWL NETWORK WORKLIST TABLE
* NP$STAT STATISTICS TABLE
*
* 7. PROCEDURES/FUNCTIONS CALLED.
* NP$ERR ISSUE ERROR MESSAGE AND ABORT APP
* NP$SEND SEND A WORKLIST TO NIP
* NP$SN INCREMENT AIP STATISTICS
* NP$USI UPDATE S AND I BITS IN NSUP WORD
*
* 8. DAYFILE MESSAGES OR OTHER IMPORTANT INFORMATION.
* * NETWORK APPLICATION ABORTED, RC = XX. *
* * NETFUNC: REQUEST INVALID BEFORE NETON. * (RC=29)
* * NETFUNC: INVALID FUNCTION CODE USED. * (RC=52)
* * NETFUNC: DOWNLINE BUFFERING ALREADY ON. * (RC=59)
* * NETFUNC: DOWNLINE BUFFER SIZE TOO SMALL. * (RC=60)
* * NETFUNC: DOWNLINE BUFFERING ALREADY OFF. * (RC=61)
#
#
EXTERNAL ROUTINES CALLED
#
XREF
BEGIN
PROC NP$ERR; # ISSUE ERROR MESSAGE AND ABORT APP #
PROC NP$SEND; # SEND A WORKLIST TO NIP #
PROC NP$SN; # INCREMENT AIP STATISTICS #
PROC NP$USI; # UPDATE S AND I BITS IN NSUP #
END
#
INPUT VARIABLES
#
ITEM FCODE; # AIP FUNCTION CODE #
ITEM WSA; # ADDRESS OF BUFFER TO HOLD UPLINE DATA #
#
LOCAL VARIABLES
#
DEF MINFC#1#; # MINIMUM FUNCTION CODE VALUE #
DEF MAXFC#4#; # MAXIMUM FUNCTION CODE VALUE #
SWITCH SWTCH$FC ,FC$1,FC$2,FC$3,FC$4;
#**********************************************************************#
CONTROL EJECT;
#
EXECUTABLE CODE BEGINS HERE
#
IF NOT ACCEPTED
THEN # APPLICATION HAS NOT NETTED ON #
BEGIN
NP$ERR("29"); # ISSUE DAYFILE MSG AND ABORT AP#
END
*IF,DEF,STAT
NP$SN(TYPE"FUNC"); # INCREMENT AIP STATISTICS #
*ENDIF
IF (FCODE GQ MINFC) AND
(FCODE LQ MAXFC)
THEN # VALID FUNCTION CODE #
BEGIN
GOTO SWTCH$FC[FCODE];
FC$1: # ISSUE NETWAIT WORKLIST EVEN IF DATA IS #
BEGIN # AVAILABLE AS LONG AS DATA IS NOT #
# DELIVERABLE THROUGH LIST PROCESSING #
WAITDEL = TRUE; # SET ISSUE-NETWAIT-IF-NO-DELIVERABLE DATA#
# FLAG #
GOTO FC$END;
END
FC$2: # QUEUE MULTIPLE UPLINE MESSAGES IN AIP #
BEGIN # FOR EITHER THE SAME CONNECTION NUMBER #
# OR SAME LIST NUMBER #
P<GMB> = LOC(WSA); # ADDRESS OF UPLINE DATA BUFFER #
IF GMBFLG[0]
THEN # TURN UPLINE DATA QUEUE PROCESSING ON #
BEGIN
*IF,DEF,STAT
NP$SN(TYPE"GMR"); # INCREMENT AIP STATISTICS #
*ENDIF
GMBHEAD = 1; # INITIALIZE UPLINE DATA BUFFER PTRS #
GMBFOOT = 1; # INITIALIZE UPLINE DATA BUFFER PTRS #
GMBUSE= TRUE; # SET FLAG FOR UPLINE QUEUE PROCESSING #
GMBLN = GMBALN[0]; # SAVE LIST NUMBER FOR AIP DATA BUFFER #
GMBCN = GMBACN[0]; # SAVE CON NUMBER FOR AIP DATA BUFFER #
GMBLAST = GMBSIZE[0]; #INDEX FOR LAST WORD OF AIP DATA BUF#
GMMESIZE = GMMSIZE; # SIZE OF GMM WORKLIST ENTRY #
END
ELSE # TURN UPLINE DATA QUEUE PROCESSING OFF #
BEGIN
GMBHEAD = 1; # INITIALIZE UPLINE DATA BUFFER PTRS #
GMBFOOT = 1; # INITIALIZE UPLINE DATA BUFFER PTRS #
GMBUSE= FALSE; # CLEAR FLAG FOR UPLINE QUEUE PROCESSING #
END
GOTO FC$END;
END
FC$3: # DO NOT ABORT APPLICATION PROGRAM IF NAM #
BEGIN # IS NOT AVAILABLE #
NOABTAPP = TRUE; # SET NO-ABORT-IF-NAM-NOT-AVAILABLE FLAG #
GOTO FC$END;
END
FC$4: # QUEUE DOWNLINE MESSAGES IN APPL-SUPPLIED#
# BUFFER #
BEGIN
P<APPBUFHDR> = LOC(WSA); # GET BUFFER HEADER #
IF AB$FLAG[0]
THEN # TURN DOWNLINE BUFFERING ON #
BEGIN
IF DOWNUSE
THEN # DOWNLINE FEATURE ALREADY ON #
BEGIN
NP$ERR("59"); # ISSUE DAYFILE MSG AND ABORT AP#
END
IF AB$SIZE[0] LS MINABSIZE
THEN # BUFFER SIZE IS TOO SMALL #
BEGIN
NP$ERR("60"); # ISSUE DAYFILE MSG AND ABORT AP#
END
NP$SEND; # SEND EXISTING WORKLIST TO NIP #
LOC$APBUF = LOC(WSA) + 1; # START OF TEXT AREA OF APP BUF #
P<WORKLIST> = LOC$APBUF; # USE APP BUF FOR THE WORKLIST #
NEXT = 0; # START OF APP BUFFER #
SPACE$LEFT = AB$SIZE[0]; # SPACE LEFT IN APP BUFFER #
DOWNUSE = TRUE; # SET FLAG FOR DWNLIN MSG QUEUE #
END
ELSE # TURN DOWNLINE BUFFERING OFF #
BEGIN
IF NOT DOWNUSE
THEN # DOWNLINE FEATURE ALREADY OFF #
BEGIN
NP$ERR("61"); # ISSUE DAYFILE MSG AND ABORT AP#
END
NP$SEND; # CLEAR BUFFER BY SENDING TO NIP#
# POINT WORKLIST B-ARRAY BACK TO#
# FIXED BUFFER IN AIP'S FL #
P<WORKLIST> = LOC(NWLBUF);
NEXT = NHDR + 1; # RESET WORKLIST POINTERS #
SPACE$LEFT = LWL;
DOWNUSE = FALSE; # CLEAR FLAG FOR DWNLIN FEATURE #
END
NP$USI; # SET S, I BITS IN NSUP AFTER #
# CALL TO NP$SEND #
GOTO FC$END;
END
FC$END:
END
ELSE # BAD FUNCTION CODE SPECIFIED #
BEGIN
NP$ERR("52");
END
RETURN;
END
TERM