Пример #1
0
static void messageContent(ParserControl *parm, parseUnion *stateUnion)
{
	parseUnion lvalp = {0};
	ct = localLex(stateUnion, parm);
	if(ct == XTOK_SIMPLERSP) {
		simpleRspContent(parm, (parseUnion*)&stateUnion->xtokSimpleRespContent);
		ct = localLex(stateUnion, parm);
		if(ct == ZTOK_SIMPLERSP) {
		}
		else {
			parseError("ZTOK_SIMPLERSP", ct, parm);
		}
	}
	else if(ct == XTOK_SIMPLEEXPREQ) {
		exportIndication(parm, stateUnion);
		ct = localLex(stateUnion, parm);
		if(ct == ZTOK_SIMPLEEXPREQ) {
		}
		else {
			parseError("ZTOK_SIMPLEEXPREQ", ct, parm);
		}
	}
	else {
		parseError("XTOK_SIMPLERSP", ct, parm);
	}
}
Пример #2
0
CMPIStatus
deliverInd(const CMPIObjectPath * ref, const CMPIArgs * in, CMPIInstance * ind)
{
  _SFCB_ENTER(TRACE_INDPROVIDER, "deliverInd");
  CMPIInstance   *hci,
                 *sub;
  CMPIStatus      st = { CMPI_RC_OK, NULL };
  CMPIString     *dest;
  char            strId[64];
  ExpSegments     xs;
  UtilStringBuffer *sb;
  static int      id = 1;
  char           *resp;
  char           *msg;

  if ((hci = internalProviderGetInstance(ref, &st)) == NULL) {
    setStatus(&st, CMPI_RC_ERR_NOT_FOUND, NULL);
    _SFCB_RETURN(st);
  }
  dest = CMGetProperty(hci, "destination", NULL).value.string;
  _SFCB_TRACE(1, ("--- destination: %s\n", (char *) dest->hdl));
  sub = CMGetArg(in, "subscription", NULL).value.inst;

  sprintf(strId, "%d", id++);
  xs = exportIndicationReq(ind, strId);
  sb = segments2stringBuffer(xs.segments);
  if (exportIndication
      ((char *) dest->hdl, (char *) sb->ft->getCharPtr(sb), &resp, &msg)) {
    setStatus(&st, CMPI_RC_ERR_FAILED, NULL);
  }
  RespSegment     rs = xs.segments[5];
  UtilStringBuffer *usb = (UtilStringBuffer *) rs.txt;
  CMRelease(usb);
  CMRelease(sb);
  if (resp)
    free(resp);
  if (msg)
    free(msg);
  _SFCB_RETURN(st);
}