Index: FlowSet.cpp
===================================================================
--- FlowSet.cpp	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
+++ FlowSet.cpp	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -0,0 +1,6 @@
+#include "FlowSet.h"
+
+FlowSet::FlowSet(unsigned short _count, char remoteIPStr[], unsigned char remoteIPBytes[]) {
+	//stuff
+	return;
+}
Index: FlowSet.h
===================================================================
--- FlowSet.h	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
+++ FlowSet.h	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -0,0 +1,24 @@
+#include "FlowSetRecord.h"
+
+#ifndef FLOWSET
+#define FLOWSET
+
+class FlowSet {
+
+
+    public:
+
+    FlowSetRecord *FlowSets[];
+
+    //Constructor (id, length)
+    FlowSet(unsigned short _count, char remoteIPStr[], unsigned char remoteIPBytes[]);
+
+    private:
+
+    unsigned short count;
+	char srcIpStr[];
+	unsigned char srcIpBytes[];
+
+};
+
+#endif
Index: FlowSetRecord.cpp
===================================================================
--- FlowSetRecord.cpp	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
+++ FlowSetRecord.cpp	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -0,0 +1,6 @@
+#include "FlowSetRecord.h"
+
+FlowSetRecord::FlowSetRecord(unsigned short _count) {
+	//do stuff
+	return;
+}
Index: FlowSetRecord.h
===================================================================
--- FlowSetRecord.h	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
+++ FlowSetRecord.h	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -0,0 +1,27 @@
+#ifndef FLOWSETRECORD
+#define FLOWSETRECORD
+
+class FlowSetRecord {
+
+
+	public:
+
+	struct Field {
+		unsigned short code;
+		unsigned char data[];
+	};
+	typedef struct Field Field_t;
+
+	Field_t *Fields[];
+
+	//Constructor (id, length)
+	FlowSetRecord(unsigned short _count);
+
+
+	private:
+
+	unsigned short count;
+
+};
+
+#endif
Index: Makefile
===================================================================
--- Makefile	(revision e354032537c5474aee5a4d960a283020339ea977)
+++ Makefile	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -6,6 +6,6 @@
 all: netslow
 
-netslow: netslow.o NetFlow9Processor.o NetFlowDataTemplateCache.o NetFlowDataTemplate.o
-	$(CC) -o netslow netslow.o NetFlow9Processor.o NetFlowDataTemplateCache.o NetFlowDataTemplate.o $(LIBS)
+netslow: netslow.o NetFlow9Processor.o NetFlowDataTemplateCache.o NetFlowDataTemplate.o FlowSet.o FlowSetRecord.o
+	$(CC) -o netslow netslow.o NetFlow9Processor.o NetFlowDataTemplateCache.o NetFlowDataTemplate.o FlowSet.o FlowSetRecord.o  $(LIBS)
 
 
@@ -14,4 +14,6 @@
 NetFlowDataTemplateCache.o: NetFlowDataTemplateCache.cpp
 NetFlowDataTemplate.o: NetFlowDataTemplate.cpp
+FlowSet.o: FlowSet.cpp
+FlowSetRecord.o: FlowSetRecord.cpp
 
 clean:
Index: NetFlow9Processor.cpp
===================================================================
--- NetFlow9Processor.cpp	(revision e354032537c5474aee5a4d960a283020339ea977)
+++ NetFlow9Processor.cpp	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -2,4 +2,7 @@
 #include <stdio.h>
 #include <string.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
 #include "NetFlow9Processor.h"
 
@@ -17,9 +20,21 @@
 
 
-NetFlow9Processor::NetFlow9Processor(void) {
+NetFlow9Processor::NetFlow9Processor(struct sockaddr *remaddr, socklen_t *addrlen) {
 	dataTemplateCache = new NetFlowDataTemplateCache();
+	switch (remaddr->sa_family) {
+		case AF_INET:
+			//set IP
+			break;
+		case AF_INET6:
+			//set IP
+			break;
+		default:
+			//uhoh
+			break;
+	}
+	
 }
 
-int NetFlow9Processor::ProcessPacket(unsigned char b[], int l) {
+int NetFlow9Processor::ProcessPacket(unsigned char b[], int l, FlowSet* processedFlowSet) {
 
 	int nextIndex = 0;					// Next byte in the buffer
Index: NetFlow9Processor.h
===================================================================
--- NetFlow9Processor.h	(revision e354032537c5474aee5a4d960a283020339ea977)
+++ NetFlow9Processor.h	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -1,3 +1,4 @@
 #include "NetFlowDataTemplateCache.h"
+#include "FlowSet.h"
 
 #ifndef NETFLOW9PROCESSOR
@@ -8,4 +9,6 @@
 
 		NetFlowDataTemplateCache *dataTemplateCache;
+		char remoteIPStr[];
+		unsigned char remoteIPBytes[];
 //		NetFlowDataTemplate::DataTemplateItem_t *strtest;
 
@@ -18,6 +21,6 @@
 	public:
 
-		NetFlow9Processor();
-		int ProcessPacket(unsigned char b[], int l);
+		NetFlow9Processor(struct sockaddr *remaddr, socklen_t *addrlen);
+		int ProcessPacket(unsigned char b[], int l, FlowSet* processedFlowSet);
 
 };
Index: netslow.cpp
===================================================================
--- netslow.cpp	(revision e354032537c5474aee5a4d960a283020339ea977)
+++ netslow.cpp	(revision bb1d4dcce80110b408d50b8ae7855125fdc44f7f)
@@ -7,10 +7,10 @@
 #include "port.h"
 #include "NetFlow9Processor.h"
+#include "FlowSet.h"
 
 #define BUFSIZE 2048
 
-int
-main(int argc, char **argv)
-{
+int main(int argc, char **argv) {
+
 	struct sockaddr_in myaddr;			/* our address */
 	struct sockaddr_in remaddr;			/* remote address */
@@ -21,6 +21,6 @@
 	NetFlow9Processor *NetFlow9;		/* Processor do the hard work */
 	int retval;							/*Return value from processor */
+	FlowSet *processedFlowSet;
 
-	NetFlow9 = new NetFlow9Processor();
 
 	//Create a UDP socket - currently IPv4 only
@@ -45,4 +45,8 @@
 	}
 
+	remaddr.sin_family = AF_INET;
+	inet_pton(AF_INET, "8.8.8.8", &(remaddr.sin_addr));
+	NetFlow9 = new NetFlow9Processor((struct sockaddr *)&remaddr, &addrlen);
+
 	//NetFlow is very simple, so we can simply loop over all packets
 	//received.
@@ -50,12 +54,22 @@
 //		printf("waiting on port %d\n", SERVICE_PORT);
 		recvlen = recvfrom(fd, buf, BUFSIZE, 0, (struct sockaddr *)&remaddr, &addrlen);
+
+		if (remaddr.sin_family != AF_INET) {
+			continue; //Ooops something wrong with this packet
+		}
+
 //		printf("received %d bytes\n", recvlen);
 		if (recvlen > 2) {
 			int version = (buf[0] << 8 ) + buf [1];
+
+
 			switch (version) {
 				case 9:
 					//NFv9
 //					printf("Len: %d...  Running NetFlow9Packet Processor\n", recvlen);
-					retval = NetFlow9->ProcessPacket(buf,recvlen);
+					retval = NetFlow9->ProcessPacket(buf,recvlen,processedFlowSet);
+					if ( processedFlowSet == 0 ) {
+						printf("Error in NF9Processor - invalid pointer\n");
+					}
 					break;
 				default:
@@ -63,5 +77,5 @@
 			}
 
-			printf("PacketProcessor returned %d\n",retval);
+			printf("PacketProcessor returned %d\n",processedFlowSet);
 		}
 	}
