Remove TODOs from GRE implementation files
This commit is contained in:
parent
3d6f39e84d
commit
5a91dc4561
@ -103,11 +103,6 @@ AbstractProtocol::FieldFlags GreProtocol::fieldFlags(int index) const
|
||||
return flags;
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Edit this function to return the data for each field
|
||||
|
||||
See AbstractProtocol::fieldData() for more info
|
||||
*/
|
||||
QVariant GreProtocol::fieldData(int index, FieldAttrib attrib,
|
||||
int streamIndex) const
|
||||
{
|
||||
@ -380,11 +375,6 @@ QVariant GreProtocol::fieldData(int index, FieldAttrib attrib,
|
||||
return AbstractProtocol::fieldData(index, attrib, streamIndex);
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Edit this function to set the data for each field
|
||||
|
||||
See AbstractProtocol::setFieldData() for more info
|
||||
*/
|
||||
bool GreProtocol::setFieldData(int index, const QVariant &value,
|
||||
FieldAttrib attrib)
|
||||
{
|
||||
@ -466,12 +456,6 @@ _exit:
|
||||
return isOk;
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Return the protocol frame size in bytes\n
|
||||
|
||||
If your protocol has a fixed size - you don't need to reimplement this; the
|
||||
base class implementation is good enough
|
||||
*/
|
||||
int GreProtocol::protocolFrameSize(int /*streamIndex*/) const
|
||||
{
|
||||
int size = 4; // mandatory fields - flags, rsvd0, version, protocol
|
||||
|
@ -21,23 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
#include "gre.pb.h"
|
||||
|
||||
/*!
|
||||
TODO : Initialize the following inherited protected members -
|
||||
- ostProtoId_
|
||||
- fieldMap_
|
||||
|
||||
ostProtoId_ is the protocol's protobuf field number as defined in
|
||||
message 'Protocol' enum 'k' in file protocol.proto
|
||||
|
||||
fieldMap_ is a mapping of the protocol's field names as they appear
|
||||
in the PDML to the protobuf field numbers for the protocol. All such
|
||||
fields are classified as 'known' fields and the base class will take care
|
||||
of decoding these without any help from the subclass.
|
||||
|
||||
Note that the PDML field names are same as the field names used in Wireshark
|
||||
display filters. The full reference for these is available at -
|
||||
http://www.wireshark.org/docs/dfref/
|
||||
*/
|
||||
PdmlGreProtocol::PdmlGreProtocol()
|
||||
{
|
||||
ostProtoId_ = OstProto::Protocol::kGreFieldNumber;
|
||||
@ -58,39 +41,6 @@ PdmlProtocol* PdmlGreProtocol::createInstance()
|
||||
return new PdmlGreProtocol();
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Use this method to do any special handling that may be required for
|
||||
preprocessing a protocol before parsing/decoding the protocol's fields
|
||||
*/
|
||||
void PdmlGreProtocol::preProtocolHandler(QString /*name*/,
|
||||
const QXmlStreamAttributes& /*attributes*/,
|
||||
int /*expectedPos*/, OstProto::Protocol* /*pbProto*/,
|
||||
OstProto::Stream* /*stream*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Use this method to do any special handling or cleanup that may be
|
||||
required when a protocol decode is ending prematurely
|
||||
*/
|
||||
void PdmlGreProtocol::prematureEndHandler(int /*pos*/,
|
||||
OstProto::Protocol* /*pbProto*/, OstProto::Stream* /*stream*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Use this method to do any special handling that may be required for
|
||||
postprocessing a protocol after parsing/decoding all the protocol fields
|
||||
|
||||
If your protocol's protobuf has some meta-fields that should be set to
|
||||
their non default values, this is a good place to do that. e.g. derived
|
||||
fields such as length, checksum etc. may be correct or incorrect in the
|
||||
PCAP/PDML - to retain the same value as in the PCAP/PDML and not let
|
||||
Ostinato recalculate these, you can set the is_override_length,
|
||||
is_override_cksum meta-fields to true here
|
||||
*/
|
||||
void PdmlGreProtocol::postProtocolHandler(OstProto::Protocol* pbProto,
|
||||
OstProto::Stream* /*stream*/)
|
||||
{
|
||||
@ -102,21 +52,6 @@ void PdmlGreProtocol::postProtocolHandler(OstProto::Protocol* pbProto,
|
||||
return;
|
||||
}
|
||||
|
||||
/*!
|
||||
TODO: Handle all 'unknown' fields using this method
|
||||
|
||||
You need to typically only handle frame fields or fields actually present
|
||||
in the protocol on the wire. So you can safely ignore meta-fields such as
|
||||
Good/Bad Checksum.
|
||||
|
||||
Some fields may not have a 'name' attribute, so cannot be classified as
|
||||
a 'known' field. Use this method to identify such fields using other
|
||||
attributes such as 'show' or 'showname' and populate the corresponding
|
||||
protobuf field.
|
||||
|
||||
If the PDML protocol contains some fields that are not supported by Ostinato,
|
||||
use a HexDump protocol as a replacement to store these bytes
|
||||
*/
|
||||
void PdmlGreProtocol::unknownFieldHandler(QString name,
|
||||
int /*pos*/, int /*size*/, const QXmlStreamAttributes& attributes,
|
||||
OstProto::Protocol* proto, OstProto::Stream* /*stream*/)
|
||||
|
@ -29,11 +29,6 @@ public:
|
||||
|
||||
static PdmlProtocol* createInstance();
|
||||
|
||||
virtual void preProtocolHandler(QString name,
|
||||
const QXmlStreamAttributes &attributes, int expectedPos,
|
||||
OstProto::Protocol *pbProto, OstProto::Stream *stream);
|
||||
virtual void prematureEndHandler(int pos, OstProto::Protocol *pbProto,
|
||||
OstProto::Stream *stream);
|
||||
virtual void postProtocolHandler(OstProto::Protocol *pbProto,
|
||||
OstProto::Stream *stream);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user