/*
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
* srm_clntmsgs.h
*
* Defines the format of messages exchanged between the srm-client
* thread and the srmlib part of the clients of SRM.
*/
#ifndef SRM_CLNTMSGS_H
#define SRM_CLNTMSGS_H
#ident "$Id: srm_clntmsgs.h,v 1.1 2000/08/31 19:16:32 vasa Exp $"
typedef enum {
SMCCMD_REGISTER = 1,
SMCCMD_UNREG = 2,
SMCCMD_ALLOCATE = 3,
SMCCMD_RELEASE = 4,
SMCCMD_PROBE = 5,
SMCCMD_BIND = 6,
SMCCMD_UNBIND = 7,
SMCCMD_MODIFYBIND = 8,
SMCCMD_BINDINFO = 9,
SMCCMD_DISCOVER = 10,
SMCCMD_MODIFYMON = 11,
SMCCMD_DUMP = 12,
SMCCMD_RESINFO = 13,
SMCCMD_RESSTAT = 14,
SMCCMD_MAX = 15
} smc_cmd_t;
/*
* Print function: sc_print_send_cmd(smc_resp_t);
*/
typedef enum {
SMCRESP_REGISTER = SMCCMD_REGISTER,
SMCRESP_UNREG = SMCCMD_UNREG,
SMCRESP_ALLOCATE = SMCCMD_ALLOCATE,
SMCRESP_RELEASE = SMCCMD_RELEASE,
SMCRESP_PROBE = SMCCMD_PROBE,
SMCRESP_BIND = SMCCMD_BIND,
SMCRESP_UNBIND = SMCCMD_UNBIND,
SMCRESP_MODIFYBIND = SMCCMD_MODIFYBIND,
SMCRESP_BINDINFO = SMCCMD_BINDINFO,
SMCRESP_DISCOVER = SMCCMD_DISCOVER,
SMCRESP_MODIFYMON = SMCCMD_MODIFYMON,
SMCRESP_DUMP = SMCCMD_DUMP,
SMCRESP_RESINFO = SMCCMD_RESINFO,
SMCRESP_RESSTAT = SMCCMD_RESSTAT,
SMCRESP_LOCAL_MAX = SMCCMD_MAX,
SMCRESP_POLL = 100, /* responses without requests */
SMCRESP_ERROR
} smc_resp_t;
/* A request sent by a srm client process (srm-library) to
* the srmd (srm-client thread) over the IPC link is of the following
* format.
|---------------------------------------|
| header (smc_req_msg_t) |
|---------------------------------------|
| node 1 (uint32_t) |
|---------------------------------------|
| node 2 |
|---------------------------------------|
| . |
| . |
|---------------------------------------|
| node node_cnt |
|---------------------------------------|
|binding name (null terminated char str)| (optional)
|---------------------------------------|
|discover type ( '' )| (optional)
|---------------------------------------|
| res_name 1 (null teminated char str) |
| res_type 1 (null terminated char str) |
|---------------------------------------|
| . |
| . |
| . |
|---------------------------------------|
| res_name res_cnt |
| res_type res_cnt |
|---------------------------------------|
*/
typedef uint32_t srm_version_t; /* SRM library version */
typedef struct smc_req_msg_s {
uint32_t hdl; /* Request handle generated by the
* srm library to identify a request */
srm_version_t version; /* SRM library version number. The
* SRM daemon rejects requests from
* a client that is linked with
* unsupported SRM library version */
smc_cmd_t type; /* Request cmd type ALLOC/RELEASE/.. */
uint32_t grp_id; /* Group id of the requesting app */
uint32_t flags; /* Request options - can be either
* srm_flags_t or srm_registerflags_t */
uint32_t priority; /* Request priority, valid only
* for allocate/release requests */
uint32_t res_cnt; /* Number of resources this request is
* for, i.e., number of name/type pairs
* to expect after the header.
* Relevant only for ALLOC/REL/PROBE/
* BINDINFO/RESINFO/RESSTAT requests. */
uint32_t node_cnt; /* Number of nodes this request should
* be executed on, i.e., number of
* nodes to expect after the header.
* Relevant only for probe/exclusive
* probe requests. */
int dumplevel; /* Dumplevel for the srm_dump request
* only. */
uint32_t len; /* Total length of the request,
* inclusive of the header. */
char data[1];
} smc_req_msg_t;
/* A response or an alarm message sent by the srmd (srm-client thread) to
* a srm client process (srm library) over the IPC link is of the following
* format.
|--------------------------------------------|
| header (smc_resp_msg_t) |
|--------------------------------------------|
| res_name 1 (null teminated char str) |
| res_type 1 (null terminated char str) |
| - - - - - - - - - - - - - - |
| request status (srm_res_req_status_t) |
| - - - - - - - - - - - - - - |
| status at node1 (sc_per_node_probe_resp_t) |
| . |
| . |
| status at node node_cnt |
| - - - - - - - - - - - - - - |
| binding res_name1 information (BINDINFO) |
| - - - - - - - - - - - - - - |
| resource res_name1 information (RESSTAT) |
| - - - - - - - - - - - - - - |
| resource res_name1 information (RESINFO) |
| - - - - - - - - - - - - - - |
| poll information for res1 (POLL) |
|--------------------------------------------|
| . |
| . |
| . |
|--------------------------------------------|
| res_name res_cnt (null teminated char str) |
| res_type res_cnt (null terminated char str)|
| - - - - - - - - - - - - - - |
| request status (srm_res_req_status_t) |
| - - - - - - - - - - - - - - |
| status at node1 (sc_per_node_probe_resp_t) |
| . |
| . |
| status at node node_cnt |
| - - - - - - - - - - - - - - |
| binding res_name res_cnt info (BINDINFO) |
| - - - - - - - - - - - - - - |
| resource res_name res_cnt info (RESSTAT) |
| - - - - - - - - - - - - - - |
| resource res_name res_cnt info (RESINFO) |
| - - - - - - - - - - - - - - |
| poll info for res res_cnt (POLL) |
|--------------------------------------------|
BINDINFO reply format for each binding resource
|--------------------------------------------|
| binding name (null terminated char str) |
| binding type (null terminated char str) |
| binding information (sc_per_binding_resp_t)|
|--------------------------------------------|
| res_name 1 (null teminated char str) |
| res_type 1 (null terminated char str) |
|--------------------------------------------|
| . |
| . |
| . |
|--------------------------------------------|
| res_name res_cnt (null teminated char str) |
| res_type res_cnt (null terminated char str)|
|--------------------------------------------|
RESSTAT reply format for each resource
|--------------------------------------------|
| resource name (null terminated char str) |
| resource type (null terminated char str) |
| resource stats (sc_per_resstat_resp_t) |
|--------------------------------------------|
RESINFO reply format for each resource
|--------------------------------------------|
| resource name (null terminated char str) |
| resource type (null terminated char str) |
| resource info (sc_per_resource_resp_t) |
|--------------------------------------------|
POLL reply format for each resource
|--------------------------------------------|
| resource name (null terminated char str) |
| resource type (null terminated char str) |
| poll info (sc_per_res_pollresp_t) |
|--------------------------------------------|
*/
#define SMC_ALARM_HDL 0
typedef struct smc_resp_msg_t {
uint32_t hdl; /* Srmd returns the request
* handle in the response, passed
* to it by the library in the
* request. If the message is an
* alarm generated by srmd, this
* field is SMC_ALARM_HDL (=0),
* else it is a positive integer */
smc_resp_t type; /* Response type - ALLOC/ERROR/.. */
ci_err_t status; /* Request status */
srm_res_req_status_t bind_status; /* Status information for a
* bind operation */
uint32_t res_cnt; /* Number of resources this response
* is for, i.e., number of name/type
* pairs to expect after the header.
* Relevant only for ALLOC/PROBE/POLL/
* ... requests. */
uint32_t node_cnt; /* Number of nodes this response is
* from, only for PROBE responses */
uint32_t len; /* Total length of the response,
* inclusive of the header. */
char data[1];
} smc_resp_msg_t;
#endif /* SRM_CLNTMSGS_H */