"Fossies" - the Fresh Open Source Software Archive

Member "opensaf-5.21.09/src/imm/common/immsv_evt.h" (14 Sep 2021, 27576 Bytes) of package /linux/misc/opensaf-5.21.09.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "immsv_evt.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.21.06_vs_5.21.09.

    1 /*      -*- OpenSAF  -*-
    2  *
    3  * (C) Copyright 2008 The OpenSAF Foundation
    4  * Copyright Ericsson AB 2020 - All Rights Reserved.
    5  *
    6  * This program is distributed in the hope that it will be useful, but
    7  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    8  * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
    9  * under the GNU Lesser General Public License Version 2.1, February 1999.
   10  * The complete license can be accessed from the following location:
   11  * http://opensource.org/licenses/lgpl-license.php
   12  * See the Copying file included with the OpenSAF distribution for full
   13  * licensing terms.
   14  *
   15  * Author(s): Ericsson AB
   16  *
   17  */
   18 
   19 /*****************************************************************************
   20 ..............................................................................
   21 
   22 ..............................................................................
   23 
   24   DESCRIPTION:
   25 
   26   This file contains the Enum and datastructure definations for events
   27   exchanged between IMMSv components
   28 
   29 ******************************************************************************/
   30 
   31 #ifndef IMM_COMMON_IMMSV_EVT_H_
   32 #define IMM_COMMON_IMMSV_EVT_H_
   33 
   34 #ifdef __cplusplus
   35 extern "C" {
   36 #endif
   37 
   38 #include "rde/agent/rda_papi.h"
   39 #include "imm/common/immsv_evt_model.h"
   40 
   41 #define IMMSV_LOADERNAME "IMMLOADER"
   42 
   43 /*****************************************************************************
   44  * Event Type of IMMSV
   45  *****************************************************************************/
   46 typedef enum immsv_evt_type {
   47   IMMSV_EVT_TYPE_IMMA = 1,
   48   IMMSV_EVT_TYPE_IMMND = 2,
   49   IMMSV_EVT_TYPE_IMMD = 3,
   50   IMMSV_EVT_TYPE_MAX
   51 } IMMSV_EVT_TYPE;
   52 
   53 /*****************************************************************************
   54  * Event Type of IMMA
   55  *****************************************************************************/
   56 typedef enum imma_evt_type {
   57   /* Locally generated events */
   58   IMMA_EVT_MDS_INFO = 1, /* IMMND UP/DOWN Info */
   59   IMMA_EVT_TIME_OUT = 2, /* Time out events at IMMA */
   60 
   61   /* Events from IMMND */
   62   IMMA_EVT_ND2A_IMM_INIT_RSP = 3,
   63   IMMA_EVT_ND2A_IMM_FINALIZE_RSP = 4,
   64   IMMA_EVT_ND2A_IMM_ADMINIT_RSP = 5,
   65   IMMA_EVT_ND2A_IMM_ADMOP = 6, /*Admin-op OI callback */
   66   IMMA_EVT_ND2A_IMM_ERROR = 7, /*Generic error reply */
   67   IMMA_EVT_ND2A_ADMOP_RSP =
   68       8, /*Response from AdminOp to OM client, normal call */
   69   IMMA_EVT_ND2A_CCBINIT_RSP = 9,     /*Response from for CcbInit */
   70   IMMA_EVT_ND2A_SEARCHINIT_RSP = 10, /*Response from for SearchInit */
   71   IMMA_EVT_ND2A_SEARCHNEXT_RSP = 11, /*Response from for SearchNext */
   72   IMMA_EVT_ND2A_SEARCH_REMOTE = 12,  /*Fetch pure runtime attributes. */
   73   IMMA_EVT_ND2A_CLASS_DESCR_GET_RSP =
   74       13,                         /*Response for SaImmOmClassDescriptionGet */
   75   IMMA_EVT_ND2A_IMPLSET_RSP = 14, /*Response for saImmOiImplementerSet */
   76   IMMA_EVT_ND2A_OI_OBJ_CREATE_UC = 15,    /*OBJ CREATE UP-CALL. */
   77   IMMA_EVT_ND2A_OI_OBJ_DELETE_UC = 16,    /*OBJ DELETE UP-CALL. */
   78   IMMA_EVT_ND2A_OI_OBJ_MODIFY_UC = 17,    /*OBJ MODIFY UP-CALL. */
   79   IMMA_EVT_ND2A_OI_CCB_COMPLETED_UC = 18, /*CCB COMPLETED UP-CALL. */
   80   IMMA_EVT_ND2A_OI_CCB_APPLY_UC = 19,     /*CCB APPLY UP-CALL. */
   81   IMMA_EVT_ND2A_OI_CCB_ABORT_UC = 20,     /*CCB ABORT UP-CALL. */
   82 
   83   IMMA_EVT_ND2A_IMM_SYNC_RSP = 21,
   84 
   85   IMMA_EVT_CB_DUMP = 22,
   86   IMMA_EVT_ND2A_IMM_RESURRECT_RSP = 23,
   87   IMMA_EVT_ND2A_PROC_STALE_CLIENTS = 24,
   88   IMMA_EVT_ND2A_IMM_PBE_ADMOP = 25, /*Special PBE admop callback */
   89   IMMA_EVT_ND2A_IMM_ERROR_2 = 26,   /*Generic error reply, errStrings added*/
   90   IMMA_EVT_ND2A_ADMOP_RSP_2 =
   91       27, /*Response from AdminOp to OM client - extended */
   92   IMMA_EVT_ND2A_CCB_AUG_INIT_RSP =
   93       28, /* Response on IMMND_EVT_A2ND_OI_CCB_AUG_INIT */
   94 
   95   IMMA_EVT_ND2A_SEARCHBUNDLENEXT_RSP =
   96       29, /*Response from SearchNext with more results */
   97   IMMA_EVT_ND2A_ACCESSOR_GET_RSP = 30, /* Response from accessorGet */
   98   IMMA_EVT_ND2A_OI_OBJ_CREATE_LONG_UC =
   99       31, /*OBJ CREATE UP-CALL with long DN. */
  100   IMMA_EVT_ND2A_OI_OBJ_MODIFY_LONG_UC =
  101       32, /*OBJ MODIFY UP-CALL with long DN. */
  102   IMMA_EVT_ND2A_OI_OBJ_DELETE_LONG_UC =
  103       33, /*OBJ DELETE UP-CALL with long DN. */
  104   IMMA_EVT_ND2A_IMM_CLM_NODE_LEFT =
  105       34, /* when clm-lock/clm-node left the cluster */
  106   IMMA_EVT_ND2A_IMM_CLM_NODE_JOINED =
  107       35, /* when clm-lock/clm-node join the cluster */
  108   IMMA_EVT_ND2A_IMM_SYNCR_TIMEOUT = 36,
  109 
  110   IMMA_EVT_MAX
  111 } IMMA_EVT_TYPE;
  112 
  113 /*****************************************************************************
  114  * Event Type of IMMND
  115  *****************************************************************************/
  116 typedef enum immnd_evt_type {
  117   /* events from IMMA to IMMND */
  118 
  119   /* Locally generated events */
  120   IMMND_EVT_MDS_INFO = 1, /* IMMA/IMMND/IMMD UP/DOWN Info */
  121   IMMND_EVT_TIME_OUT = 2, /* Time out event */
  122 
  123   /* Events from IMMA */
  124   IMMND_EVT_A2ND_IMM_INIT = 3,         /* ImmOm Initialization */
  125   IMMND_EVT_A2ND_IMM_OI_INIT = 4,      /* ImmOi Initialization */
  126   IMMND_EVT_A2ND_IMM_FINALIZE = 5,     /* ImmOm finalization */
  127   IMMND_EVT_A2ND_IMM_OI_FINALIZE = 6,  /* ImmOi finalization */
  128   IMMND_EVT_A2ND_IMM_ADMINIT = 7,      /* AdminOwnerInitialize */
  129   IMMND_EVT_A2ND_ADMO_FINALIZE = 8,    /* AdminOwnerFinalize */
  130   IMMND_EVT_A2ND_ADMO_SET = 9,         /* AdminOwnerSet */
  131   IMMND_EVT_A2ND_ADMO_RELEASE = 10,    /* AdminOwnerRelease */
  132   IMMND_EVT_A2ND_ADMO_CLEAR = 11,      /* AdminOwnerClear */
  133   IMMND_EVT_A2ND_IMM_ADMOP = 12,       /* Syncronous AdminOp */
  134   IMMND_EVT_A2ND_IMM_ADMOP_ASYNC = 13, /* Asyncronous AdminOp */
  135   IMMND_EVT_A2ND_IMM_FEVS = 14,        /* Fake EVS msg from Agent (forward) */
  136   IMMND_EVT_A2ND_CCBINIT = 15,         /* CcbInitialize */
  137   IMMND_EVT_A2ND_SEARCHINIT = 16,      /* SearchInitialize */
  138   IMMND_EVT_A2ND_SEARCHNEXT = 17,      /* SearchNext */
  139   IMMND_EVT_A2ND_SEARCHFINALIZE = 18,  /* SearchFinalize */
  140   IMMND_EVT_A2ND_SEARCH_REMOTE = 19,   /* forward fetch of pure rt attr vals */
  141   IMMND_EVT_A2ND_RT_ATT_UPPD_RSP =
  142       20,                        /* reply for fetch of pure rt attr vals */
  143   IMMND_EVT_A2ND_ADMOP_RSP = 21, /* AdminOperation sync local Reply */
  144   IMMND_EVT_A2ND_ASYNC_ADMOP_RSP = 22,    /* AdminOperation async local Reply */
  145   IMMND_EVT_A2ND_CCB_COMPLETED_RSP = 23,  /* CcbCompleted local Reply */
  146   IMMND_EVT_A2ND_CCB_OBJ_CREATE_RSP = 24, /*CcbObjCreate local Reply */
  147   IMMND_EVT_A2ND_CCB_OBJ_MODIFY_RSP = 25, /*CcbObjModify local Reply */
  148   IMMND_EVT_A2ND_CCB_OBJ_DELETE_RSP = 26, /*CcbObjDelete local Reply */
  149   IMMND_EVT_A2ND_CLASS_CREATE = 27,       /* saImmOmClassCreate */
  150   IMMND_EVT_A2ND_CLASS_DESCR_GET = 28,    /* saImmOmClassDescriptionGet */
  151   IMMND_EVT_A2ND_CLASS_DELETE = 29,       /* saImmOmClassDelete */
  152   IMMND_EVT_A2ND_OBJ_CREATE = 30,         /* saImmOmCcbObjectCreate */
  153   IMMND_EVT_A2ND_OBJ_MODIFY = 31,         /* saImmOmCcbObjectModify */
  154   IMMND_EVT_A2ND_OBJ_DELETE = 32,         /* saImmOmCcbObjectDelete */
  155   IMMND_EVT_A2ND_CCB_APPLY = 33,          /* saImmOmCcbApply */
  156   IMMND_EVT_A2ND_CCB_FINALIZE = 34,       /* saImmOmCcbFinalize */
  157   IMMND_EVT_A2ND_OBJ_SYNC = 35,           /* immsv_sync */
  158   IMMND_EVT_A2ND_SYNC_FINALIZE = 36,      /* immsv_finalize_sync */
  159 
  160   IMMND_EVT_A2ND_OI_OBJ_CREATE = 37,   /* saImmOiRtObjectCreate */
  161   IMMND_EVT_A2ND_OI_OBJ_MODIFY = 38,   /* saImmOiRtObjectUpdate */
  162   IMMND_EVT_A2ND_OI_OBJ_DELETE = 39,   /* saImmOiRtObjectDelete */
  163   IMMND_EVT_A2ND_OI_IMPL_SET = 40,     /* saImmOiImplementerSet */
  164   IMMND_EVT_A2ND_OI_IMPL_CLR = 41,     /* saImmOiImplementerClear */
  165   IMMND_EVT_A2ND_OI_CL_IMPL_SET = 42,  /* saImmOiClassImplementerSet */
  166   IMMND_EVT_A2ND_OI_CL_IMPL_REL = 43,  /* saImmOiClassImplementerRelease */
  167   IMMND_EVT_A2ND_OI_OBJ_IMPL_SET = 44, /* saImmOiObjectImplementerSet */
  168   IMMND_EVT_A2ND_OI_OBJ_IMPL_REL = 45, /* saImmOiObjectImplementerRelease */
  169 
  170   IMMND_EVT_ND2ND_ADMOP_RSP = 46,       /* AdminOperation sync fevs Reply */
  171   IMMND_EVT_ND2ND_ASYNC_ADMOP_RSP = 47, /* AdminOperation async fevs Reply */
  172   IMMND_EVT_ND2ND_SYNC_FINALIZE = 48,   /* Sync finalize from coord over fevs */
  173   IMMND_EVT_ND2ND_SEARCH_REMOTE = 49, /* Forward of search request ro impl ND */
  174   IMMND_EVT_ND2ND_SEARCH_REMOTE_RSP =
  175       50, /* Forward of search request ro impl ND */
  176 
  177   /* Events from IMMD to IMMND */
  178   IMMND_EVT_D2ND_INTRO_RSP = 51,
  179   IMMND_EVT_D2ND_SYNC_REQ = 52,
  180   IMMND_EVT_D2ND_LOADING_OK = 53,
  181   IMMND_EVT_D2ND_SYNC_START = 54,
  182   IMMND_EVT_D2ND_SYNC_ABORT = 55,
  183   IMMND_EVT_D2ND_DUMP_OK = 56,
  184   IMMND_EVT_D2ND_GLOB_FEVS_REQ = 57, /* Fake EVS msg from director (consume) */
  185   IMMND_EVT_D2ND_ADMINIT = 58,       /* Admin Owner init reply */
  186   IMMND_EVT_D2ND_CCBINIT = 59,       /* Ccb init reply */
  187   IMMND_EVT_D2ND_IMPLSET_RSP =
  188       60, /* Implementer set reply from D with impl id */
  189   IMMND_EVT_D2ND_DISCARD_IMPL = 61, /* Discard implementer broadcast to NDs */
  190   IMMND_EVT_D2ND_ABORT_CCB = 62,    /* Abort CCB broadcast to NDs */
  191   IMMND_EVT_D2ND_ADMO_HARD_FINALIZE =
  192       63, /* Admo hard finalize broadcast to NDs */
  193   IMMND_EVT_D2ND_DISCARD_NODE =
  194       64, /* Crashed IMMND or node, broadcast to NDs */
  195   IMMND_EVT_D2ND_RESET =
  196       65, /* Force all or some IMMNDs to start from scratch. */
  197 
  198   IMMND_EVT_CB_DUMP = 66,
  199 
  200   IMMND_EVT_A2ND_IMM_OM_RESURRECT = 67, /* Request resurrect of OM handle */
  201   IMMND_EVT_A2ND_IMM_OI_RESURRECT = 68, /* Request resurrect of OI handle */
  202   IMMND_EVT_A2ND_IMM_CLIENTHIGH = 69,   /* Highest client id IMMA knows */
  203   IMMND_EVT_ND2ND_SYNC_FINALIZE_2 =
  204       70, /* Sync finalize from coord over fevs version 2*/
  205   IMMND_EVT_A2ND_RECOVER_CCB_OUTCOME =
  206       71, /* Fetch ccb outcome OK/FAILED_OP given ccb-id. */
  207   IMMND_EVT_A2ND_PBE_PRT_OBJ_CREATE_RSP =
  208       72, /* Response on PBE OI PRT OBJ CREATE. */
  209   IMMND_EVT_D2ND_PBE_PRTO_PURGE_MUTATIONS =
  210       73, /* Purge all unack'ed PRT OBJ changes */
  211   IMMND_EVT_A2ND_PBE_PRTO_DELETES_COMPLETED_RSP =
  212       74, /*Resp on PBE OI PRTO deletes */
  213   IMMND_EVT_A2ND_PBE_PRT_ATTR_UPDATE_RSP =
  214       75, /* Response on PBE OI PRT OBJ CREATE. */
  215   IMMND_EVT_A2ND_IMM_OM_CLIENTHIGH = 76, /* Highest client id IMMA knows */
  216   IMMND_EVT_A2ND_IMM_OI_CLIENTHIGH = 77, /* Highest client id IMMA knows */
  217   IMMND_EVT_A2ND_PBE_ADMOP_RSP = 78,  /* PBE AdminOperation result FEVS reply */
  218   IMMND_EVT_D2ND_SYNC_FEVS_BASE = 79, /* Sync started based on this fevsCount */
  219   IMMND_EVT_A2ND_OBJ_SYNC_2 = 80,     /* immsv_sync */
  220   IMMND_EVT_A2ND_IMM_FEVS_2 = 81,     /* Fake EVS msg from Agent (forward) */
  221   IMMND_EVT_D2ND_GLOB_FEVS_REQ_2 =
  222       82, /* Fake EVS msg from director (consume) */
  223   IMMND_EVT_A2ND_CCB_COMPLETED_RSP_2 = 83,  /* CcbCompleted local Reply */
  224   IMMND_EVT_A2ND_CCB_OBJ_CREATE_RSP_2 = 84, /*CcbObjCreate local Reply */
  225   IMMND_EVT_A2ND_CCB_OBJ_MODIFY_RSP_2 = 85, /*CcbObjModify local Reply */
  226   IMMND_EVT_A2ND_CCB_OBJ_DELETE_RSP_2 = 86, /*CcbObjDelete local Reply */
  227   IMMND_EVT_A2ND_ADMOP_RSP_2 =
  228       87, /* AdminOperation sync local Reply (extended) */
  229   IMMND_EVT_A2ND_ASYNC_ADMOP_RSP_2 =
  230       88, /* AdminOperation async local Reply (extended) */
  231   IMMND_EVT_ND2ND_ADMOP_RSP_2 =
  232       89, /* AdminOperation sync fevs Reply (extended) */
  233   IMMND_EVT_ND2ND_ASYNC_ADMOP_RSP_2 =
  234       90, /* AdminOperation async fevs Reply (extended) */
  235   IMMND_EVT_A2ND_OI_CCB_AUG_INIT = 91, /* Init of OI augmented ccb handle */
  236   IMMND_EVT_A2ND_AUG_ADMO =
  237       92, /* Inform IMMNDs of extra admo for augment ccb */
  238   IMMND_EVT_A2ND_CL_TIMEOUT = 93, /* Inform local IMMND of a library timeout. */
  239 
  240   IMMND_EVT_A2ND_ACCESSOR_GET = 94,  /* saImmOmAccessorGet_2 */
  241   IMMND_EVT_A2ND_CCB_VALIDATE = 95,  /* saImmOmCcbValidate */
  242   IMMND_EVT_A2ND_OI_IMPL_SET_2 = 96, /* saImmOiImplementerSet */
  243   IMMND_EVT_D2ND_IMPLSET_RSP_2 =
  244       97, /* Implementer set reply from D with impl id */
  245 
  246   IMMND_EVT_A2ND_OBJ_CREATE_2 = 98,    /* saImmOmCcbObjectCreate_o3 */
  247   IMMND_EVT_A2ND_OI_OBJ_CREATE_2 = 99, /* saImmOiRtObjectCreate_o3 */
  248 
  249   IMMND_EVT_A2ND_OBJ_SAFE_READ = 100, /* saImmOmCcbObjectRead */
  250 
  251   IMMND_EVT_D2ND_IMPLDELETE = 101, /* Applier delete */
  252 
  253   IMMND_EVT_MAX
  254 } IMMND_EVT_TYPE;
  255 /* Make sure the string array in immsv_evt.c matches the IMMND_EVT_TYPE enum. */
  256 
  257 /*****************************************************************************
  258  * Event Types of IMMD
  259  *****************************************************************************/
  260 typedef enum immd_evt_type {
  261   /* Locally generated Events */
  262   IMMD_EVT_MDS_INFO = 1,
  263 
  264   /* Events from IMMND */
  265   IMMD_EVT_ND2D_INTRO = 2, /*Identification message from IMMND to IMMD. */
  266   IMMD_EVT_ND2D_ANNOUNCE_LOADING = 3, /*Coordinator attempts start of load. */
  267   IMMD_EVT_ND2D_REQ_SYNC = 4,         /*Straggler requests sync.  */
  268   IMMD_EVT_ND2D_ANNOUNCE_DUMP = 5,    /*Dump/backup invoked */
  269   IMMD_EVT_ND2D_SYNC_START = 6,       /*Coordinator wants to start sync. */
  270   IMMD_EVT_ND2D_SYNC_ABORT = 7,       /*Coordinator wants to start sync. */
  271   IMMD_EVT_ND2D_ADMINIT_REQ = 8,      /* AdminOwnerInitialize */
  272   IMMD_EVT_ND2D_ACTIVE_SET = 9, /*ABT may need this or something similar */
  273   IMMD_EVT_ND2D_IMM_SYNC_INFO =
  274       10,                         /*May need this for Director<->standby sync */
  275   IMMD_EVT_ND2D_FEVS_REQ = 11,    /*Fake EVS over Director. */
  276   IMMD_EVT_ND2D_CCBINIT_REQ = 12, /* CcbInitialize */
  277   IMMD_EVT_ND2D_IMPLSET_REQ = 13, /*OiImplementerSet */
  278   IMMD_EVT_ND2D_OI_OBJ_MODIFY = 14, /*saImmOiRtObjectUpdate */
  279   IMMD_EVT_ND2D_DISCARD_IMPL = 15,  /*Internal discard implemener message */
  280   IMMD_EVT_ND2D_ABORT_CCB = 16,     /*Broadcast attempt to abort ccb. */
  281   IMMD_EVT_ND2D_ADMO_HARD_FINALIZE = 17, /* Broadcast hard admo finalize */
  282 
  283   IMMD_EVT_CB_DUMP = 18,
  284   IMMD_EVT_MDS_QUIESCED_ACK_RSP = 19,
  285   IMMD_EVT_RDA_CB = 20,
  286 
  287   IMMD_EVT_ND2D_PBE_PRTO_PURGE_MUTATIONS = 21, /* Broadcast for cleanup*/
  288 
  289   IMMD_EVT_ND2D_LOADING_FAILED = 22, /* Loading failed. */
  290 
  291   IMMD_EVT_ND2D_SYNC_FEVS_BASE = 23, /* Sync started based on this fevsCount */
  292 
  293   IMMD_EVT_ND2D_FEVS_REQ_2 = 24, /*Fake EVS over Director. */
  294 
  295   IMMD_EVT_ND2D_LOADING_COMPLETED = 25, /* loading completes sucessfully */
  296 
  297   IMMD_EVT_ND2D_2PBE_PRELOAD = 26, /* Redundant PBE preload stats to IMMD. */
  298 
  299   IMMD_EVT_ND2D_IMPLSET_REQ_2 = 27, /* OiImplementerSet */
  300 
  301   IMMD_EVT_ND2D_IMPLDELETE = 28, /* Delete non-used applier */
  302 
  303   IMMD_EVT_MAX
  304 } IMMD_EVT_TYPE;
  305 /* Make sure the string array in immsv_evt.c matches the IMMD_EVT_TYPE enum. */
  306 
  307 /*****************************************************************************
  308  Common Structs used in events
  309  *****************************************************************************/
  310 
  311 /* Struct used for passing only error response message */
  312 typedef struct immsv_saerr_info {
  313   SaAisErrorT error;
  314   IMMSV_ATTR_NAME_LIST *errStrings;
  315 } IMMSV_SAERR_INFO;
  316 
  317 /* Structure for passing MDS info to components */
  318 typedef struct immsv_mds_info {
  319   NCSMDS_CHG change; /* GONE, UP, DOWN, CHG ROLE  */
  320   MDS_DEST dest;
  321   MDS_SVC_ID svc_id;
  322   NODE_ID node_id;
  323   V_DEST_RL role;
  324 } IMMSV_MDS_INFO;
  325 
  326 typedef struct immsv_send_info {
  327   MDS_SVC_ID to_svc;      /* The service at the destination */
  328   MDS_DEST dest;          /* Who to send */
  329   NODE_ID node_id;        /* Node ID of sender */
  330   MDS_SENDTYPES stype;    /* Send type */
  331   MDS_SYNC_SND_CTXT ctxt; /* MDS Opaque context */
  332   uint8_t mSynReqCount;
  333   pid_t pid;
  334   uid_t uid;
  335   gid_t gid;
  336 } IMMSV_SEND_INFO;
  337 
  338 typedef struct immsv_fevs {
  339   SaUint64T sender_count;
  340   MDS_DEST reply_dest;  // The dest of the ND, which NDs should
  341   /* reply to (implementer&client  */
  342   /* on different nodes). */
  343   /* If zeroed, then reply to all or none. */
  344   SaImmHandleT client_hdl;  // Needed for aborting callbacks
  345   /* Holds nodeId and connection */
  346   IMMSV_OCTET_STRING msg;
  347   uint8_t isObjSync; /* Used by coord to avoid unpacking, saves exec.*/
  348   NODE_ID ex_immd_node_id;  // Old active IMMD info
  349 } IMMSV_FEVS;
  350 
  351 /****************************************************************************
  352  Requests IMMA --> IMMND
  353  ****************************************************************************/
  354 typedef struct immsv_init_req {
  355   SaVersionT version;
  356   SaUint32T client_pid;
  357 } IMMSV_INIT_REQ;
  358 
  359 typedef struct immsv_finalize_req {
  360   SaImmHandleT client_hdl;
  361 } IMMSV_FINALIZE_REQ;
  362 
  363 typedef struct immsv_a2nd_adminit_req {
  364   SaImmHandleT client_hdl;  // ND needs for callbacks
  365   IMMSV_OM_ADMIN_OWNER_INITIALIZE i;
  366   /*
  367      SaInvocationT                          invocation;
  368      SaTimeT                                timeout;
  369    */
  370 } IMMSV_A2ND_ADMINIT_REQ;
  371 
  372 typedef struct immsv_a2nd_admown_finalize {
  373   SaUint32T adm_owner_id;
  374 } IMMSV_A2ND_ADMOWN_FINALIZE;
  375 
  376 typedef struct immsv_a2nd_admown_set {
  377   /*SaImmAdminOwnerHandleT             adm_owner_id; */
  378   SaUint32T adm_owner_id;
  379   SaUint32T scope;
  380   IMMSV_OBJ_NAME_LIST *objectNames;
  381 } IMMSV_A2ND_ADMOWN_SET;
  382 
  383 typedef struct immsv_a2nd_search_op {
  384   SaImmHandleT client_hdl;
  385   SaUint32T searchId;
  386 } IMMSV_A2ND_SEARCH_OP;
  387 
  388 typedef struct immsv_oi_search_remote_rsp {
  389   IMMSV_OM_SEARCH_REMOTE sr;
  390   SaAisErrorT result;
  391 } IMMSV_OI_SEARCH_REMOTE_RSP;
  392 
  393 /****************************************************************************
  394  Resp to Requests IMMND --> IMMA
  395  ****************************************************************************/
  396 
  397 /* OM Init Response */
  398 typedef struct immsv_nd2a_init_rsp {
  399   SaImmHandleT immHandle;
  400   SaAisErrorT error;
  401   SaTimeT syncrTimeout;
  402 } IMMSV_ND2A_INIT_RSP;
  403 
  404 /* AdminOwnerInit Response */
  405 typedef struct immsv_nd2a_adminit_rsp {
  406   SaAisErrorT error;
  407   SaUint32T ownerId;
  408 } IMMSV_ND2A_ADMINIT_RSP;
  409 
  410 /* CcbInit Response */
  411 typedef struct immsv_nd2a_ccbinit_rsp {
  412   SaAisErrorT error;
  413   SaUint32T ccbId;
  414 } IMMSV_ND2A_CCBINIT_RSP;
  415 
  416 /* SearchInit Response */
  417 typedef struct immsv_nd2a_searchinit_rsp {
  418   SaAisErrorT error;
  419   SaUint32T searchId;
  420 } IMMSV_ND2A_SEARCHINIT_RSP;
  421 
  422 /* ImplementerSet Response */
  423 typedef struct immsv_nd2a_impl_set_rsp {
  424   SaAisErrorT error;
  425   SaUint32T implId;
  426 } IMMSV_ND2A_IMPLSET_RSP;
  427 
  428 /****************************************************************************
  429  IMMD --> IMMND
  430  ****************************************************************************/
  431 
  432 /*Reply from central director to node director on admin owner initialize ABT */
  433 typedef struct immsv_d2nd_adminit {
  434   SaUint32T globalOwnerId;
  435   IMMSV_OM_ADMIN_OWNER_INITIALIZE i;
  436 } IMMSV_D2ND_ADMINIT;
  437 
  438 typedef struct immsv_d2nd_ccbinit {
  439   SaUint32T globalCcbId;
  440   IMMSV_OM_CCB_INITIALIZE i;
  441 } IMMSV_D2ND_CCBINIT;
  442 
  443 typedef enum immsv_coord_type {
  444   IMMSV_NOT_COORD = 0, /* payload cannot be coordinator, except headless */
  445   IMMSV_SC_COORD = 1, /* controller to be coordinator */
  446   IMMSV_2PBE_PRELOAD = 2,
  447   IMMSV_2PBE_SYNC = 3,
  448   IMMSV_VETERAN_COORD = 4, /* veteran node after headless can be coordinator */
  449   IMMSV_UNKNOWN = 5 /* Unknown node will be ordered reboot */
  450 } IMMSV_COORD_TYPE;
  451 
  452 typedef struct immsv_d2nd_control {
  453   SaUint32T nodeId;
  454   SaUint32T rulingEpoch;
  455   SaUint64T fevsMsgStart;
  456   SaUint32T ndExecPid;
  457   IMMSV_COORD_TYPE canBeCoord;
  458   uint8_t isCoord;
  459   uint8_t syncStarted;
  460   SaUint32T nodeEpoch;
  461   uint8_t pbeEnabled; /* See pbeEnabled for immsv_nd2d_control directly below.
  462                          In general only 0 or 1 would be used D => ND. */
  463 
  464   IMMSV_OCTET_STRING dir;
  465   IMMSV_OCTET_STRING xmlFile;
  466   IMMSV_OCTET_STRING pbeFile;
  467 
  468   NODE_ID ex_immd_node_id;  // Old active IMMD info
  469 } IMMSV_D2ND_CONTROL;
  470 
  471 /****************************************************************************
  472  IMMND --> IMMD
  473  ****************************************************************************/
  474 
  475 typedef struct immsv_nd2d_control {
  476   SaUint32T ndExecPid;
  477   SaUint32T epoch;
  478   uint8_t
  479       refresh;        /* refresh>0 => Refresh of epoch; refresh==2 => IMMD restart
  480                          intro.*/
  481   uint8_t pbeEnabled; /* OpenSaf4.4:
  482                          2:not-enabled-not-configured can be convertred to 0 in
  483                          immd. 3:not-enabled-configured 4:enabled-configured.
  484                          For 4 and 3, file parameters (dir/xmlf/pbef) *may* be
  485                          appended.
  486 
  487                          OpenSaf4.3 and earlier:
  488                          0:not-enabled
  489                          1: enabled. */
  490   IMMSV_OCTET_STRING dir;
  491   IMMSV_OCTET_STRING xmlFile;
  492   IMMSV_OCTET_STRING pbeFile;
  493 
  494   /* OpenSaf5.0: At restart of IMMD sv-id, IMMND gives feeedback on:
  495    - fevs_count
  496    - admo_id_count
  497    - ccb_id_count
  498    - impl_count
  499   */
  500   SaUint64T fevs_count;     // Max received at IMMND for Fevs Count
  501   SaUint32T admo_id_count;  // Max received at IMMND for AdminOwner ID
  502   SaUint32T ccb_id_count;   // Max received at IMMND for CCB ID
  503   SaUint32T impl_count;     // Max received at IMMND for Implementer ID
  504   NODE_ID ex_immd_node_id;  // Old active IMMD info
  505 } IMMSV_ND2D_CONTROL;
  506 
  507 typedef struct immsv_nd2d_2_pbe {
  508   SaUint32T epoch;
  509   SaUint32T maxCcbId;
  510   SaUint32T maxCommitTime;
  511   SaUint64T maxWeakCcbId; /* PRT-ops, class-create/delete */
  512   SaUint32T maxWeakCommitTime;
  513 } IMMSV_ND2D_2_PBE;
  514 
  515 typedef struct immsv_nd2d_adminit_req {
  516   SaImmHandleT client_hdl;
  517   IMMSV_OM_ADMIN_OWNER_INITIALIZE i;
  518 } IMMSV_ND2D_ADMINIT_REQ;
  519 
  520 typedef struct immsv_nd2d_implset_req {
  521   IMMSV_OI_IMPLSET_REQ r;
  522   MDS_DEST reply_dest; /*The dest of the originating ND */
  523 } IMMSV_ND2D_IMPLSET_REQ;
  524 
  525 /* IMMA Local Events */
  526 typedef struct imma_tmr_info {
  527   uint32_t type;
  528   SaImmAdminOwnerHandleT adm_owner_hdl;
  529   SaImmHandleT client_hdl;
  530   SaInvocationT invocation;
  531 } IMMA_TMR_INFO;
  532 
  533 /* Used in both ND2D and D2ND events */
  534 typedef struct immsv_impldelete {
  535   SaUint32T size;
  536   IMMSV_OCTET_STRING *implNameList; // List of implementer names
  537 } IMMSV_IMPLDELETE;
  538 
  539 /******************************************************************************
  540  IMMA Event Data Struct
  541  ******************************************************************************/
  542 typedef struct imma_evt {
  543   IMMA_EVT_TYPE type;
  544   union {
  545     IMMSV_ND2A_INIT_RSP initRsp;
  546     IMMSV_SAERR_INFO errRsp;
  547     IMMSV_ND2A_ADMINIT_RSP admInitRsp;
  548     IMMSV_ND2A_CCBINIT_RSP ccbInitRsp;
  549     IMMSV_ND2A_SEARCHINIT_RSP searchInitRsp;
  550     IMMSV_OM_RSP_SEARCH_NEXT *searchNextRsp;
  551     IMMSV_OM_RSP_SEARCH_BUNDLE_NEXT *searchBundleNextRsp;
  552     IMMSV_OM_SEARCH_REMOTE searchRemote;
  553     IMMSV_OM_ADMIN_OP_INVOKE admOpReq;  // For the OI callback.
  554     IMMSV_OI_ADMIN_OP_RSP admOpRsp;
  555     IMMSV_OM_CCB_OBJECT_CREATE objCreate;  // callback
  556     IMMSV_OM_CCB_OBJECT_DELETE objDelete;  // callback
  557     IMMSV_OM_CCB_OBJECT_MODIFY objModify;  // callback
  558     IMMSV_OM_CCB_COMPLETED ccbCompl;
  559     IMMSV_OM_CLASS_DESCR classDescr;
  560     IMMSV_ND2A_IMPLSET_RSP implSetRsp;
  561     IMMA_TMR_INFO tmr_info;
  562     IMMA_SYNCR_TIMEOUT_UPDATE immaTimeoutUpdate;
  563   } info;
  564 
  565 } IMMA_EVT;
  566 
  567 /******************************************************************************
  568  IMMND Event Data Structures
  569  ******************************************************************************/
  570 typedef struct immnd_evt {
  571   bool dont_free_me;
  572   bool unused1; /* Conversion NCS_BOOL->bool */
  573   bool unused2; /* Conversion NCS_BOOL->bool */
  574   bool unused3; /* Conversion NCS_BOOL->bool */
  575   SaAisErrorT error;
  576   IMMND_EVT_TYPE type;
  577   union {
  578     /* IMMA --> IMMND */
  579     IMMSV_INIT_REQ initReq;
  580     IMMSV_FINALIZE_REQ finReq;
  581     IMMSV_A2ND_ADMINIT_REQ adminitReq;
  582     IMMSV_OM_CCB_INITIALIZE ccbinitReq;
  583     IMMSV_OI_IMPLSET_REQ implSet;
  584 
  585     IMMSV_A2ND_ADMOWN_FINALIZE admFinReq;
  586     IMMSV_A2ND_ADMOWN_SET admReq;
  587 
  588     IMMSV_OM_ADMIN_OP_INVOKE admOpReq;
  589     IMMSV_FEVS fevsReq;  // Prepacked message "virtual EVS"
  590 
  591     IMMSV_OI_ADMIN_OP_RSP admOpRsp;
  592     IMMSV_OI_CCB_UPCALL_RSP ccbUpcallRsp;
  593     /* used both for normal OI rsp and for aug ccb Ticket #1963 */
  594 
  595     IMMSV_OM_CLASS_DESCR classDescr;
  596 
  597     IMMSV_OM_CCB_OBJECT_CREATE objCreate;
  598     IMMSV_OM_CCB_OBJECT_MODIFY objModify;
  599     IMMSV_OM_CCB_OBJECT_DELETE objDelete;
  600     IMMSV_OM_OBJECT_SYNC obj_sync;
  601     IMMSV_OM_FINALIZE_SYNC finSync;
  602 
  603     SaUint32T ccbId;                // CcbApply, CcbFinalize, CCbAbort
  604     IMMSV_A2ND_SEARCH_OP searchOp;  // SearchNext, SearchFinalize
  605     IMMSV_OM_SEARCH_INIT searchInit;
  606     IMMSV_OI_SEARCH_REMOTE_RSP rtAttUpdRpl;
  607     IMMSV_OM_SEARCH_REMOTE searchRemote;
  608     IMMSV_OM_RSP_SEARCH_REMOTE rspSrchRmte;
  609 
  610     /* IMMD --> IMMND */
  611     IMMSV_D2ND_CONTROL ctrl;
  612     IMMSV_D2ND_ADMINIT adminitGlobal;
  613     IMMSV_D2ND_CCBINIT ccbinitGlobal;
  614 
  615     IMMSV_MDS_INFO mds_info; /* Locally generated events */
  616 
  617     SaUint64T syncFevsBase; /* FevsCount that sync iterator is
  618                                based on . */
  619 
  620     IMMSV_IMPLDELETE impl_delete;
  621   } info;
  622 } IMMND_EVT;
  623 
  624 /* IMMD Local Events */
  625 typedef struct immd_tmr_info {
  626   uint32_t type;
  627   union {
  628     MDS_DEST immnd_dest;
  629   } info;
  630 } IMMD_TMR_INFO;
  631 
  632 typedef struct { PCS_RDA_ROLE io_role; } IMMSV_RDA_INFO;
  633 
  634 /******************************************************************************
  635  IMMD Event Data Structures
  636  ******************************************************************************/
  637 typedef struct immd_evt {
  638   IMMD_EVT_TYPE type;
  639   union {
  640     /* IMMND --> IMMD */
  641     IMMSV_ND2D_CONTROL ctrl_msg;
  642     IMMSV_ND2D_ADMINIT_REQ admown_init;
  643     IMMSV_OM_CCB_INITIALIZE ccb_init;
  644     IMMSV_ND2D_IMPLSET_REQ impl_set;
  645     IMMSV_OM_CCB_OBJECT_MODIFY objModify; /* Actually OI runtime obj update */
  646     SaUint32T ccbId;                      /*For CcbAbort */
  647     SaUint32T admoId;                     /*For admo ahrd finalize */
  648 
  649     IMMSV_FEVS fevsReq;  // Prepacked message "virtual EVS"
  650 
  651     IMMD_TMR_INFO tmr_info;
  652     IMMSV_MDS_INFO mds_info;
  653     IMMSV_RDA_INFO rda_info;
  654 
  655     IMMSV_SYNC_FEVS_BASE syncFevsBase; /* FevsCount that sync is
  656                                           based on . */
  657     IMMSV_ND2D_2_PBE pbe2; /* Stats about a pbe file (redundant pbe)*/
  658 
  659     IMMSV_IMPLDELETE impl_delete;
  660   } info;
  661 } IMMD_EVT;
  662 
  663 /******************************************************************************
  664  IMMSV Event Data Struct
  665  ******************************************************************************/
  666 typedef struct immsv_evt {
  667   struct immsv_evt *next;
  668   IMMSV_EVT_TYPE type;
  669   union {
  670     IMMA_EVT imma;
  671     IMMND_EVT immnd;
  672     IMMD_EVT immd;
  673   } info;
  674   IMMSV_SEND_INFO sinfo; /* MDS Sender information */
  675 } IMMSV_EVT;
  676 
  677 /* Event Declerations */
  678 
  679 uint32_t immsv_evt_enc_flat(/*EDU_HDL *edu_hdl, */ IMMSV_EVT *i_evt,
  680                             NCS_UBAID *o_ub);
  681 uint32_t immsv_evt_dec_flat(/*EDU_HDL *edu_hdl, */ NCS_UBAID *i_ub,
  682                             IMMSV_EVT *o_evt);
  683 uint32_t immsv_evt_enc(/*EDU_HDL *edu_hdl, */ IMMSV_EVT *i_evt,
  684                        NCS_UBAID *o_ub);
  685 uint32_t immsv_evt_dec(/*EDU_HDL *edu_hdl, */ NCS_UBAID *i_ub,
  686                        IMMSV_EVT *o_evt);
  687 
  688 void immsv_evt_enc_inline_string(NCS_UBAID *o_ub, IMMSV_OCTET_STRING *os);
  689 
  690 void immsv_evt_dec_inline_string(NCS_UBAID *i_ub, IMMSV_OCTET_STRING *os);
  691 
  692 void immsv_evt_free_att_val(IMMSV_EDU_ATTR_VAL *v, SaImmValueTypeT t);
  693 void immsv_evt_free_att_val_raw(IMMSV_EDU_ATTR_VAL *v, long t);
  694 void immsv_free_attr_list_raw(IMMSV_EDU_ATTR_VAL_LIST *al, const long avt);
  695 
  696 const char *immsv_get_immnd_evt_name(unsigned int id);
  697 void immsv_msg_trace_send(MDS_DEST to, IMMSV_EVT *evt);
  698 void immsv_msg_trace_rec(MDS_DEST from, IMMSV_EVT *evt);
  699 
  700 void immsv_free_attrmods(IMMSV_ATTR_MODS_LIST *p);
  701 void immsv_evt_free_admo(IMMSV_ADMO_LIST *p);
  702 void immsv_evt_free_impl(IMMSV_IMPL_LIST *p);
  703 void immsv_evt_free_classList(IMMSV_CLASS_LIST *p);
  704 void immsv_evt_free_attrNames(IMMSV_ATTR_NAME_LIST *p);
  705 void immsv_free_attrvalues_list(IMMSV_ATTR_VALUES_LIST *avl);
  706 void immsv_free_attrdefs_list(IMMSV_ATTR_DEF_LIST *adp);
  707 void immsv_evt_free_name_list(IMMSV_OBJ_NAME_LIST *p);
  708 void immsv_evt_free_ccbOutcomeList(IMMSV_CCB_OUTCOME_LIST *o);
  709 
  710 #ifdef __cplusplus
  711 }
  712 #endif
  713 
  714 #endif  // IMM_COMMON_IMMSV_EVT_H_