Specifications
100 Data Path Routing (DPR) HighWire MTP-2 - 1.2, September 4, 2002
Availability Provided as a component of the SBE HighWire and LinkWARE Support
Packages.
Commands Commands to the DPR service are sent in the control part of the putmsg call.
The first 32-bit integer in the control message's buffer consists of the
command to be executed in the low order byte and the value
DPR_PROTO_CODE in the next higher byte. Additional parameters for the
command follow in the control buffer or, in the case of DPR_WRITE, in the
data buffer. The structures that define the contents of the control buffer are
defined in dprd_if.h and described with their associated commands below.
The response to the command is received with a getmsg call. In the control
buffer received the first 32-bit word contains an error code in the upper 16-
bits and the original command in the low order 16-bits. These are accessible
in the command associated structures as elements xxxx_fun and xxxx_err,
where xxxx depends on the structure for the command.
DPR_READ. Reads the current DPR connection matrix.
The putmsg control buffer is a structure of type dpr_rdwr_t with the rdwr_size
element set to the maximum number of connections to be returned. The
getmsg control buffer returned is also a dpr_rdwr_t structure with the error
code in the rdwr_err element and the number of connections returned in the
rdwr_size element. The getmsg data buffer must be large enough to receive
MAP structures for the maximum number of connections specified in the
putmsg call. See DPR_CONNECT for information on the MAP structure.
The sbe_dprRead routine from libsbe listed below shows one method to issue
this command and get the response.
int
sbe_dprRead (int fd, MAP *buf, int size)
{
int err; /* err code */
int flag; /* flag, set to non-priority msg */
struct strbuf rdctl; /* structure for control part of msg */
struct strbuf rddata; /* structure for data part of msg */
dpr_rdwr_t rdproto; /* request/response control structure */
/*
* Set up the DPR_READ command and send it to the board.
*/
rdproto.rdwr_fun = (DPR_PROTO_CODE << 8) | DPR_READ;
rdproto.rdwr_size = size;
rdctl.maxlen = sizeof (rdproto);
rdctl.len = sizeof (rdproto);
rdctl.buf = (char *)&rdproto;
if (!(err = putmsg (fd, &rdctl, 0, 0))) {
/*
* Set up to get the response from the board.
*/
rdctl.maxlen = sizeof (rdproto);
rdctl.len = 0;
rdctl.buf = (char *)&rdproto;
rddata.maxlen = size * sizeof (MAP);