Ethereal-dev: Re: [ethereal-dev] filters for ethereal?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Joao Carlos Mendes Luis <jonny@xxxxxxxxxxxx>
Date: Fri, 11 Dec 1998 10:09:19 -0200 (EDT)
#define quoting(Eric A. Hall)
// > Also, instead of having a decoder map, I would prefer a hierarchical
// > decoding API, with a top level "ethernet" (or whatever fisical layer)
// > decoder, which calls other modules, recursively.  This would deal
// > easily with encapsulated protocols, for example.
// 
// I'm not sure I follow. What would that kind of hierarchy look like? If I
// have ppp and tr and fddi and ethernet trees, would they all have their
// own IP sub-trees?

Modularity is the keyword here.  With a well designed API, the same
decoder could be used anywhere, even recursively.  Here's a quick
scratch:

ether( start, end, ... )
{
  ...
  ip( start, end, ... )
  ...
  snap( start, end, ... )
  ...
}

fddi( start, end, ... )
{
  ...
  snap( start, end, ... )
  ...
}

snap( start, end, ... )
{
  ...
  ip( start, end, ... )
  ...
}

ip( start, end, ... )
{
  ...
  //  Encapsulated and tunneled protocols
  ip( start, end, ... )
  ...
  ipx( start, end, ... )
  ...
}

					Jonny

--
Joao Carlos Mendes Luis            M.Sc. Student
jonny@xxxxxxxxxxxx                 Universidade Federal do Rio de Janeiro
"This .sig is not meant to be politically correct."