endif
EXPAT_LIBS:=${EXPAT_LIBS} -lexpat
-LDFLAGS:=-L${stagedir}/lib \
+archlib:=lib
+host_cpu:=${shell uname -m}
+ifeq (${host_cpu},x86_64)
+ archlib:=lib64
+endif
+
+LDFLAGS:=-L${stagedir}/${archlib} -L${stagedir}/lib \
${COVERAGE_FLAGS}
EXT_LIBS:= ${EXPAT_LIBS} ${JOBID_LIB} ${TRIO_LIB}
fi
clean:
+<<<<<<< Makefile
rm -rvf *.o *.lo .libs lib* *.c *.h *.dox C/ CPP/ test_parse il_test parse.cpp events.tex status.tex
rm -vf ${globalprefix} ${lbprefix}
rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/
+=======
+ rm -rf *.o *.lo .libs lib* *.c test_parse il_test
+
+>>>>>>> 1.57.2.3
%.o: %.c
${COMPILE} ${CFLAGS} -c $<
#ifndef GLITE_LB_CONNPOOL_H
#define GLITE_LB_CONNPOOL_H
+#include "glite/lb/padstruct.h"
#include "glite/security/glite_gss.h"
#include "glite/lb/context.h"
#include "glite/lb/lb_plain_io.h"
#define GLITE_LB_COMMON_CONNPOOL_SIZE 50
-
-typedef struct _edg_wll_ConnPool {
+glite_lb_padded_struct(_edg_wll_ConnPool,15,
/* address and port where we are connected to */
char *peerName;
unsigned int peerPort;
edg_wll_GssCred gsiCred;
edg_wll_GssConnection gss;
char *buf;
- int bufUse,bufSize;
+ int bufUse;
+ int bufSize;
/* timestamp of usage of this entry in ctx.connPool */
struct timeval lastUsed;
-} edg_wll_ConnPool;
+
+/* Proxy/Cert file identification */
+
+ struct stat *certfile;
+
+);
+typedef struct _edg_wll_ConnPool edg_wll_ConnPool;
#endif
in case memory has been already allocated, just return a pointer */
edg_wll_Connections* edg_wll_initConnections();
+
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
-
+
+/* TODO: merge */
+<<<<<<< context-int.h
#define EDG_WLL_SEQ_NULL "UI=000000:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
#define EDG_WLL_SEQ_PBS_NULL "TIMESTAMP=00000000000000:POS=0000000000:EV.CODE=000:SRC=?"
#define EDG_WLL_SEQ_CONDOR_NULL EDG_WLL_SEQ_PBS_NULL
#define EDG_WLL_SEQ_SIZE 103 /* strlen(EDG_WLL_SEQ_NULL)+1 */
#define EDG_WLL_SEQ_PBS_SIZE 57 /* strlen(EDG_WLL_SEQ_PBS_NULL)+1 */
#define EDG_WLL_SEQ_CONDOR_SIZE EDG_WLL_SEQ_PBS_SIZE
+=======
+#define EDG_WLL_SEQ_NULL "UI=000000:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
+#define EDG_WLL_SEQ_PBS_NULL "TIMESTAMP=00000000000000:POS=0000000000:EV.CODE=000:SRC=?"
+#define EDG_WLL_SEQ_CONDOR_NULL EDG_WLL_SEQ_PBS_NULL
+#define EDG_WLL_SEQ_SIZE (sizeof(EDG_WLL_SEQ_NULL))
+#define EDG_WLL_SEQ_PBS_SIZE (sizeof(EDG_WLL_SEQ_PBS_NULL))
+#define EDG_WLL_SEQ_CONDOR_SIZE EDG_WLL_SEQ_PBS_SIZE
+>>>>>>> 1.26.2.4
typedef struct _edg_wll_SeqCode {
unsigned int type; /* seq code type */
} edg_wll_SeqCode;
/* non-gsi one-element analogy of connPool for L&B Proxy server */
-typedef struct _edg_wll_ConnProxy {
+glite_lb_padded_struct(_edg_wll_ConnProxy,12,
edg_wll_PlainConnection conn;
char *buf;
size_t bufSize;
size_t bufUse;
-} edg_wll_ConnProxy;
-
+)
+typedef struct _edg_wll_ConnProxy edg_wll_ConnProxy;
-struct _edg_wll_Context {
+glite_lb_padded_struct(_edg_wll_Context,120,
/* Error handling */
int errCode; /* recent error code */
char *errDesc; /* additional error description */
edg_wll_ConnPool *connPoolNotif; /* hold _one_ connection from notif-interlogger */
edg_wll_ConnProxy *connProxy; /* holds one plain connection */
- int semaphores,semset;
+ int semaphores;
+ int semset;
edg_wll_QueryRec **job_index;
void *job_index_cols;
char *p_lbproxy_store_sock;
char *p_lbproxy_serve_sock;
char *p_user_lbproxy;
- struct timeval p_log_timeout,p_sync_timeout,p_query_timeout, p_notif_timeout, p_tmp_timeout;
+ struct timeval p_log_timeout;
+ struct timeval p_sync_timeout;
+ struct timeval p_query_timeout;
+ struct timeval p_notif_timeout;
+ struct timeval p_tmp_timeout;
char *p_query_server;
int p_query_server_port;
int p_query_server_override;
int count_statistics;
int greyjobs;
-};
+
+ char **fqans; /* null-terminated list of peer's VOMS FQANs */
+)
/* to be used internally: set, update and and clear the error information in
* context, the desc string (if provided) is strdup()-ed
#ifndef GLITE_LB_PLAIN_IO_H
#define GLITE_LB_PLAIN_IO_H
+#include "glite/lb/padstruct.h"
#ifdef __cplusplus
extern "C" {
#endif
-typedef struct _edg_wll_PlainConnection {
+glite_lb_padded_struct(_edg_wll_PlainConnection,6,
int sock;
char *buf;
size_t bufSize;
size_t bufUse;
-} edg_wll_PlainConnection;
+)
+typedef struct _edg_wll_PlainConnection edg_wll_PlainConnection;
int edg_wll_plain_accept(
-# $Id$
-# $Name$
-module.version=5.0.3
+# $Header$
+module.version=6.1.0
module.age=1
if (ctx->vomsGroups.len) free_voms_groups(&ctx->vomsGroups);
if (ctx->dumpStorage) free(ctx->dumpStorage);
if (ctx->purgeStorage) free(ctx->purgeStorage);
+ if (ctx->fqans) {
+ char **f;
+ for (f = ctx->fqans; f && *f; f++)
+ free(*f);
+ free(ctx->fqans);
+ ctx->fqans = NULL;
+ }
edg_wll_FreeParams(ctx);
"Server response error",
"Bad JobId format",
"Database call failed",
- "Bad URL format",
"MD5 key clash",
"GSSAPI Error",
"DNS resolver error",
"Interlogger internal error",
"Interlogger has events pending",
"Compared events differ",
- "SQL parse error",
};
const char *edg_wll_GetErrorText(int code) {
&c[EDG_WLL_SOURCE_LB_SERVER]);
assert(EDG_WLL_SOURCE__LAST == 10);
- if (res != EDG_WLL_SOURCE__LAST-1)
+ if (res == EDG_WLL_SOURCE_LB_SERVER-1) {
+ /* pre-collections compatibility */
+ c[EDG_WLL_SOURCE_LB_SERVER] = 0;
+ } else if (res != EDG_WLL_SOURCE__LAST-1)
return edg_wll_SetError(ctx, EINVAL,
"edg_wll_SetSequenceCode(): syntax error in sequence code");
retjobs == NULL)
return edg_wll_SetError(ctx, ENOMEM, NULL);
+/* TODO: merge */
+<<<<<<< context.c
if ( !seed || !strcmp(seed, "(nil)") ) {
intseed = strdup("edg_wll_GenerateSubjobIds()");
}
else
intseed = strdup(seed);
+=======
+ if ( !seed ) {
+ intseed = strdup("edg_wll_GenerateSubjobIds()");
+ }
+ else
+ intseed = strdup(seed);
+
+>>>>>>> 1.23.2.10
for (subjob = 0; subjob < num_subjobs; subjob++) {
asprintf(&unhashed, "%s,%s,%d", p_unique, intseed, subjob);
static const char *eventNames[] = {
"Undefined",
@@@{
+my $flesh = 'gLite'; #XXX
+my $fleshno = 0;
+my $eventno = $fleshno;
+
for my $e (sort { $event->{order}->{$a} <=> $event->{order}->{$b} }
$event->getTypes) {
- gen "\t\"$e\",\n";
+
+ if ($flesh ne $event->{flesh}->{$e}) {
+ $flesh = $event->{flesh}->{$e};
+ $fleshno += 100;
+
+ gen "\t";
+ while ($eventno < $fleshno) {
+ gen "NULL, ";
+ $eventno++;
+ if (($eventno % 10) == 0) { gen "\n\t"; }
+ }
+ gen "\n";
+ }
+
+ $eventno++;
+ gen "\t\"$e\", /* $eventno */\n";
}
@@@}
"SysCmpStat",
unsigned int i;
for (i=1; i<sizeof(eventNames)/sizeof(eventNames[0]); i++)
- if (strcasecmp(eventNames[i],name) == 0) return (edg_wll_EventCode) i;
+ if ( (eventNames[i]) && (strcasecmp(eventNames[i],name) == 0)) return (edg_wll_EventCode) i;
return EDG_WLL_EVENT_UNDEF;
}
char *edg_wll_EventToString(edg_wll_EventCode event)
{
if ((int)event < 0 || event >= sizeof(eventNames)/sizeof(eventNames[0])) return NULL;
- return strdup(eventNames[event]);
+ return eventNames[event] ? strdup(eventNames[event]) : NULL;
}
"Undefined",
"DG.EVNT",
@@@{
+my $keyno = 2;
selectType $event '_common_';
for ($event->getFieldsOrdered) {
my $f = selectField $event $_;
my $fnu = uc $fn;
my $c = $f->{comment};
if (hasAlias $f 'ULM') {
- gen "\t\"$fnu\",\n";
+ gen "\t\"$fnu\", /* $keyno */\n";
} else {
- gen "\t\"DG.$fnu\",\n";
+ gen "\t\"DG.$fnu\", /* $keyno */\n";
}
+ $keyno++;
}
for my $t (sort { $event->{order}->{$a} <=> $event->{order}->{$b} }
$event->getTypes) {
for ($event->getFieldsOrdered) {
my $f = selectField $event $_;
my $fnu = uc $f->{name};
- gen "\t\"DG.$tu.$fnu\",\n";
+ gen "\t\"DG.$tu.$fnu\", /* $keyno */\n";
+ $keyno++;
}
}
@@@}
my $c = "$t".ucfirst(${fn});
gen "\tthis->$tl.$fn = edg_wll_StringTo${c}(value);";
} else {
- gen "\t";
+ gen "\tif(strlen(value) > 0) ";
gen $f->fromString('value',"this->$tl.$fn");
}
gen "\n".$indent.$indent."break;\n";
*/
#define MISSING(m_key) { \
char *k = edg_wll_KeyNameToString(m_key); \
- sprintf(err_desc,"Message incomplete, missing key %s.", k); \
+ sprintf(err_desc,"Message incomplete, missing or empty field %s.", k); \
free(k); \
ret=edg_wll_SetError(context,EDG_WLL_ERROR_PARSE_MSG_INCOMPLETE,err_desc); \
goto end; }
}
if(level <= LOG_ERR) {
- openlog("edg-wl-interlogd", LOG_PID | LOG_CONS, LOG_DAEMON);
+ openlog(NULL, LOG_PID | LOG_CONS, LOG_DAEMON);
syslog(level, "%s", err_text);
closelog();
}
case EDG_WLL_GSS_OK:
break;
case EDG_WLL_GSS_ERROR_GSS:
- edg_wll_SetErrorGss(ctx, "receving HTTP request", &gss_code);
+ edg_wll_SetErrorGss(ctx, "receving HTTP request/response", &gss_code);
goto error;
case EDG_WLL_GSS_ERROR_ERRNO:
if (errno == ECONNRESET) errno = ENOTCONN;
if (!attr[0] || !attr[1]) { unexpError() break;}
if (strcmp(attr[0],"name")) { unexpError() break;}
if ( (XMLCtx->eventCode = edg_wll_StringToEvent((char *) attr[1]))
- == EDG_WLL_EVENT_UNDEF ) { unexpError() break;}
+ == EDG_WLL_EVENT_UNDEF ) { unexpWarning() }
XMLCtx->eventsOutGlobal = realloc(XMLCtx->eventsOutGlobal,
(XMLCtx->position+1)*sizeof(*XMLCtx->eventsOutGlobal));
if (!XMLCtx->eventsOutGlobal) { edg_wll_SetError(XMLCtx->ctx, ENOMEM, NULL); unexpError() return; }
edg_wll_freeBuf(XMLCtx);
}
break;
+ case 2:
+ /* skip events of unknown type */
+ if (XMLCtx->eventCode == EDG_WLL_EVENT_UNDEF) {
+ edg_wll_FreeEvent(&(XMLCtx->eventsOutGlobal)[XMLCtx->position]);
+ XMLCtx->position--;
+ }
+ /* fallthough */
default:
if (XMLCtx->char_buf) {
unexpWarning()
class EventParseTest: public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(EventParseTest);
- CPPUNIT_TEST(regJob);
-/*
@@@{
for my $e ($event->getTypesOrdered) {
my $u = lcfirst $e;
gen "\tCPPUNIT_TEST($u);\n";
}
@@@}
-*/
CPPUNIT_TEST_SUITE_END();
public:
- void regJob();
-/*
@@@{
for my $e ($event->getTypesOrdered) {
my $u = lcfirst $e;
gen "\tvoid $u();\n";
}
@@@}
-*/
};
-void EventParseTest::regJob()
-{
- edg_wll_Context ctx;
- edg_wll_Event *e1,*e2;
- char *line,*et,*ed;
+@@@{
+ for my $e ($event->getTypesOrdered) {
+ my $l = lcfirst $e;
+ if ($l =~ m/^pBS/) { $l = ucfirst $l; }
+ if ($l =~ m/^condor/) { $l = ucfirst $l; }
+ my $u = uc $e;
+ my $c = getTypeComment $event $e;
+ gen qq{
+void EventParseTest::$l()
+\{
+ edg_wll_Context ctx;
+ edg_wll_Event *e1,*e2;
+ char *line,*et,*ed;
edg_wll_InitContext(&ctx);
- e1 = edg_wll_InitEvent(EDG_WLL_EVENT_REGJOB);
-
- e1->regJob.jdl = strdup("very long job = \"blabla\" \\\\ \n hugh\t;");
- e1->regJob.ns = strdup("ns address");
- e1->regJob.jobtype = EDG_WLL_REGJOB_SIMPLE;
- e1->regJob.seed = strdup("");
+ e1 = edg_wll_InitEvent(EDG_WLL_EVENT_$u);
gettimeofday(&e1->any.timestamp,NULL);
e1->any.source = EDG_WLL_SOURCE_USER_INTERFACE;
e1->any.src_instance = strdup("");
- line = edg_wll_UnparseEvent(ctx,e1);
- std::cerr << line << std::endl;
-
- if (!line) {
- edg_wll_Error(ctx,&et,&ed);
- CPPUNIT_ASSERT_MESSAGE(std::string("edg_wll_UnparseEvent():") + et + " " + ed, line);
- }
-
- if (edg_wll_ParseEvent(ctx,line,&e2)) {
- edg_wll_Error(ctx,&et,&ed);
- CPPUNIT_ASSERT_MESSAGE(std::string("edg_wll_ParseEvent():") + et + " " + ed, 0);
- }
+};
+/* TODO: merge */
+<<<<<<< parse.cpp.T
if ((edg_wll_CompareEvents(ctx,e1,e2))) {
edg_wll_Error(ctx,&et,&ed);
CPPUNIT_ASSERT_MESSAGE(std::string("edg_wll_CompareEvents():") + et + " " + ed, 0);
";
selectType $event '_common_';
+=======
+ selectType $event "$e";
+>>>>>>> 1.8.2.4
for ($event->getFieldsOrdered) {
my $f = selectField $event $_;
my $fn = getName $f;
- my $value = getDefaultTestValue $f;
+
if (!$f->{codes}) {
- if (!$f->hasAlias('ULM')) {
- my $fu = uc $fn;
- gen "\te1->any.$fn = $value;\n";
-# gen "\tif (". $f->isNULL("e1->any.$fn") .") MISSING(EDG_WLL\_COMMON\_$fu)\n";
- } else {
- my $fa = $f->getName('ULM');
- my $fu = uc $fa;
-# gen "\tif (". $f->isNULL("e1->any.$fn") .") MISSING(ULM\_$fu)\n";
+ my $value = '';
+# $value = "e1->$l.$fn = value;";
+# $value = $f->fromString('value',"e1->$l.$fn");
+ if (($f->{type} eq "int") || ($f->{type} eq "port")) {
+ $value = "e1->$l.$fn = 654;";
+ } elsif (($f->{type} eq "float") || ($f->{type} eq "double")) {
+ $value = "e1->$l.$fn = 3.1415;";
+ } elsif ($f->{type} eq "string") {
+ $value = "e1->$l.$fn = strdup(\"teststring\");";
+ } elsif ($f->{type} eq "logsrc") {
+ $value = "e1->$l.$fn = EDG_WLL_SOURCE_APPLICATION;";
+ } elsif ($f->{type} eq "jobid") {
+ $value = "edg_wlc_JobIdParse(\"https://some.host:1234/x67qr549qc\",&e1->$l.$fn);";
+ } elsif ($f->{type} eq "notifid") {
+ $value = "edg_wll_NotifIdParse(\"https://some.host:1234/NOTIF:x67qr549qc\",&e1->$l.$fn);";
+ } else {
+ gen "% FIXME: unknown type $f->{type} for $fn \n";
}
+ gen "\t$value\n";
}
}
gen '
+ line = edg_wll_UnparseEvent(ctx,e1);
+// std::cerr << line << std::endl;
+
if (!line) {
edg_wll_Error(ctx,&et,&ed);
CPPUNIT_ASSERT_MESSAGE(std::string("edg_wll_UnparseEvent():") + et + " " + ed, line);
CPPUNIT_ASSERT_MESSAGE(std::string("edg_wll_CompareEvents():") + et + " " + ed, 0);
}
}
-
';
}
@@@}
-*/
CPPUNIT_TEST_SUITE_REGISTRATION( EventParseTest );