SEGUSER

Synopsis

HELP:   User-defined segment store SPI backend (store.seguser())
TYPE:   OBJECT
SYNTAX: SEGUSER(NAMESPACE='str',LIBRARY='str',FUNCTION='str',PARAMETER='str',TRACE,LOGGING,DEBUG)

Description

Use user-defined FSEG segment store SPI backend for archive read.

The FSEG SPI (Segment Store Exit) lets a user-supplied shared library handle segment-level storage I/O. The library exports a single entry point conforming to the TfFsegExit signature and processes the 14 FSEG function codes defined in FSEG.h.

The NAME parameter identifies the archive namespace passed to the provider as pcNamStr during open. LIBRARY and FUNCTION select the shared library and its entry point (defaults: libfsse / FSEGUSR). An optional PARAMETER string is forwarded as pcParStr for provider-specific configuration. The TRACE switch enables diagnostic output from the provider.

LOGGING enables info-level log messages from the SEGSSE bridge and the FSEG provider (sets FSEG_FLAG_LOG in the OPN call). DEBUG adds per-operation detail to the log output (sets FSEG_FLAG_DEBUG; requires LOGGING to be set).

FSEG SPI -- Segment Store Provider Interface

A FSEG provider is a shared library that exports one C function conforming to the TfFsegExit signature defined in FSEG.h. The provider receives all storage requests from FL5 through this single entry point and must implement the 14 FSEG function codes listed below.

FL5 ships a reference provider (libfsse / entry point FSEGUSR) that maps the FSEG SPI to the built-in SEGFILE flat-file backend. Custom providers can target any storage backend (relational database, key-value store, cloud object storage, etc.) by implementing the same interface.

Entry Point

The provider library must export a function with this C signature:

void FSEGUSR(
    void*               pvGbl,
    void**              ppHdl,
    int*                piRetco,
    unsigned int        uiVersion,
    const unsigned int* piFunc,
    TuFsegPar*          puPara,
    unsigned int        uiMsgSiz,
    char*               pcMsg);

The name FSEGUSR is the default; it can be overridden with the FUNCTION CLEP parameter. The arguments are:

The provider must set *piRetco = 0 on success and write a human-readable error description to pcMsg on failure.

Interface Version

The current interface version is FSEG_VERSION = 0x0102. The major byte (0x01) identifies the function-code set; the minor byte (0x02) identifies backward-compatible additions (such as the uiDelLen output field in TsFsegDel and the uiSegCnt field in TsFsegFlb added in version 0x0102). A provider must check uiVersion at OPN time and reject versions it does not support.

FSEG Function Codes

The *piFunc argument selects the operation. The union member to use in puPara is shown in brackets.

Open Parameters (TsFsegOpn)

Fields set by the caller before OPN:

Fields written by the provider at OPN:

Close Parameters (TsFsegCls)

FSEG Flags (TsFsegOpn.uiFlg)

Segment Types (TsFsegPut.uiSegTyp)

Special Segment Index Values

Provider Parameter String

The built-in reference provider (libfsse) parses the PARAMETER string as a semicolon-separated list of key=value pairs:

Custom providers may define their own parameter string format. The string is passed verbatim as pcParStr and is not interpreted by FL5.

Logging

When FSEG_FLAG_LOG is set in uiFlg, the provider may call FLM_LOG(FLMLOG_TYP_INFO, ...) with message tags starting with FSSE-SEG- (reference provider) or any provider-specific prefix. Messages are routed through the FL5 log framework.

When FSEG_FLAG_DEBUG is additionally set, the provider may emit FLMLOG_TYP_DEBUG messages for per-operation detail.

The SEGSSE bridge itself logs with the SEGSSE- prefix regardless of provider flags.

z/OS SAF Resource Groups

On z/OS with GLOBAL.SGU.CONTROL defined in the $FLAM RACF class, FL5 performs authorization checks before loading the provider. Four resource groups are used (all checked at READ attribute level):

FSEG_FLAG_STRONG is set when uiSafLevel < 8, meaning RACF is in strict mode (GLOBAL.MUSTDEF=UPDATE or lower). With STRONG set, both the namespace and the parameter string were explicitly approved. Without STRONG (permissive mode), SAF accepted RC=4 (not defined).

The provider can inspect these flags to decide whether to enforce additional access controls on its own resources.

See Also

Arguments