Skip to content

Commit

Permalink
Fixes EUCA-3962
Browse files Browse the repository at this point in the history
Merge branch 'team/clc-dev/CHUCK-COVERITY-32' into maint/3.2/testing

Conflicts:
	util/sensor.c
  • Loading branch information
gelinasc committed Nov 22, 2012
2 parents d2c216a + 5e18cea commit e77086e
Show file tree
Hide file tree
Showing 16 changed files with 580 additions and 527 deletions.
75 changes: 41 additions & 34 deletions gatherlog/GLclient.c
Expand Up @@ -65,39 +65,46 @@
#include <gl-client-marshal.h>
#include <euca_auth.h>

int main(int argc, char **argv) {
axutil_env_t * env = NULL;
axis2_char_t * client_home = NULL;
axis2_char_t endpoint_uri[256], *tmpstr;
axis2_stub_t * stub = NULL;
int rc, i;
char *euca_home;

snprintf(endpoint_uri, 256," http://%s/axis2/services/EucalyptusGL", argv[1]);
// env = axutil_env_create_all("/tmp/GLclient.log", AXIS2_LOG_LEVEL_TRACE);
env = axutil_env_create_all("/tmp/fooh", AXIS2_LOG_LEVEL_TRACE);
client_home = AXIS2_GETENV("AXIS2C_HOME");
if (!client_home) {
printf("must have AXIS2C_HOME set\n");
}
stub = axis2_stub_create_EucalyptusGL(env, client_home, endpoint_uri);
int main(int argc, char **argv)
{
axutil_env_t *env = NULL;
axis2_char_t *client_home = NULL;
axis2_char_t endpoint_uri[256], *tmpstr;
axis2_stub_t *stub = NULL;
int rc, i;
char *euca_home;

if (!strcmp(argv[2], "getLogs")) {
char *clog, *nlog, *hlog, *alog;
rc = gl_getLogs(argv[3], &clog, &nlog, &hlog, &alog, env, stub);
if (!rc) {
if (clog) printf("CLOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)clog, strlen(clog)));
if (nlog) printf("NLOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)nlog, strlen(nlog)));
if (hlog) printf("HLOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)hlog, strlen(hlog)));
if (alog) printf("ALOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)alog, strlen(alog)));
}
} else if (!strcmp(argv[2], "getKeys")) {
char *cccert, *nccert;
rc = gl_getKeys(argv[3], &cccert, &nccert, env, stub);
if (!rc) {
if (cccert) printf("CCCERT\n----------\n%s\n-----------\n", base64_dec((unsigned char *)cccert, strlen(cccert)));
if (nccert) printf("NCCERT\n----------\n%s\n-----------\n", base64_dec((unsigned char *)nccert, strlen(nccert)));
}
}
exit(0);
snprintf(endpoint_uri, 256, " http://%s/axis2/services/EucalyptusGL", argv[1]);
// env = axutil_env_create_all("/tmp/GLclient.log", AXIS2_LOG_LEVEL_TRACE);
env = axutil_env_create_all("/tmp/fooh", AXIS2_LOG_LEVEL_TRACE);
client_home = AXIS2_GETENV("AXIS2C_HOME");
if (!client_home) {
printf("must have AXIS2C_HOME set\n");
}
stub = axis2_stub_create_EucalyptusGL(env, client_home, endpoint_uri);

if (!strcmp(argv[2], "getLogs")) {
char *clog, *nlog, *hlog, *alog;
rc = gl_getLogs(argv[3], &clog, &nlog, &hlog, &alog, env, stub);
if (!rc) {
if (clog)
printf("CLOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)clog, strlen(clog)));
if (nlog)
printf("NLOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)nlog, strlen(nlog)));
if (hlog)
printf("HLOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)hlog, strlen(hlog)));
if (alog)
printf("ALOG\n----------\n%s\n-----------\n", base64_dec((unsigned char *)alog, strlen(alog)));
}
} else if (!strcmp(argv[2], "getKeys")) {
char *cccert, *nccert;
rc = gl_getKeys(argv[3], &cccert, &nccert, env, stub);
if (!rc) {
if (cccert)
printf("CCCERT\n----------\n%s\n-----------\n", base64_dec((unsigned char *)cccert, strlen(cccert)));
if (nccert)
printf("NCCERT\n----------\n%s\n-----------\n", base64_dec((unsigned char *)nccert, strlen(nccert)));
}
}
exit(0);
}
4 changes: 4 additions & 0 deletions gatherlog/Makefile
Expand Up @@ -121,6 +121,10 @@ deploy:
# no ws
$(INSTALL) $(DESTDIR)$(AXIS2C_SERVICES)/$(SERVICE_NAME)/services_noWS.xml $(DESTDIR)$(AXIS2C_SERVICES)/$(SERVICE_NAME)/services.xml

indent:
@indent *.[ch] -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i4 -ut -ip0 -l200 -lp -npcs -nprs -npsl -sai -saf -saw -ncs -nsc -sob -nfca -ss -ts4 -il0 -nip
@\rm *.*~

clean:
rm -f $(SERVICE_SO) *.o $(CLIENT) *~* *#*

Expand Down
122 changes: 62 additions & 60 deletions gatherlog/gl-client-marshal-adb.c
Expand Up @@ -65,66 +65,68 @@
#include <gl-client-marshal.h>
#include <euca_auth.h>

int gl_getLogs(char *service, char **outCClog, char **outNClog, char **outHlog, char **outAlog, axutil_env_t *env, axis2_stub_t *stub) {
char *outservice;

adb_GetLogsResponse_t *out;
adb_getLogsResponseType_t *response;

adb_GetLogs_t *in;
adb_getLogsType_t *request;

request = adb_getLogsType_create(env);
adb_getLogsType_set_userId(request, env, "eucalyptus");
adb_getLogsType_set_correlationId(request, env, "12345678");
adb_getLogsType_set_serviceTag(request, env, service);

in = adb_GetLogs_create(env);
adb_GetLogs_set_GetLogs(in, env, request);

out = axis2_stub_op_EucalyptusGL_GetLogs(stub, env, in);
if (!out) {
printf("ERROR: operation call failed\n");
return(1);
}
response = adb_GetLogsResponse_get_GetLogsResponse(out, env);

//outservice = adb_getLogsResponseType_get_serviceTag(response, env);
*outCClog = adb_getLogsResponseType_get_CCLog(response, env);
*outNClog = adb_getLogsResponseType_get_NCLog(response, env);
*outHlog = adb_getLogsResponseType_get_httpdLog(response, env);
*outAlog = adb_getLogsResponseType_get_axis2Log(response, env);

return(0);
int gl_getLogs(char *service, char **outCClog, char **outNClog, char **outHlog, char **outAlog, axutil_env_t * env, axis2_stub_t * stub)
{
char *outservice;

adb_GetLogsResponse_t *out;
adb_getLogsResponseType_t *response;

adb_GetLogs_t *in;
adb_getLogsType_t *request;

request = adb_getLogsType_create(env);
adb_getLogsType_set_userId(request, env, "eucalyptus");
adb_getLogsType_set_correlationId(request, env, "12345678");
adb_getLogsType_set_serviceTag(request, env, service);

in = adb_GetLogs_create(env);
adb_GetLogs_set_GetLogs(in, env, request);

out = axis2_stub_op_EucalyptusGL_GetLogs(stub, env, in);
if (!out) {
printf("ERROR: operation call failed\n");
return (1);
}
response = adb_GetLogsResponse_get_GetLogsResponse(out, env);

//outservice = adb_getLogsResponseType_get_serviceTag(response, env);
*outCClog = adb_getLogsResponseType_get_CCLog(response, env);
*outNClog = adb_getLogsResponseType_get_NCLog(response, env);
*outHlog = adb_getLogsResponseType_get_httpdLog(response, env);
*outAlog = adb_getLogsResponseType_get_axis2Log(response, env);

return (0);
}

int gl_getKeys(char *service, char **outCCCert, char **outNCCert, axutil_env_t *env, axis2_stub_t *stub) {
char *outservice;

adb_GetKeysResponse_t *out;
adb_getKeysResponseType_t *response;

adb_GetKeys_t *in;
adb_getKeysType_t *request;

request = adb_getKeysType_create(env);
adb_getKeysType_set_userId(request, env, "eucalyptus");
adb_getKeysType_set_correlationId(request, env, "12345678");
adb_getKeysType_set_serviceTag(request, env, service);

in = adb_GetKeys_create(env);
adb_GetKeys_set_GetKeys(in, env, request);

out = axis2_stub_op_EucalyptusGL_GetKeys(stub, env, in);
if (!out) {
printf("ERROR: operation call failed\n");
return(1);
}
response = adb_GetKeysResponse_get_GetKeysResponse(out, env);

//outservice = adb_getKeysResponseType_get_serviceTag(response, env);
*outCCCert = adb_getKeysResponseType_get_CCcert(response, env);
*outNCCert = adb_getKeysResponseType_get_NCcert(response, env);

return(0);
int gl_getKeys(char *service, char **outCCCert, char **outNCCert, axutil_env_t * env, axis2_stub_t * stub)
{
char *outservice;

adb_GetKeysResponse_t *out;
adb_getKeysResponseType_t *response;

adb_GetKeys_t *in;
adb_getKeysType_t *request;

request = adb_getKeysType_create(env);
adb_getKeysType_set_userId(request, env, "eucalyptus");
adb_getKeysType_set_correlationId(request, env, "12345678");
adb_getKeysType_set_serviceTag(request, env, service);

in = adb_GetKeys_create(env);
adb_GetKeys_set_GetKeys(in, env, request);

out = axis2_stub_op_EucalyptusGL_GetKeys(stub, env, in);
if (!out) {
printf("ERROR: operation call failed\n");
return (1);
}
response = adb_GetKeysResponse_get_GetKeysResponse(out, env);

//outservice = adb_getKeysResponseType_get_serviceTag(response, env);
*outCCCert = adb_getKeysResponseType_get_CCcert(response, env);
*outNCCert = adb_getKeysResponseType_get_NCcert(response, env);

return (0);
}
4 changes: 2 additions & 2 deletions gatherlog/gl-client-marshal.h
Expand Up @@ -67,8 +67,8 @@
#include <time.h>
#include "axis2_stub_EucalyptusGL.h"

int gl_getLogs(char *service, char **outCClog, char **outNClog, char **outHlog, char **outAlog, axutil_env_t *env, axis2_stub_t *stub);
int gl_getLogs(char *service, char **outCClog, char **outNClog, char **outHlog, char **outAlog, axutil_env_t * env, axis2_stub_t * stub);

int gl_getKeys(char *service, char **outCCCert, char **outNCCert, axutil_env_t *env, axis2_stub_t *stub);
int gl_getKeys(char *service, char **outCCCert, char **outNCCert, axutil_env_t * env, axis2_stub_t * stub);

#endif

0 comments on commit e77086e

Please sign in to comment.