Commit 5a218b5b authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Added ipOptions and tcpOptions to the PacketInfo structure. Supporting code will be forthcoming.

parent 1fb5102c
...@@ -165,19 +165,49 @@ struct WriteResult ...@@ -165,19 +165,49 @@ struct WriteResult
Time nextWrite; Time nextWrite;
}; };
struct Option
{
Option() : type(0), length(0), buffer(NULL) {}
unsigned char type;
unsigned char length;
char * buffer;
};
struct PacketInfo struct PacketInfo
{ {
// packetTime+packetLength+kernel+elab size_t census(void)
enum {size = sizeof(int)*(2 +1 +21 + 1) + {
sizeof(short)*(0 +0 +0 + 2) + // packetTime+packetLength+kernel+elab
sizeof(char)*(0 +0 +7 + 1) + size_t result = sizeof(int)*(2 +1 +21 + 1) +
sizeof(struct ip) + sizeof(struct tcphdr)}; sizeof(short)*(0 +0 +0 + 2) +
sizeof(char)*(0 +0 +7 + 1) +
sizeof(struct ip) + sizeof(struct tcphdr);
// Size for ipOptions and tcpOptions.
result += sizeof(unsigned int)*2;
std::list<Option>::iterator pos = ipOptions->begin();
std::list<Option>::iterator limit = ipOptions->end();
for (; pos != limit; ++pos)
{
result += 2 + pos->length;
}
pos = tcpOptions->begin();
limit = tcpOptions->end();
for (; pos != limit; ++pos)
{
result += 2 + pos->length;
}
return result;
}
Time packetTime; Time packetTime;
int packetLength; int packetLength;
struct tcp_info const * kernel; struct tcp_info const * kernel;
struct ip const * ip; struct ip const * ip;
std::list<Option> * ipOptions;
struct tcphdr const * tcp; struct tcphdr const * tcp;
std::list<Option> * tcpOptions;
Order elab; Order elab;
bool bufferFull; bool bufferFull;
}; };
......
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