/* This file is part of the Linux Trace Toolkit viewer
- * Copyright (C) 2009 Benjamin Poirier <benjamin.poirier@polymtl.ca>
+ * Copyright (C) 2009, 2010 Benjamin Poirier <benjamin.poirier@polymtl.ca>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation;
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 2.1 of the License, or (at
+ * your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- * MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _ISOC99_SOURCE
#include <config.h>
#endif
-#include <linux/if_ether.h>
#include <math.h>
#include <netinet/in.h>
#include <stdarg.h>
#include "event_processing_lttng_standard.h"
+/* IPv4 Ethertype, taken from <linux/if_ether.h>, unlikely to change as it's
+ * defined by IANA: http://www.iana.org/assignments/ethernet-numbers
+ */
+#define ETH_P_IP 0x0800
+
// Functions common to all processing modules
static void initProcessingLTTVStandard(SyncState* const syncState, ...);
syncState, const unsigned int i, const unsigned int j);
// Functions specific to this module
-static void registerProcessingLTTVStandard() __attribute__((constructor (102)));
static gboolean processEventLTTVStandard(void* hookData, void* callData);
static void partialDestroyProcessingLTTVStandard(SyncState* const syncState);
/*
* Processing Module registering function
*/
-static void registerProcessingLTTVStandard()
+void registerProcessingLTTVStandard()
{
g_queue_push_tail(&processingModules, &processingModuleLTTVStandard);
for(i= 0; i < syncState->traceNb; i++)
{
g_hash_table_insert(processingData->traceNumTable,
- processingData->traceSetContext->traces[i]->t, (gpointer) i);
+ processingData->traceSetContext->traces[i]->t,
+ GUINT_TO_POINTER(i));
}
processingData->pendingRecv= malloc(sizeof(GHashTable*) *
struct marker_info* info;
SyncState* syncState;
ProcessingDataLTTVStandard* processingData;
+ gpointer traceNumP;
traceHook= (LttvTraceHook*) hookData;
tfc= (LttvTracefileContext*) callData;
wTime.nanosec= time.tv_nsec;
g_assert(g_hash_table_lookup_extended(processingData->traceNumTable,
- trace, NULL, (gpointer*) &traceNum));
+ trace, NULL, &traceNumP));
+ traceNum= GPOINTER_TO_INT(traceNumP);
g_debug("Process event: time: %ld.%09ld trace: %ld (%p) name: %s ",
time.tv_sec, time.tv_nsec, traceNum, trace,