#include "os.h"
#include "common.h"
static void
{
char sempRequest[512];
void *sempReplyBuf_p;
solClient_uint32_t sempReplyBufSize;
solClient_uint32_t ix;
snprintf(sempRequest, sizeof(sempRequest),
"<rpc semp-version=\"%s\"><show><client><name>*</name></client></show></rpc>",
sempVersion);
common_handleError ( rc, "solClient_msg_alloc()" );
return;
}
common_handleError ( rc, "solClient_session_getCapability()" );
goto freeMsg;
}
snprintf ( sempTopic,
sizeof ( sempTopic ), COMMON_SEMP_TOPIC_FORMAT, routerName.
value.
string );
destination.
dest = sempTopic;
common_handleError ( rc, "solClient_msg_setDestination()" );
goto freeMsg;
}
( void * ) sempRequest,
( solClient_uint32_t ) strlen ( sempRequest ) ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "solClient_msg_setBinaryAttachmentPtr()" );
goto freeMsg;
}
printf ( "REQUEST: %s\n", sempRequest );
printf ( "REQUEST ADDRESS: %s\n", sempTopic );
common_handleError ( rc, "solClient_msg_getBinaryAttachmentPtr()" );
goto freeReplyMsg;
}
printf ( "REPLY: " );
for ( ix = 0; ix < sempReplyBufSize; ix++ ) {
printf ( "%c", ( ( char * ) sempReplyBuf_p )[ix] );
}
printf ( "\n" );
freeReplyMsg:
common_handleError ( rc, "solClient_msg_free()" );
goto freeMsg;
}
} else {
common_handleError ( rc, "solClient_session_sendRequest()" );
goto freeMsg;
}
freeMsg:
common_handleError ( rc, "solClient_msg_free()" );
}
}
int
main ( int argc, char *argv[] )
{
char sempVersion[256];
struct commonOptions commandOpts;
char positionalParms[] = "\tSempVersion Semp version (default 'soltr/5_1').\n";
printf ( "\nsempGetOverMb.c (Copyright 2009-2024 Solace Corporation. All rights reserved.)\n" );
initSigHandler ( );
common_initCommandOptions(&commandOpts,
( USER_PARAM_MASK ),
( HOST_PARAM_MASK |
PASS_PARAM_MASK |
LOG_LEVEL_MASK |
USE_GSS_MASK |
ZIP_LEVEL_MASK));
if ( common_parseCommandOptions ( argc, argv, &commandOpts, positionalParms ) == 0 ) {
exit(1);
}
if (optind < argc ) {
strncpy(sempVersion, argv[optind], sizeof(sempVersion));
} else {
strncpy(sempVersion, "soltr/5_1", sizeof(sempVersion));
}
common_handleError ( rc, "solClient_initialize()" );
goto notInitialized;
}
common_printCCSMPversion ( );
&context_p, &contextFuncInfo,
sizeof ( contextFuncInfo ) ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "solClient_context_create()" );
goto cleanup;
}
if ( ( rc = common_createAndConnectSession ( context_p,
&session_p,
common_messageReceiveCallback,
common_eventCallback, NULL, &commandOpts ) ) !=
SOLCLIENT_OK ) {
common_handleError ( rc, "common_createAndConnectSession()" );
goto cleanup;
}
sempRequestRequestAndReply ( session_p, sempVersion );
common_handleError ( rc, "solClient_session_disconnect()" );
}
cleanup:
common_handleError ( rc, "solClient_cleanup()" );
}
notInitialized:
return 0;
return 0;
}