Commit 619dc1ac authored by Jonathon Duerig's avatar Jonathon Duerig

Fixed a stupid core dump bug caused by an uninitialized variable. Ran some...

Fixed a stupid core dump bug caused by an uninitialized variable. Ran some basic tests of tcp-option parsing functionality. Added a tcp-option printer to the NullSensor.
parent 0834f1f1
......@@ -586,7 +586,8 @@ namespace
void parseOptions(unsigned char const * buffer, int size,
list<Option> * options)
{
unsigned char const * pos;
// logWrite(PCAP, "Parsing options");
unsigned char const * pos = buffer;
unsigned char const * limit = buffer + size;
Option current;
bool done = false;
......@@ -628,5 +629,6 @@ namespace
options->push_back(current);
}
}
// logWrite(PCAP, "Finished parsing options");
}
}
......@@ -63,7 +63,13 @@ void NullSensor::localSend(PacketInfo *)
logWrite(SENSOR, "Send received");
}
void NullSensor::localAck(PacketInfo *)
void NullSensor::localAck(PacketInfo * packet)
{
logWrite(SENSOR, "Ack received");
list<Option>::iterator pos = packet->tcpOptions->begin();
list<Option>::iterator limit = packet->tcpOptions->end();
for (; pos != limit; ++pos)
{
logWrite(SENSOR, "TCP Option: %d", pos->type);
}
}
......@@ -32,7 +32,7 @@ public:
virtual ~NullSensor();
protected:
virtual void localSend(PacketInfo *);
virtual void localAck(PacketInfo *);
virtual void localAck(PacketInfo * packet);
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment