Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Info |  Source |  Entry Points |  Interaction Calls
Print Page as PDF
Routine: XLFIPV

Package: Kernel

Routine: XLFIPV


Information

XLFIPV ;ISD/HGW - IPv4 and IPv6 Utilities ; 8/19/20 10:57am

Source Information

Source file <XLFIPV.m>

Entry Points

Name Comments DBIA/ICR reference
VALIDATE(IP) ; EXTRINSIC. ICR #5844 (supported)
; Validate the format of an IP address (either IPv4 or IPv6).
; Usage: S Y=$$VALIDATE^XLFIPV(IP)
; Input: IP (string) - IPv4 or IPv6 Address to be validated.
; Output: returns:
; 1 - if the IP address is in a valid format.
; 0 - if the format is invalid or null input.
  • ICR #5844
    • Status: Active
    • Usage: Supported
    FORCEIP4(IP) ; EXTRINSIC. ICR #5844 (supported)
    ; Convert an IP address (either IPv4 or IPv6) into an IPv4 address in a standardized format: "127.0.0.1".
    ; Usage: S Y=$$FORCEIP4^XLFIPV(IP)
    ; Input: IP (string) IPv4 or IPv6 Address to be converted.
    ; Output: returns: An IPv4 address in "ddd.ddd.ddd.ddd" notation if the input address is valid and has an
    ; IPv4 equivalent, or the null address "0.0.0.0" if the input address is invalid, or the null address
    ; "0.0.0.0" if an IPv6 address is input which does not have an IPv4 equivalent.
  • ICR #5844
    • Status: Active
    • Usage: Supported
    FORCEIP6(IP) ; EXTRINSIC. ICR #5844 (supported)
    ; Convert an IP address (either IPv4 or IPv6) into an IPv6 address in a standardized format: "2001:0DB8:0000:0000:0000:8A2E:0370:7334".
    ; Usage: S Y=$$FORCEIP6^XLFIPV(IP)
    ; Input: IP (string) IPv4 or IPv6 Address to be converted.
    ; Output: returns: An IPv6 address in "hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh" notation if the
    ; input address is valid, or the null address "::0" if the input address is invalid.
  • ICR #5844
    • Status: Active
    • Usage: Supported
    CONVERT(IP) ; EXTRINSIC. ICR #5844 (supported)
    ; Convert an IP address (either IPv4 or IPv6) into an IPv6 address in a standardized format, either IPv4 or IPv6 depending
    ; upon the Cache system settings.
    ; Usage: S Y=$$CONVERT^XLFIPV(IP)
    ; Input: IP (string) IPv4 or IPv6 Address to be converted.
    ; Output: returns:
    ; - An IPv4 address if IPv6 is disabled on the system.
    ; - An IPv6 address if IPv6 is enabled on the system.
    ; - An IPv4 or IPv6 null address if the input cannot be converted.
  • ICR #5844
    • Status: Active
    • Usage: Supported
    VERSION() ; EXTRINSIC. ICR #5844 (supported)
    ; Determine the Cache system settings for IPv6.
    ; Usage: S Y=$$VERSION^XLFIPV()
    ; Input: None.
    ; Output: returns:
    ; 1 - if IPv6 is enabled.
    ; 0 - if IPv6 is disabled.
  • ICR #5844
    • Status: Active
    • Usage: Supported
    VAL ; OPTION. "Validate IPv4 and IPv6 address" [XLFIPV VALIDATE]
    VALH ; Extended help for VAL^XLFIPV
    IP4 ; OPTION. "Convert any IP address to IPv4" [XLFIPV FORCEIP4]
    IP4H ; Extended help for IP4^XLFIPV
    IP6 ; OPTION. "Convert any IP address to IPv6" [XLFIPV FORCEIP6]
    IP6H ; Extended help for IP6^XLFIPV
    CON ; OPTION. "Convert any IP address per system settings" [XLFIPV CONVERT]
    CONH ; Extended help for CON^XLFIPV
    VER ; OPTION. "Show system settings for IPv6" [XLFIPV VERSION]
    EXPAND4(IP) ; INTRINSIC.
    ; Changes the format of an IPv4 address to a common format that can be validated
    ; Usage: S Y=$$EXPAND4^XLFIPV(IP)
    ; Input: IP (string) IPv4 address to be reformatted.
    ; Output: returns: An IPv4 address in the format "nnn.nnn.nnn.nnn".
    EXPAND6(IP,ZNUM) ; INTRINSIC.
    ; Changes the format of an IPv6 address to a common format that can be validated
    ; Usage: S Y=$$EXPAND6^XLFIPV(IP)
    ; Input: IP (string) IPv6 address to be reformatted.
    ; ZNUM The number of expected colons
    ; Output: returns: An IPv6 address in the format "hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh".
    EXAMINE4(XLFIELD) ; INTRINSIC.
    ; Examine a single field of an IPv4 address for a valid format
    ; Usage: S Y=$$EXAMINE4^XLFIPV(XLFIELD)
    ; Input: XLFIELD (string) Field to be examined.
    ; Output: returns:
    ; 1 - if the field is valid.
    ; 0 - if the field is invalid.
    EXAMINE6(XLFIELD) ; INTRINSIC.
    ; Examine a single field of an IPv6 address for a valid format
    ; Usage: S Y=$$EXAMINE6^XLFIPV(XLFIELD)
    ; Input: XLFIELD (string) Field to be examined.
    ; Output: returns:
    ; 1 - if the field is valid.
    ; 0 - if the field is invalid.
    CNVF(IP) ; INTRINSIC.
    ; Expands a decimal IP address "ddd.ddd.ddd.ddd" to hexadecimal fields
    ; Usage: S Y=$$CNVF^XLFIPV(IP)
    ; Input: IP (string) IPv4 address to be reformatted.
    ; Output: returns: The last two bytes of an IPv6 address in the format "hhhh:hhhh".

    Interaction Calls

    Name Line Occurrences
    Function Call: WRITE
    • Prompt: !!,?3,X," is NOT a valid address."
    • Line Location: VAL+6
    Function Call: WRITE
    • Prompt: !!,?3,X," is a valid address."
    • Line Location: VAL+7
    Function Call: WRITE
    • Prompt: !!," This option will validate the format of an IP address (either IPv4 or IPv6)"
    • Line Location: VALH+1
    Function Call: WRITE
    • Prompt: !," and return ""IP is NOT a valid address"" if the address is in an invalid"
    • Line Location: VALH+2
    Function Call: WRITE
    • Prompt: !," format, or return ""IP is a valid address"" if the format is correct."
    • Line Location: VALH+3
    Function Call: WRITE
    • Prompt: !!,?3,$$FORCEIP4(X)
    • Line Location: IP4+5
    Function Call: WRITE
    • Prompt: !!," This option will take an IP address (either IPv4 or IPv6) and return an"
    • Line Location: IP4H+1
    Function Call: WRITE
    • Prompt: !," IPv4 address in a standardized format. It will return the null address"
    • Line Location: IP4H+2
    Function Call: WRITE
    • Prompt: !," 0.0.0.0 if the passed IP address is invalid. If an IPv6 address is input"
    • Line Location: IP4H+3
    Function Call: WRITE
    • Prompt: !," which does not have a valid IPv4 equivalent, the null address will be"
    • Line Location: IP4H+4
    Function Call: WRITE
    • Prompt: !," returned."
    • Line Location: IP4H+5
    Function Call: WRITE
    • Prompt: !!,?3,$$FORCEIP6(X)
    • Line Location: IP6+5
    Function Call: WRITE
    • Prompt: !!," This option will take an IP address (either IPv4 or IPv6) and return an"
    • Line Location: IP6H+1
    Function Call: WRITE
    • Prompt: !," IPv6 address in a standardized format. It will return the null address"
    • Line Location: IP6H+2
    Function Call: WRITE
    • Prompt: !," ::0 if the passed IP address is invalid."
    • Line Location: IP6H+3
    Function Call: WRITE
    • Prompt: !!,?3,$$CONVERT(X)
    • Line Location: CON+5
    Function Call: WRITE
    • Prompt: !!," This option will take an IP address (either IPv4 or IPv6) and return an"
    • Line Location: CONH+1
    Function Call: WRITE
    • Prompt: !," IP address in a standardized format, depending on system settings. If"
    • Line Location: CONH+2
    Function Call: WRITE
    • Prompt: !," IPv6 is disabled on the system, an IPv4 address will be returned. If"
    • Line Location: CONH+3
    Function Call: WRITE
    • Prompt: !," IPv6 is enabled on the system, an IPv6 address will be returned. If an"
    • Line Location: CONH+4
    Function Call: WRITE
    • Prompt: !," invalid address is entered, a null address will be returned. If an IPv6"
    • Line Location: CONH+5
    Function Call: WRITE
    • Prompt: !," is entered, IPv6 is not enabled, and the input address does not have an"
    • Line Location: CONH+6
    Function Call: WRITE
    • Prompt: !," IPv4 equivalent, a null address will be returned."
    • Line Location: CONH+7
    Function Call: WRITE
    • Prompt: !!,?3,XLSYS," ",XLVER
    • Line Location: VER+3
    Function Call: WRITE
    • Prompt: !!," IPv6 is available but is disabled on this system."
    • Line Location: VER+6
    Function Call: WRITE
    • Prompt: !!," IPv6 is not available on this version of Cache."
    • Line Location: VER+7
    Function Call: WRITE
    • Prompt: !!," IPv6 is not available on this system."
    • Line Location: VER+8
    Function Call: WRITE
    • Prompt: !!," IPv6 is enabled on this system."
    • Line Location: VER+9
    Info |  Source |  Entry Points |  Interaction Calls