Remove dependency on kernel headers
[lttv.git] / lttv / lttv / sync / event_processing_lttng_standard.c
index e6457fa4e96a0278b6457834e5639b7b87928e36..876dac0858c501838e3c108b88af9194c094f527 100644 (file)
@@ -22,7 +22,6 @@
 #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, ...);
@@ -113,7 +117,8 @@ static void initProcessingLTTVStandard(SyncState* const syncState, ...)
        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*) *
@@ -384,6 +389,7 @@ static gboolean processEventLTTVStandard(void* hookData, void* callData)
        struct marker_info* info;
        SyncState* syncState;
        ProcessingDataLTTVStandard* processingData;
+       gpointer traceNumP;
 
        traceHook= (LttvTraceHook*) hookData;
        tfc= (LttvTracefileContext*) callData;
@@ -398,7 +404,8 @@ static gboolean processEventLTTVStandard(void* hookData, void* 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,
@@ -700,14 +707,6 @@ static void writeProcessingGraphVariablesLTTVStandard(SyncState* const
 static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState* const
        syncState, const unsigned int i, const unsigned int j)
 {
-       ProcessingDataLTTVStandard* processingData;
-       ProcessingGraphsLTTVStandard* traceI, * traceJ;
-
-       processingData= (ProcessingDataLTTVStandard*) syncState->processingData;
-
-       traceI= &processingData->graphs[i];
-       traceJ= &processingData->graphs[j];
-
        fprintf(syncState->graphsStream,
         "set key inside right bottom\n"
         "set xlabel \"Clock %1$u\"\n"
@@ -734,14 +733,6 @@ static void writeProcessingTraceTraceOptionsLTTVStandard(SyncState* const
 static void writeProcessingTraceTimeOptionsLTTVStandard(SyncState* const
        syncState, const unsigned int i, const unsigned int j)
 {
-       ProcessingDataLTTVStandard* processingData;
-       ProcessingGraphsLTTVStandard* traceI, * traceJ;
-
-       processingData= (ProcessingDataLTTVStandard*) syncState->processingData;
-
-       traceI= &processingData->graphs[i];
-       traceJ= &processingData->graphs[j];
-
        fprintf(syncState->graphsStream,
         "set key inside right bottom\n"
         "set xlabel \"Clock %1$u\"\n"
This page took 0.023736 seconds and 4 git commands to generate.