On 2016-08-11 at 20:11:02 +0200, Vadim Kochan wrote:
> On Thu, Aug 11, 2016 at 06:16:27PM +0200, Tobias Klauser wrote:
> > Currently struct proto_hdr is used twofold:
> >
> > 1) Statically define protocol behavior, i.e. all the *_hdr definitions in
> >
On 2016-08-12 at 00:42:24 +0200, Vadim Kochan wrote:
> Move colorize_xxx macroses to colors.h, the reason
> is to have one file for coloring stuff and have less
> files as possible in the source tree.
>
> Signed-off-by: Vadim Kochan
Applied, thanks!
--
Add basic infrastructure for update proto field value at runtime
by dynamic field function.
Extended 'struct packet_dyn' with proto fields which has
dynamically changing values at runtime.
Added 'field_changed' callback for proto header which
may be used for check if csum updating is needed.
Added proto_upper_header() function to fetch upper proto header.
It will be used by IPv4/IPv6 proto header to notify UDP/TCP proto
headers to invalidate L4 csum when L3 pseudo header field was changed.
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 12
Update TCP checksum field if any TCP of fields was changed.
Use same checksum update function on 'packet_finish' and 'header update'.
Set 'is_csum_valid = false' if lower IPv4/IPv6 pseudo header was changed.
Signed-off-by: Vadim Kochan
---
trafgen_l3.c | 4 ++--
Extended struct proto_hdr with 'index' field which is used for
faster lookup of lower header w/o doing a loop.
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 25 +++--
trafgen_proto.h | 1 +
2 files changed, 12 insertions(+), 14 deletions(-)
diff
Changed parsing logic of field value expression to
be more generic. Such approach will allow to easy
extend field value expression to support dynamic field functions.
Signed-off-by: Vadim Kochan
---
trafgen_parser.y | 361
Removed unneeded fields which are calcuated by default:
Fixed field by changing drnd(2) -> drnd() as proto field
function does not support bytes length value but randomizes
specified field by its length.
Signed-off-by: Vadim Kochan
---
trafgen.8 | 6 +++---
Implement incrementing of proto field at runtime with min & max
parameters, by default if the 'min' parameter is not specified
then original value is used. For fields which len is greater
than 4 - last 4 bytes are incremented as 4 byte value (this
trick is used for increment MAC/IPv6 addresses).
Add explanation about 'drnd' and 'dinc' functions which might
be used for proto field functions.
Signed-off-by: Vadim Kochan
---
trafgen.8 | 43 +++
1 file changed, 43 insertions(+)
diff --git a/trafgen.8 b/trafgen.8
index
Handle 'field_changed' callback to check if IPv4 csum is needed
to be recalculated, if so - update it on 'packet_update' event.
Added 'is_csum_valid' to proto_hdr struct to check if csum needs to
be updated.
Signed-off-by: Vadim Kochan
---
trafgen_l3.c| 33
Add syntax for specify dynamic random function for proto field:
drnd() | drnd(min, max)
EXAMPLE:
{ udp(sport=drnd()) }
{ udp(sport=drnd(1000, 2000)) }
Signed-off-by: Vadim Kochan
---
trafgen_parser.y | 9 +
1 file changed, 9 insertions(+)
diff --git
Use same function to calculate csum for packet_update
and for packet_finish events.
Allow update csum if one of the ICMPv6 fields was changed.
Signed-off-by: Vadim Kochan
---
trafgen_l4.c | 32 +++-
1 file changed, 19 insertions(+), 13
Update UDP csum field at runtime if:
1) UDP field was changed.
2) IPv4/6 source/destination addresses were changed
(which is a part of UDP pseudo header), this is
handled by IPv4/6 protocols.
Signed-off-by: Vadim Kochan
---
trafgen_l3.c | 18
Implemented 'dinc' and 'drnd' functions to be used for proto fields,
and generate values at runtime. Parsing of proto field values
for unified to make extending of field functions more easier w/o
copy/paste similar rules for each proto field. Instead of that
the field_expr struct is used to keep
Add dynamic proto field function which can generate
random value in specified range (default 0 - MAX_UINT32).
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 27 +++
trafgen_proto.h | 1 +
2 files changed, 28 insertions(+)
diff --git
Move hw timestamp enable/disable code to sock.c as
it is a socket related functionality, and it makes
have less files in source tree.
Move tstamping related includes under HAVE_TSTAMPING config
to compile them only if hw timestamping is suported.
Signed-off-by: Vadim Kochan
17 matches
Mail list logo