# DIGITAL TCP/IP Services for OpenVMS
Management

Previous | Contents

The errors indicate data corruptions caused either by a hardware problem or software problem or because the system was shut down abruptly while the NFS file system was active. If you believe the problem was due to a software problem, contact your DIGITAL support representative. If a directory is corrupted and cannot be repaired, all the files and directories under it are moved to the lost and found directory.

> %UCX-E-ANA_DIR_BADALLOCERR, Problem: Directory cell group cell_pointer allocation error: duplication of out of container file size Solution: Will be cleared

Explanation: The directory claims ownership of space already allocated to other files, or the space is out of the file system limits.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADCGSIZE, Problem: Bad directory cell_pointer cell group size: bad_value Solution: Replace by initial directory size: good_value

Explanation: The size field of the directory cell group does not describe correctly the size of the cell group.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADCGTYPE, Problem: Bad directory cell group cell_pointer type: bad_type Solution: Will be replaced by the correct type: good_type

Explanation: The type field of the directory cell group does not identify itself as a directory.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADCHKSUM, Problem: Directory cell_pointer has mismatched cell group checkbyte: chksum1 <> chksum2 Solution: Will set checkbytes to same value

Explanation: The front checkbyte of the directory cell group does not match its rear checkbyte byte. The directory may contain corrupted data.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADDIRSIZE, Problem: Directory inode inode_number contains bad file size: bad_value bytes Solution: Replace by the correct size: good_value

Explanation: The directory's inode contains the wrong size for the directory in the container file.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADDOTLEN, Problem: Bad <. or ..> entry length: bad_value (cg: cell_group_number) Solution: Replace by correct length: good_value

Explanation: The "." or ".." entry contains the wrong total entry length.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADDOTNAM, Problem: Directory cell_pointer has bad <. or ..> entry name Solution: Replace by <. or ..>

Explanation: The directory entry should have "." or ".." as the file name.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADDOTNAMLEN, Problem: Bad <. or ..> entry name length: bad_value (cg: cell_group_number) Solution: Replace by correct length: good_value

Explanation: The directory's "." or ".." entry has wrong file name length (different to 1 or 2).
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADDOTNUM, Problem: Bad <. or ..> entry inode number: bad_inode_number (cg: cell_group_number) Solution: Replace by correct inode number: good_inode_number

Explanation: The "." or ".." entry contains an inode number that does not correspond to the inode number of the directories "." or "..".
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADENTNAME, Problem: Bad directory cell_pointer entry name: up to 10 chars Solution: Will be cleared

Explanation: The directory entry contains an invalid file name string (up to 10 characters of the file name are printed).
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADENTNAMLEN, Problem: Bad directory cell_pointer entry name length: bad_value Solution: Will be replaced by the correct length: good_value

Explanation: The directory entry contains an invalid file name length.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX$-E-ANA_DIR_BADENTRYLEN, Problem: Bad directory cell_group_number entry length: bad_value Solution: Will be replaced by the correct length: good_value

Explanation: The directory entry contains invalid total entry length.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADHIERARCHY, Problem: Directory hierarchy corrupted: multiple directory tree found! Solution: Will place files not connected to root in lost and found directory

Explanation: The directory hierarchy does not form a unique tree structure. The hierarchy is broken into disconnected trees. Some files or directories lost the link with their parent directories.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADMAXERROS, Problem: Bad directory (cg: cell_group_number); cannot be recovered Solution: Will be deleted. All its files will be moved to lost and found

Explanation: The directory is completely corrupted and cannot be repaired. All the files and directories under this directory are moved to the lost and found directory.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADPNORAWSIZE, Problem: Raw data inode has bad file size: bad_value bytes Solution: Replace by correct size: good_value

Explanation: The raw data's inode contains the wrong size for the raw data file.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADRAWCG, Problem: Bad raw data file cell_group_pointer (cannot be corrected) Solution: Will be deleted

Explanation: The raw data file is completely corrupted and cannot be repaired.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADRAWCHKSUM, Problem: Raw data cell_group_pointer has mismatched cell group checkbyte: chksum1 <> chksum2 Solution: Will set checkbytes to same value

Explanation: The front checkbyte of the raw data cell group does not match its rear checkbyte byte. The raw data file may contain corrupted data.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADRAWSIZE, Problem: Raw data cell group cell_group_pointer has bad size: bad_value Solution: Replace by correct size: good_value

Explanation: The size field of the raw data cell group does not correctly describe the size of the cell group.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADRAWTYPE, Problem: Raw data cell group cell_group_pointer has bad type: bad_type Solution: Will be replaced by correct type: good_type

Explanation: The type field of the raw data cell group does not identify itself as a raw data file.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_DIR_BADROOT, Problem: Root directory corrupted
> Solution: Will be recreated. Its files will be placed in lost and found

Explanation: The root directory is completely corrupted. A new root directory will be created, and all the files and directories under the old root directory are moved to the lost and found directory.
User Action: None.

# C.5 Bitmap and Deleted Cells Validation Messages

The following error messages are related to errors detected in directories and raw data cell groups (for use by DIGITAL only). All problems are corrected automatically, if the /REPAIR option is set, without user confirmation or action. The errors indicate data corruptions caused either by a hardware problem or software problem or the because system was shut down abruptly while the NFS file system was active. If you believe the problem was due to software problems, contact your DIGITAL support representative.

> %UCX-E-ANA_BMP_BADBITMAP, Problem: Bitmap allocation from cell cell_number to cell cell_number bad_value Solution: Will be re-allocated

Explanation: The bitmap file has wrong allocation information for the cell (the bitmap file indicates the cell has been allocated but it is actually free).
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADBCGSIZE, Problem: Bad bitmap cell group allocation: inode_number Solution: Will be rebuilt

Explanation: The bitmap cell group claims space already allocated to other files.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADBMPCGRPSIZE, Problem: Bad bitmap cell group (cg: cell_group_number) cell group size: bad_value Solution: Replace by correct value: good_value

Explanation: The size field of the bitmap cell group does not correctly describe the size of the cell group.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADBMPCGRPCHKSUM, Problem: Bitmap cell group (cg: cell_group_number) has mismatched cell group checkbyte: chksum1 <> chksum2 Solution: Will set checkbytes to same value

Explanation: The front checkbyte of the bitmap cell group does not match its rear checkbyte byte. The bitmap file may contain corrupted data.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADBMPCGRPTYPE, Problem: Bad bitmap cell group (cg: cell_group_number) cell group type: bad_type Solution: Replace by correct type: good_type

Explanation: The type field of the bitmap cell group does not identify itself as a bitmap.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADDCGRPCHKSUM, Problem: Deleted cell (cg: cell_group_number) has mismatched cell group checkbyte Solution: Will set checkbytes to same value

Explanation: The front checkbyte of the deleted cell group does not match its rear checkbyte byte.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADDCGRPS, Problem: Cells cell_number to cell_number should be deleted cells but have wrong attributes Solution: Will be corrected to be deleted cells

Explanation: The group of cells are allocated as deleted cells but do not have the correct attributes.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADDCGRPSIZE, Problem: Deleted cell (cg: cell_group_number) has bad cell group size: bad_value
> Solution: Replace by correct value: good_value

Explanation: The size field of the deleted cell group does not correctly describe the size of the cell group.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_BADDCGRPTYPE, Problem: Deleted cell (cg: cell_group_number) has bad cell group type: bad_type
> Solution: Replace by correct type: good_type

Explanation: The type field of the deleted cell group does not identify itself as a deleted cell.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-E-ANA_BMP_NEWBMP, New bitmap file created

Explanation: Due to problems detected in the bitmap file, a new bitmap file has been created.
User Action: None.

> %UCX-E-ANA_BMP_BADNULLMPTR, Problem: Unused bitmap file map pointer has bad value: bad_map_pointer Solution: Will be replaced by correct value: 00000000

Explanation: Unused map pointers in the bitmap inode contain values other than null.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

# C.6 Directory Hierarchy Reconstruction Messages

The following error messages are produced during the reconstruction of the directory hierarchy. All problems are corrected automatically, if the /REPAIR option is set, without user confirmation or action. The problem indicates data corruptions caused either by a hardware or software problem or because the system shut down abruptly while the NFS file system was active. If you believe the problem was due to software problems, contact your DIGITAL support representative.

> %UCX-I-ANA_FIN_BADNLINK, Problem: Bad inode inode_number link count: wrong_value Solution: Will be replaced by correct number: correct_value

Explanation: The inode contains the wrong number of links to this file.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-I-ANA_FIN_FORIEGN, Problem: Cannot delete bad directory: contains non-NFS files Solution: Directory will be removed from NFS file system but not deleted

Explanation: Non-NFS file system files have been placed in the NFS file system directory. As a result, the directory cannot be deleted.
User Action: Remove the non-NFS file system files from the NFS file system directories and run the ANALYZE CONTAINER command again.

> %UCX-I-ANA_FIN_NOBMP, Problem: Bitmap file entry is not found in the root directory Solution: Will add the bitmap file entry to the root directory

Explanation: The root directory does not have an entry for the bitmap file.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

> %UCX-I-ANA_FIN_NOSUPBLK, Problem: Super Block entry is not found in the root directory Solution: Will add the Super Block entry to the root directory

Explanation: The root directory does not have an entry for the super block file.
User Action: None. The error is repaired automatically if the /REPAIR option is set.

# Appendix D
Customized Security Driver: Template

This appendix provides a template for a custom security driver that:

- Implements site-specific security algorithms for Internet protocols
- Performs these security algorithms in conjuction with the UCX Internet driver
- Accommodates sites with non-public, non-sharable Internet security requirements.

# D.1 Implementation

The security algorithms are implemented by the user in security routines within this driver.

The Internet driver calls the security routines within this driver at different points during IP, UDP, and TCP protocol processing. The Internet driver can be enabled/disabled calling the security routines. Note that to reload the user-written security driver, the system must be rebooted.

The user-written code can be inserted in this module in the specially marked spaces, or it can reside in separate modules that are written by the user, if so desired. If the driver will contain more than this module, the user must insert in this module code to call the other modules' security routines. The user must link all modules together in one driver.

It is most likely that besides the code implementing the security algorithms, some auxiliary code will create and maintain data structures or tables that are used by the security algorithms. Therefore, this template driver contains sample code for two basic types of functions:

1. Creating and maintaining internal tables or data structures to be used in the user-written algorithms
2. Security algorithms

For the first type of function (creating and maintaining internal tables or data structures), this template driver provides the framework for using the IO$_SETMODE and IO$_SENSEMODE OpenVMS QIO functions, with additional granularity created by a set of subfunctions to:

- Create and delete tables
- Add, modify, delete, and show entries in the tables

The code in the template driver for this type of function is written as OpenVMS driver FDT routines. They are only a suggestion. The user can decide to use them or not.

For the second type of function (security algorithms), this skeleton driver provides the entry points and return for the security routines. There are four possible security routines, which are called by the Internet driver for each packet, as soon as the security driver's operation is enabled. Two of the four routines are called during IP protocol processing, while the other two are called during UDP or TCP protocol processing as follows:

IP_SECVEC$L_IP_INPUT | IP input
IP_SECVEC$L_IP_OUPUT | IP output
IP_SECVEC$L_UDP_TCP_INPUT | UDP or TCP input
IP_SECVEC$L_UDP_TCP_OUTPUT | UDP or TCP output

Because the Internet driver calls the security routines, once it is enabled for such an operation, you cannot add or remove any of the routines. At the most, if one of the routines is not needed, it just has to be left the way it is; it is coded in this skeleton driver to return with a success code without doing anything.

Each of the four security routines is given a list of input parameters, such as the IP, UDP, or TCP packet addresses. The routine checks and returns a success to the Internet driver if the checking has been successful, or it returns a failure code if the checking determined a security problem. In case of success, the Internet driver continues the processing. In case of failure, it drops the packet and increments a counter specific to the security routine. Security counters will be available on a per-protocol and socket basis.

All security routines:

- Must save and restore all used registers
- Must not alter the state of spinlocks, forklocks, or device locks

# D.2 Example Command File for Building the Security Driver

           $ !
     $ ! Assemble the UCX security driver
     $ !
     $! macro/lis ucx_security
     $ !
     $ ! Link the user written UCX security driver
     $ !
     $ driver n== "scdriver"
     $ LINK /EXE='driver' /SYSTEM=0 /HEADER -
      /MAP='driver'/FULL/CROSS -
      /SYMBOLS='driver' -
     ! ucx_security + ucx_security_c, -
      ucx_security, -
      SYS$SYSTEM:SYS.STB/SELECTIVE
     $exit

     .SBTTL Macro Declarations

     .LIBRARY /SYS$LIBRARY:LIB.MLB/

     EXTERNAL DEFINITIONS:

     $AQBDEF    ; AQB definitions
     $CRBDEF    ; DEFINE CRB
     $DCDEF    ; DEVICE CLASSES AND TYPES
     $DDBDEF    ; DEFINE DDB
     $DDTDEF    ; DEFINE DDT
     $DEVDEF    ; DEVICE CHARACTERISTICS
     $DYNDEF    ; Dynamic structure definitions
     $IDBDEF    ; DEFINE IDB OFFSETS
     $IODEF    ; I/O Function Codes
     $IRPDEF    ; IRP definitions
     $MSGDEF    ; Message types
     $ORBDEF    ; Define Object's Rights Block offsets
     $SSDEF    ; Return codes
     $TQEDEF    ; Time definitions
     $UCBDEF    ; DEFINE UCB
     $VECDEF    ; DEFINE VECTOR FOR CRB

     $SPLCODDEF

    .CROSS
     .SBTTL lOCAL VARIABLES
    ;
    INET$C_IPL = 8
    P1  = 0   ; QIO P1 parameter offset from AP
    P2  = 4   ; QIO P2 parameter offset from AP
    P3  = 8
    P4       = 12
    P5  = 16
    P6  = 20
    ;
    ; Security address vector offsets
    ;
    IP_SECVEC$L_IP_INPUT  = 0
    IP_SECVEC$L_IP_OUTPUT  = 4
    IP_SECVEC$L_UDP_TCP_INPUT = 8
    IP_SECVEC$L_UDP_TCP_OUTPUT = 12

     .SBTTL  DPTAB - Driver Prologue Table
    ;
    ; DRIVER PROLOGUE TABLE
    ;

      .PSECT $$$105_PROLOGUE
     DPTAB -    ; Define driver prologue table
      END = SC$_END,-  ; End of driver
      ADAPTER = NULL,-  ; Adapter type
      UCBSIZE = UCB$C_LENGTH,- ; UCB size
      NAME = SCDRIVER  ; Driver name

     DPT_STORE INIT    ; CONTROL BLOCK INIT VALUES
          ;
     DPT_STORE CRB,CRB$L_INTD+VEC$L_ADP,L,0 ; No ADP pointer
     DPT_STORE UCB,UCB$W_MB_SEED,W,0  ; Init. unit value for cloning
     DPT_STORE UCB,UCB$B_FLCK,B,SPL$C_IOLOCK8 ; Fork lock index
     DPT_STORE UCB,UCB$B_DIPL,B,INET$C_IPL  ; Device IPL
     DPT_STORE ORB,ORB$B_FLAGS,B,-
        <ORB$M_PROT_16> ; SOGW protection word
     DPT_STORE ORB,ORB$W_PROT,W,0  ; Default protection
     DPT_STORE ORB,ORB$L_OWNER,L,<^X010001> ; Owner UIC
     DPT_STORE UCB,UCB$L_DEVCHAR,L,-  ; Device characteristics
        <DEV$M_AVL!- ;   Available
         DEV$M_MBX!- ;   Mailbox type (no hardware)
         DEV$M_IDV!- ;   Input device
          DEV$M_ODV-  ;   Output device
        >  ;

     DPT_STORE UCB,UCB$W_DEVBUFSIZ,W,256 ;
     DPT_STORE UCB,UCB$W_STS,W,-  ;
        <UCB$M_ONLINE!- ; Device online
         UCB$M_TEMPLATE-; SC0 is the "template" UCB
        >  ;
          ;
     DPT_STORE REINIT   ; CONTROL BLOCK RE-INIT VALUES

     DPT_STORE DDB,DDB$L_DDT,D,SC$DDT
     DPT_STORE CRB,CRB$L_INTD+VEC$L_INITIAL, D, SC$CTRL_INIT
     DPT_STORE CRB,CRB$L_INTD+VEC$L_START, D, SC$_VECTOR
     DPT_STORE END    ;

    ;
    ; DRIVER DISPATCH TABLE
    ;
     .PSECT $$$115_DRIVER,LONG

     DDTAB DEVNAM = SC,-  ; DRIVER DISPATCH TABLE
      FUNCTB = FUNCTABLE ; Function decision table address

     .SBTTL FUNCTION DECISION TABLE

    FUNCTABLE:    ; FUNCTION DECISION TABLE
     FUNCTAB ,-   ; Legal Functions
       SETMODE,-  ; Set mode
       SETCHAR,-  ; Set characteristics
       SENSEMODE,-  ; Sense mode
       SENSECHAR,-  ; Sense characteristics
     >
     FUNCTAB ,-   ; BUFFERED I/O FUNCTIONS
       SETMODE,-  ; Set mode
       SETCHAR,-  ; Set characteristics
       SENSEMODE,-  ; Sense mode
       SENSECHAR,-  ; Sense characteristics
     >
     FUNCTAB SC$FDT_SETMODE, <SETMODE>    ; Set device mode
     FUNCTAB SC$FDT_SETCHAR, <SETCHAR>    ; Set device characteristics
     FUNCTAB SC$FDT_SENSEMODE, <SENSEMODE>; Sense device characetristics
     FUNCTAB SC$FDT_SENSECHAR, <SENSECHAR>; Sense device characetristics

    ;
    ; LOCAL STORAGE
    ;
     .ALIGN LONG

    ;+

    ;
    ; Security device specific dispatch table
    ;-
    SC$_VECTOR::
    ;
     .ADDRESS 0 ; ip input
     .ADDRESS 0 ; ip output
     .ADDRESS 0 ; udp/tcp input
     .ADDRESS 0 ; udp/tcp output

     .SBTTL SC$CTRL_INIT - Initialize pseudo device
    ;++
    ; SC$CTRL_INIT - INITIALIZE INTERFACE
    ;
    ; FUNCTIONAL DESCRIPTION:
    ;
    ; This routine is entered at driver load (device CONNECT time)
    ; and power recovery.
    ;
    ; All we do is build the address vector.
    ;
    ; INPUTS:
    ;
    ; R4 = Address of the unit CSR
    ; R5 = IDB of unit
    ; R6 = address of DDB associated with the controller
    ; R8 = Address of the unit CRB
    ;
    ; OUTPUTS:
    ;
    ; R0, R1, R2, R3 are destroyed.
    ;
    ; IMPLICIT INPUTS:
    ;
    ; IPL = IPL$_POWER
    ;

    ;--
    SC$CTRL_INIT::

     MOVL DDB$L_UCB(R6),R5 ;
     MOVAB SC$_VECTOR, R0  ; vector address
    ;
     MOVAB SC$_IP_INPUT, IP_SECVEC$L_IP_INPUT(R0) ;
     MOVAB SC$_IP_output, IP_SECVEC$L_IP_OUTPUT(R0);
    ;
     MOVAB SC$_UDP_TCP_INPUT, IP_SECVEC$L_UDP_TCP_INPUT(R0) ;
     MOVAB SC$_UDP_TCP_OUTPUT, IP_SECVEC$L_UDP_TCP_OUTPUT(R0);

     MOVZBL #SS$_NORMAL, R0 ;
     RSB

     .dsabl lsb

     .SBTTL FDT routines
     .ENABL LSB
    ;
    ; Define security driver I/O subfunctions, that are passed as P3
    ; in IO$_SETMODE or IO$_SENSEMODE QIO's
    ;
    SC$C_CREATE_TABLE = 1
    SC$C_DELETE_TABLE = 2
    SC$C_SHOW_TABLE = 3
    ;
    SC$C_ADD_ENTRY = 10
    SC$C_DELETE_ENTRY = 11
    SC$C_SHOW_ENTRY = 12
    SC$C_MODIFY_ENTRY = 13
    ;
    ;
     .sbttl SC$FDT_SETMODE
     .sbttl SC$FDT_SETCHAR

    ;+
    ;SC$FDT_SETMODE  ; Set device mode
    ;SC$FDT_SETCHAR  ; Set device characteristics
    ;
    ;
    ; The following parameters can be specified with the I/O functions:
    ;
    ;  INPUTS: AP Pointer to the QIO P1....P6 parameters
    ;
    ; P1 = address of buffer
    ; P2 = length of buffer
    ; P3 = subfunction code - defined above
    ;
    ;  IPL ASTDEL
    ;
    ;  R11-R9 Scratch
    ;  R8 Must be saved/restored if return to Exec for next
    ;   FDT routine
    ;  R7 I/O function code without modifiers
    ;  R6 CCB address
    ;  R5 UCB address
    ;  R4 PCB address
    ;  R3 IRP address
    ;  R2-R0 Scratch
    ;
    ;  OUTPUTS: R5,R3 Preserved
    ;  R1  Device dependent information
    ;  All other regs are clobbered.
    ;
    ; IPL: IPL$_ASTDEL = 2
    ;
    ;  Warning: creating, deleting, modifying, showing tables
    ;  should be done at IPL 8 (the IPL of the security device)
    ;
    ;  The following steps have to be followed:
    ;
    ;  1. validate P1 and P2, and then check the access to the
    ;   user buffer - read or write depending on the
    ;   operation.
    ;
    ;  2. data transfer from user space to system space
    ;   - create, add, modify -
    ;   should be done as follows:
    ;      - allocate a temporary buffer
    ;      - move data from user space to the temporary buffer
    ;      - raise IPL to 8 (in SMP get the IPL 8 lock)
    ;      - transfer data from the temporary buffer to the
    ;   driver table.
    ;      - lower IPL to 2
    ;      - exit
    ;  3. data transfer from system space to user space
    ;   - show -
    ;   should be done as follows:
    ;      - allocate a temporary buffer
    ;      - raise IPL to 8 (for SMP get lock)
    ;      - move data from system space to the temporary buffer
    ;      - lower IPL to 2 (in SMP release the lock)
    ;      - transfer data from the temporary buffer to the
    ;   user space
    ;      - exit

    ;-

     .ENABL LSB

    SC$FDT_SETMODE::  ; Set device mode
    SC$FDT_SETCHAR::  ; Set device characteristics
        ;

     CMPL UCB$L_PID(R5), IRP$L_PID(R3) ; Same PID
     BEQLU 1020$    ; if EQLU yes

    SC_SETMODE_ACCVIO:
     MOVZWL #SS$_ACCVIO,R0  ; If all parameters are null return BADPARAM
     BRW SC_SETMODE_ERROR ; Access violation
    1020$:
    ;
     MOVZWL #SS$_BADPARAM,R0 ; If all parameters are null return BADPARAM
     MOVL P3(AP),R1  ; Is there a P3 - subfunction
     BEQL SC_SETMODE_BADPAR ; If EQL no
     CMPL SC$C_CREATE_TABLE, R1 ;
     BEQLU SC_CREATE_TABLE  ;
     CMPL SC$C_DELETE_TABLE, R1 ;
     BEQLU SC_DELETE_TABLE  ;
    ;
     CMPL SC$C_ADD_ENTRY , R1 ;
     BEQLU SC_ADD_ENTRY  ;
     CMPL SC$C_DELETE_ENTRY , R1 ;
     BEQLU SC_DELETE_ENTRY  ;
     CMPL SC$C_MODIFY_ENTRY , R1 ;
     BEQLU SC_MODIFY_ENTRY  ;

    SC_SETMODE_BADPAR:
     MOVZWL #SS$_BADPARAM,R0 ;
    SC_SETMODE_ERROR:
     JMP G^EXE$ABORTIO  ;

    SC_CREATE_TABLE:
    SC_DELETE_TABLE:
     LOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      LOCKIPL=#inet$c_ipl,- ;
      SAVIPL=-(SP),-  ;
      PRESERVE=NO  ;

    ;
    ;
    ; Add your code
    ;

     UNLOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      NEWIPL=(SP)+,-  ;
      CONDITION=RESTORE,- ;
      PRESERVE = YES

     BRB  SC_SETMODE_END

    SC_ADD_ENTRY:
    SC_DELETE_ENTRY:
    SC_MODIFY_ENTRY:
     LOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      LOCKIPL=#inet$c_ipl,- ;
      SAVIPL=-(SP),-  ;
      PRESERVE=NO  ;

    ;
    ;
    ; Add your code
    ;
    ;

     UNLOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      NEWIPL=(SP)+,-  ;
      CONDITION=RESTORE,- ;
      PRESERVE = YES  ;

    SC_SETMODE_END:

     MOVZBL #SS$_NORMAL,R0  ; Status

    SC_SETMODE_END_1:
     JMP G^EXE$QIORETURN

     .dsabl lsb

     .sbttl SC$FDT_SENSEMODE
     .sbttl SC$FDT_SENSECHAR

    ;+
    ;SC$FDT_SENSEMODE  ; SENSE device mode
    ;SC$FDT_SENSECHAR  ; SENSE device characteristics
    ;
    ;
    ; The following parameters can be specified with the I/O functions:
    ;
    ;  INPUTS: AP Pointer to the QIO P1....P6 parameters
    ;
    ; P1 = address of buffer
    ; P2 = length of buffer
    ; P3 = subfunction code
    ;
    ;  IPL ASTDEL
    ;
    ;  R11-R9 Scratch
    ;  R8 Must be saved/restored if return to Exec for next
    ;   FDT routine
    ;  R7 I/O function code without modifiers
    ;  R6 CCB address
    ;  R5 UCB address
    ;  R4 PCB address
    ;  R3 IRP address
    ;  R2-R0 Scratch

    ;
    ;  OUTPUTS: R5,R3 Preserved
    ;  R1  Device dependent information
    ;  All other regs are clobbered.
    ;-

     .ENABL LSB

    SC$FDT_SENSEMODE::  ; SENSE device mode
    SC$FDT_SENSECHAR::  ; SENSE device characteristics
        ;
     CMPL UCB$L_PID(R5), IRP$L_PID(R3); Same PID
     BEQLU 1020$   ; if EQLU yes
     BRW SC_SETMODE_ACCVIO ; Access violation
    1020$:
    ;
     MOVZWL #SS$_BADPARAM,R0 ; If all parameters are null return BADPARAM
     MOVL P3(AP),R1  ; Is there a P3 - subfunction
     BEQL 1100$   ; If EQL no
     CMPL SC$C_SHOW_TABLE, R1 ;
     BEQLU SC_SHOW_TABLE  ;
     CMPL SC$C_SHOW_ENTRY, R1 ;
     BEQLU SC_SHOW_ENTRY  ;
    1100$:
     BRW SC_SETMODE_BADPAR ;

    SC_SHOW_TABLE:
     LOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      LOCKIPL=#inet$c_ipl,- ;
      SAVIPL=-(SP),-  ;
      PRESERVE=NO  ;
    ;
    ;
    ; Add your code
    ;
    ;

     UNLOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      NEWIPL=(SP)+,-  ;
      CONDITION=RESTORE,- ;
      PRESERVE = YES
     MOVZBL #SS$_NORMAL,R0  ; Status
     JMP G^EXE$QIORETURN

    SC_SHOW_ENTRY:
     LOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      LOCKIPL=#inet$c_ipl,- ;
      SAVIPL=-(SP),-  ;
      PRESERVE=NO

    ;
    ;
    ; Add your code
    ;
    ;                                                   =

     UNLOCK LOCKNAME=IOLOCK8,- ; SYNCHRONIZE ipl
      NEWIPL=(SP)+,-  ;
      CONDITION=RESTORE,- ;
      PRESERVE = YES

     MOVZBL #SS$_NORMAL,R0  ; Status
     JMP G^EXE$QIORETURN

     .SBTTL SC_SECURITY_ROUTINES

    ;+
    ; Called from INTERnet driver
    ;
    ; All registers used in these routines must be saved and
    ; restored before return to the INTERnet driver
    ;
    ; If the 'user written security driver checking succedes,
    ; return SS$_NORMAL in R0.
    ; If the checking fails return SS$_ABORT in R0.
    ; The INTERnet driver will drop the packet.
    ;
    ; IPL = 8.
    ;
    ; The IPL should not change during these routines
    ; processing. Also the routines should not touch
    ; any spinlocks, fork locks or device locks.
    ;-

     .SBTTL IP_INPUT_SECURITY_ROUTINE
     .enabl lsb

    ;+ SC$_IP_INPUT
    ; Input parameters:
    ;
    ;  - r4 - address of IP header
    ;  - r6 - address of IP datagram header mbuf
    ;  - r8 - INTERnet interface address
    ;-

    SC$_IP_INPUT::

    ;
    ;
    ; Add your code and comment out the line:
    ;
    ; MOVZWL #SS$_NORMAL, R0 ;
    ;
    ;

     MOVZWL #SS$_NORMAL, R0 ;
     RSB
     .dsabl lsb
     .SBTTL IP_OUTPUT_SECURITY_ROUTINE
     .enabl lsb
    ;+ SC$_IP_OUTPUT
    ; Input parameters:
    ;
    ;  - r4 - address of IP header
    ;  - r6 - address of IP datagram header mbuf
    ;  - r8 - interface address
    ;  - r11 - address of socket address structure
    ;-

    SC$_IP_OUTPUT::
    ;                                                   =
    ;
    ; Add your code and comment out the line:
    ;
    ; MOVZWL #SS$_NORMAL, R0 ;
    ;
    ;                                                   =
     MOVZWL #SS$_NORMAL, R0 ;
     RSB
     .dsabl lsb
     .SBTTL UDP_TCP_INPUT_SECURITY_ROUTINE
     .enabl lsb
    ;+ SC$_UDP_TCP_INPUT
    ; Input parameters:
    ;
    ;  - r2 - protocol number
    ;  - r3 - address of IP datagram header mbuf
    ;  - r4 - address of IP header
    ;  - r5 - address of UDP or TCP header
    ;  - r6 - address of UCB
    ;
    ;-

    SC$_UDP_TCP_INPUT::
    ;                                                            =
    ;
    ; Add your code and comment out the line:
    ;
    ; MOVZWL #SS$_NORMAL, R0 ;
    ;
    ;
     MOVZWL #SS$_NORMAL, R0 ;
     RSB
     .dsabl lsb

     .SBTTL UDP_TCP_OUTPUT_SECURITY_ROUTINE

     .enabl lsb

    ;+ SC$_UDP_TCP_OUTPUT
    ; Input parameters:
    ;
    ;  - r2 - protocol number
    ;  - r3 - address of IP datagram header mbuf
    ;  - r4 - address of IP header
    ;  - r5 - address of UDP or TCP header
    ;  - r6 - address of UCB
    ;  - r8 - INTERnet interface address
    ;
    ;-

    SC$_UDP_TCP_OUTPUT::
    ;                                                   =
    ;
    ; Add your code and comment out the line:
    ;
    ; MOVZWL #SS$_NORMAL, R0 ;
    ;
    ;                                                   =
     MOVZWL #SS$_NORMAL, R0 ;
     RSB    ; Done
     .dsabl lsb
     .PSECT $$$116_DRIVER,LONG
    SC$_END::    ; End of driver

     .End

# Appendix E
EBCDIC/DMCS Translation Tables

The UCX TELNET implementation supports IBM 3270 terminal emulation. The default translation tables for DIGITAL/IBM-terminal compatibility satisfy most user needs.

Previous | Next | Contents