On 2016-01-25 at 10:06:04 +0100, Vadim Kochan wrote:
> On Mon, Jan 25, 2016 at 09:56:37AM +0100, Tobias Klauser wrote:
> > On 2016-01-21 at 00:19:48 +0100, Vadim Kochan wrote:
> > > Add new trafgen proto generation framework which allows to describe
> > >
Add ARP proto header fields generation via src mac, src ip,
dst mac, dst ip & operaion.
By default Ethernet proto will be initialized, and ARP Announcement
request is filled.
Signed-off-by: Vadim Kochan
---
trafgen_l2.c | 52
Add description (basic syntax, proto header fields) for newer added
proto headers:
Ethernet, ARP, IPv4, UDP.
Signed-off-by: Vadim Kochan
---
trafgen.8 | 174 ++
1 file changed, 174 insertions(+)
diff --git
Add syntax for generating Ethernet header fields like:
{ eth(prot=0x0800, da=11:22:33:44:55:66), fill(0xff, 60) }
{ eth(prot=0x0800) }
{ eth() }
It is important that proto_init is called before fields will be filled
to initialize the specified proto with header fields.
Add helper which fill device's ipv4 addr to the specified proto field.
It will be used by such protos like ARP, IPv4, etc.
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 32
trafgen_proto.h | 3 +++
2 files changed, 35 insertions(+)
diff
Add trafgen_l4.c module with implementation
of UDP header fields gneration.
UDP proto generation logic automaticaly sets by default
IPPROTO_UDP to the lower proto if it is IPv4, also cscum is
calculated if it is not set by user.
Signed-off-by: Vadim Kochan
---
Add current_packet() helper for getting current
used packet and make it public to other modules.
It will be used by proto generation logic.
Signed-off-by: Vadim Kochan
---
trafgen_conf.h | 2 ++
trafgen_parser.y | 5 +
2 files changed, 7 insertions(+)
diff --git
Add new trafgen_proto.c module with basic proto
header fields generation logic.
Each proto must implement proto_hdr struct and register it
to the global proto list.
Proto header consist from set of fields, and each field must be
described via proto_field struct by specifying unique id, len,
Make public set_fill func to be used by proto generation code.
Signed-off-by: Vadim Kochan
---
trafgen_conf.h | 2 ++
trafgen_parser.y | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/trafgen_conf.h b/trafgen_conf.h
index b171798..887fa3d 100644
---
Add syntax to generate ARP header fields:
{ arp(op=req, sip=1.1.1.1, smac=11:22:33:44:55:66) }
{ arp() }
Signed-off-by: Vadim Kochan
---
trafgen_lexer.l | 15 +++
trafgen_parser.y | 38 +-
2 files changed, 52
Added trafgen syntax to set UDP header fields:
{ udp(sport=111, dport=222) }
Signed-off-by: Vadim Kochan
---
trafgen_lexer.l | 4
trafgen_parser.y | 29 +
2 files changed, 33 insertions(+)
diff --git a/trafgen_lexer.l b/trafgen_lexer.l
Add L3 module for implement L3 layer protos generation.
Implemented generating of IPv4 header with all fields except options.
By default IPv4 address of output device is used as src ip address.
On finish (after packet is specified) - total len & checksum is calculated.
Meanwhile Ethernet proto
Add trafgen_l2.c module for generating L2 related headers.
Add Ethernet header generating. By default source MAC address
is used from the specified output device.
Signed-off-by: Vadim Kochan
---
trafgen/Makefile | 1 +
trafgen_l2.c | 32
On 2016-01-21 at 00:19:58 +0100, Vadim Kochan wrote:
> Add ARP proto header fields generation via src mac, src ip,
> dst mac, dst ip & operaion.
>
> By default Ethernet proto will be initialized, and ARP probe
> request is filled.
>
> Signed-off-by: Vadim Kochan
On Mon, Jan 25, 2016 at 09:56:37AM +0100, Tobias Klauser wrote:
> On 2016-01-21 at 00:19:48 +0100, Vadim Kochan wrote:
> > Add new trafgen proto generation framework which allows to describe
> > proto header fields and easy build the proto header by set/get proto
> > header
On 2016-01-21 at 00:20:01 +0100, Vadim Kochan wrote:
> Add syntax to specify IPv4 header fields:
>
> { ip(df, mf, frag=100, prot=0x1, ecn=2, dscp=20) }
>
> Signed-off-by: Vadim Kochan
> ---
> trafgen_lexer.l | 15 +++
> trafgen_parser.y |
On Mon, Jan 25, 2016 at 10:15:24AM +0100, Tobias Klauser wrote:
> On 2016-01-21 at 00:19:52 +0100, Vadim Kochan wrote:
> > Add new trafgen_proto.c module with basic proto
> > header fields generation logic.
> >
> > Each proto must implement proto_gen struct and register it
> >
17 matches
Mail list logo