$/**
$ * @brief Enduro/X internal UBF field table
$ *
$ * @file Exfields.h
$ */
$/* -----------------------------------------------------------------------------
$ * Enduro/X Middleware Platform for Distributed Transaction Processing
$ * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
$ * Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
$ * This software is released under one of the following licenses:
$ * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
$ * See LICENSE file for full text.
$ * -----------------------------------------------------------------------------
$ * AGPL license:
$ *
$ * This program is free software; you can redistribute it and/or modify it under
$ * the terms of the GNU Affero General Public License, version 3 as published
$ * by the Free Software Foundation;
$ *
$ * This program is distributed in the hope that it will be useful, but WITHOUT ANY
$ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
$ * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
$ * for more details.
$ *
$ * You should have received a copy of the GNU Affero General Public License along 
$ * with this program; if not, write to the Free Software Foundation, Inc.,
$ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$ *
$ * -----------------------------------------------------------------------------
$ * A commercial use license is available from Mavimax, Ltd
$ * contact@mavimax.com
$ * -----------------------------------------------------------------------------
$ */

$#ifndef __EXFIELDS_H
$#define __EXFIELDS_H

*base 100

#NAME		ID	TYPE	FLAG	COMMENT
#----		--	----	----	-------
# Service name for UD
SRVCNM		1	string	-	Service name to be called

################################################################################
# Event subsystem related
################################################################################
EV_FLAGS        4       long    -       Event subscription flags
EV_MASK         5       string  -       Event subscription mask
EV_FILTER       6       string  -       Event subscription filter
EV_SRVCNM	7	string	-	Event subscription service name
EV_SUBSNR       8       long    -       Event subscriber number

################################################################################
# Enduro/X Transaction Monitor
################################################################################
EXDM_RESTARTS   15      long    -       ndrxd restarts done
# Transaction manager specific fields
TMCMD           20      char    -       Transaction Manager Command code
TMXID           21      string  -       XID used for TM exchange
TMRMID          23      short   -       Resource Manager ID - branch id (master)
TMNODEID        22      short   -       Transaction Manager Node id
TMSRVID         24      short   -       Server ID of Transaction Manager
TMKNOWNRMS      25      string  -       List of known Resource Managers involved in tx
# Error handling for XA:
TMERR_CODE       30      short   -       Error code returned by TM (0 - OK)
TMERR_REASON     31      short   -       Reason code (0 - not specific)
TMERR_MSG        32      string  -       Error message returned by TM

# Initiator
TMPROCESSID     50       string  -       Process ID starting the transaction
TMCALLERRM      51       short   -       Caller's resource manager
TMTXTOUT        52       long    -       Transaction timeout value (seconds)
TMTXTOUT_LEFT   53       long    -       Time left for transaction till timeout
TMTXSTAGE       54       short   -       Transaction stage, where we are currenlty
TMTXRMID        55       short   M       Resource manager id (grpno)
TMTXRMSTATUS    56       char    M       Resource manager status
TMTXRMERRCODE   57       long    M       Resource manager error code associated
TMTXRMREASON    58       short   M       Reason code associated with RM
TMTXTRYCNT      59       long    -       Transaction try count
TMTXTRYMAXCNT   60       long    -       Transaction try count, max
#
# NOTE! TMTXFLAGS does not transport TPTRANID.tmtxflags
# instead TMTXFLAGS UBF field is used for TMFLAGS values
#
TMTXFLAGS       61       long    -       Various TM flags...
TMTXBTID        62       long    -       Branch Transaction ID

################################################################################
# Client process manager
################################################################################
EX_CPMCOMMAND   100     string   -       CPM Command (bc - boot clt, sc - stop clt, pc - print clts)
EX_CPMOUTPUT    101     string   -       CPM output
EX_CPMTAG       102     string   -       Tag
EX_CPMSUBSECT   103     string   -       Sub-section
EX_CPMWAIT      104     long     -       Wait milliseconds after batch processing

# Generic fields
EX_CLTID        	150	string	-	client identifier for originating client
EX_DATA                 151     carray  -       unified data field
EX_DATA_BUFTYP          152     short   -       ATMI buffer type ID
EX_TSTAMP1_STR          153     string   -      Time stamp, yyyyMMddHHmmssSSS
EX_TSTAMP2_STR          154     string   -      Time stamp, yyyyMMddHHmmssSSS
EX_DATA_STR             155     string  -       Generic string data

################################################################################
# Persistant Queue:
################################################################################
EX_QSPACE		    200	    string    -	q space
EX_QNAME		    201	    string    -	q name
EX_QFLAGS		    202	    long	-	indicates which of the values are set
EX_QDEQ_TIME		203	    long	-	absolute/relative  time for dequeuing
EX_QPRIORITY		204	    long	-	enqueue priority
EX_QDIAGNOSTIC		205 	long	-	indicates reason for failure
EX_QMSGID		    206	    carray	-	id of message before which to queue, binary
EX_QCORRID		    207	    carray	-	correlation id used to identify message
EX_QREPLYQUEUE		208	    string	-	queue name for reply message
EX_QFAILUREQUEUE	209 	    string	-	queue name for failure message
EX_QURCODE		    210 	long	-	application user-return code
EX_QAPPKEY		    211	    long	-	application authentication client key
EX_QDELIVERY_QOS	212	    long    -	delivery quality of service
EX_QREPLY_QOS		213 	long    -	reply message quality of service
EX_QEXP_TIME		214 	long    -	expiration time
EX_QCMD			    215 	char    -	Queue command
EX_QDIAGMSG		    216 	string	-	diagnostic message
EX_QNUMMSG		    217 	long	-	Number of messages in q
EX_QNUMLOCKED		    218 	long	-	Number of locked messages in q
EX_QNUMSUCCEED		    219 	long	-	Number of succeed messages, for autoq
EX_QNUMFAIL		    220 	long	-	Number of failed messages for autoq
EX_QSTRFLAGS		    221 	string	-	String based flags
EX_QMSGTRIES		    222 	long	-	Number of tries for auto message
EX_QMSGLOCKED		    223 	short	-	Is message locked?
EX_QMSGIDSTR		    224	        string	-	String version of msgid
EX_QNUMENQ		    225 	long	-	Number of enqueues
EX_QNUMDEQ		    226 	long	-	Number of dequeues

# file actions, as now tmqueue maintains the state of the files:
EX_QFILENAME1	    	227 	string	-	Filename 1 for command
EX_QFILENAME2		    228 	string	-	filename 2 for command
EX_QFILECMD		        229 	char	-	File command

################################################################################
# Enduro/X standard library
################################################################################
EX_NERROR_CODE           300         short  -        Result code (error code)
EX_NERROR_MSG            301         string -        Result message
EX_NREQLOGFILE           302         string -        Request log file

EX_TPERRNO               350         long -          TP error number
EX_TPURCODE              351         long -          TP user return code
EX_TPSTRERROR            352         string -        TP error message
EX_TPERRSRC              353         char -          TP error source code
################################################################################
# Fields for Common Config Server (ccsrv)
# Config commands:
# 'g' - Get (default)
# 'l' - list (iterate through)
################################################################################
EX_CC_CMD                   400         char    -       Common config command
EX_CC_RESOURCE              401         string  -       List of config resources
EX_CC_LOOKUPSECTION         402         string  -       Lookup section (with sub-sects slashed) (single)
EX_CC_SECTIONMASK           403         string -        List of sections (start with) to iterate

EX_CC_MANDATORY             404         string -        List of mandatory config fields in section (only for get)

# Formats accepted
# sX..Y (string, in length of X till Y, X may not be set, then 0 is accpeted), e.g. s..16, s5..10
# fX..Y Number in length of X till Y (this allows, "e-,." to be present. X and Y is string format length of the field accepted
# dX..Y Decimal in length of X till Y (only digits allowed)
# t (boolean field, accepts: yes,no,TRUE,FALSE,1,0)
EX_CC_FORMAT_KEY            405         string -        Config key format
EX_CC_FORMAT_FORMAT         406         string -        For to be checked

# Triplet for single entry of config:
EX_CC_SECTION               409         string -        section from which value was taken (direct or parent...)
EX_CC_KEY                   410         string -        Result key (list)
EX_CC_VALUE                 411         string -        Corresponding occurrence of value for key
################################################################################

################################################################################
# Error code field for interfaces (connecting modules)
################################################################################
EX_IF_ECODE                 500         short  -        Result code (error code)
EX_IF_EMSG                  501         string -        Result message

# REST interface caller URL
EX_IF_URL                   502         string -        Called URL for REST interface

# Header fields, pairs for request
EX_IF_REQHN                 503         string -        Request Header Name
EX_IF_REQHV                 504         string -        Request header Value

# Cookie request data
EX_IF_REQCN                 505         string -        Request Cookie Name
EX_IF_REQCV                 506         string -        Request Cookie Value

# Header fields, pairs for response
EX_IF_RSPHN                 507         string -        Response Header Name
EX_IF_RSPHV                 508         string -        Response Header Value

# Cookie response data
EX_IF_RSPCN                 509         string -        Response Cookie Name
EX_IF_RSPCV                 510         string -        Response Cookie Value

EX_IF_RSPCPATH              511         string -        Response Cookie Path
EX_IF_RSPCDOMAIN            512         string -        Response Cookie Domain
EX_IF_RSPCEXPIRES           513         string -        Response Cookie Expires
EX_IF_RSPCMAXAGE            514         string -        Response Cookie MaxAge
EX_IF_RSPCSECURE            515         string -        Response Cookie Secure
EX_IF_RSPCHTTPONLY          516         string -        Response Cookie HttpOnly

# Process form data in raw mode.
EX_IF_REQFORMN              520         string -        Request Form Name
EX_IF_REQFORMV              521         string -        Request Form Value

EX_IF_REQQUERYN             522         string -        URL request Query field Name
EX_IF_REQQUERYV             523         string -        URL request Query field value

# Service user return code
EX_IF_URCODE                530         long  -         User return code

EX_IF_REQDATA               531         carray -        Request data / body
EX_IF_RSPDATA               532         carray -        Response data / body
EX_IF_METHOD                540         string -        HTTP method

EX_IF_REQFILEDISK           541         string -        file on HDD, temporary, multi occ
EX_IF_REQFILENAME           542         string -        file name in upload form
EX_IF_REQFILEMIME           543         string -        content type, multi occ
EX_IF_REQFILEFORM           544         string -        form field name, multi occ
EX_IF_RSPFILEACTION         545         string -        occurrence on action, multi-occ

EX_IF_TPURCODE              546         long   -        user code in response from svc call
EX_IF_ERRSRC                547         char   -        Error source

################################################################################
# TCP Inter-connecting
################################################################################
EX_NETDATA                  550         carray -        Network Data field
EX_NETGATEWAY               551         string -        Network gateway service
EX_NETCONNID                552         long  -         Network Connection id at gateway
EX_NETCORR                  553         string  -       Network request correlator field
EX_NETFLAGS                 554         string  -       Flags of the network call
EX_NETCONNIDCOMP            555         long    -       Compiled connection id
# Feature #288
EX_NETOURIP                 556         string  -       Our client/server IP address
EX_NETOURPORT               557         long    -       Our client/server port
EX_NETTHEIRIP               558         string  -       Their client/server IP address
EX_NETTHEIRPORT             559         long    -       Their client/server port
#
# A - we are client (Aactive, performing connect)
# P - we are server (Passive, wait for incoming call)
#
EX_NETCONMODE               560         char    -       Connection mode (A - act/P - passive)
EX_NETRCODE                 651         long    -       Network related error code (e.g. http status)

################################################################################
# View processing
################################################################################
EX_VIEW_NAME                600         string  -      Name of the view (if present the this is view buffer)
#
# Checksum is compared before target system processes the record from fb
# the object checksum of the view must match. Otherwise target system will not accept the incoming message
# and the server shall respond with error 10.
# checksum is calculated as crc32, updated during the loading time..
#
EX_VIEW_CKSUM               601         long   -       Checksum calculate of type+cname+count+length
# from left to right. The char index from left to right is the field number. All field numbers must be filled
# the 0 -> field not included in the buffer.
# the 1 -> field is included in buffer and must be installed back in structure.
EX_VIEW_INCLFLDS            602         string -       Field include flags

################################################################################
# Cache processing
################################################################################
EX_CACHE_DBNAME             650         string -       Db name of cache
EX_CACHE_OPEXPR             651         string -       Operation expression
EX_CACHE_BUFTYP             652         short -        buffer type id
EX_CACHE_DUMP               653         carray -       Data dump, carray
EX_CACHE_TPERRNO            654         long -         TP Error code
EX_CACHE_TPRUCODE           655         long -         TP Return code
EX_CACHE_TIM                656         long -         Cache put epoch secs
EX_CACHE_TIMUSEC            657         long -         Cache put epoch usecs
EX_CACHE_HITT               658         long -         Cache hit epoch secs
EX_CACHE_HITTU              659         long -         Cache hit epcoh usec
EX_CACHE_NODEID             660         short -        Cache put source node id
EX_CACHE_CMD                661         char -         Cache command
EX_CACHE_FLAGS              662         long -         Command flags
EX_CACHE_HITS               663         long -         Number of times cache was read
EX_CACHE_NRDEL              664         long -         Number of records deleted
EX_CACHE_NRDUPDEL           665         long -         Number of duplicates deleted
EX_CACHE_BUFLEN             667         long -         Data len, bytes

$#endif

$/* vim: set ts=4 sw=4 et smartindent: */
