On 2016-01-26 at 09:47:32 +0100, Vadim Kochan wrote:
> On Tue, Jan 26, 2016 at 10:25 AM, Tobias Klauser wrote:
> > On 2016-01-26 at 00:11:53 +0100, Vadim Kochan wrote:
> >> Add syntax to generate ARP header fields:
> >>
> >> {
Hi everyone!
I've googled a bit but not found any good answer to my question. Maybe you can
help me out?
Currently I'm running five netsniff processes capturing data from five
different interfaces. It works really well with the limiting factor SSD write
speed, not netsniff itself. To make
On 2016-01-26 at 00:11:57 +0100, Vadim Kochan wrote:
> 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
On Tue, Jan 26, 2016 at 10:25 AM, Tobias Klauser wrote:
> On 2016-01-26 at 00:11:53 +0100, Vadim Kochan wrote:
>> 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:
On 2016-01-26 at 00:11:45 +0100, Vadim Kochan wrote:
[...]
> +void proto_header_init(enum proto_id pid)
> +{
> + struct proto_hdr *hdr = proto_header_by_id(pid);
> + struct proto_hdr *new;
> +
> + if (headers_count >= PROTO_MAX_LAYERS)
> + panic("Too
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 func for convert string to MAC address.
Signed-off-by: Vadim Kochan
---
str.c | 25 +
str.h | 1 +
2 files changed, 26 insertions(+)
diff --git a/str.c b/str.c
index e4d8722..a3421b0 100644
--- a/str.c
+++ b/str.c
@@ -7,6 +7,7 @@
#include
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 | 17 +
trafgen_parser.y | 48 +++-
2 files changed,
Add helper function for easy set device's MAC address to proto
field which may be used by Ethernet & ARP protos generation.
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 31 +++
trafgen_proto.h | 3 +++
2 files changed, 34 insertions(+)
diff
Add device_hw_address func to get device's MAC address.
Signed-off-by: Vadim Kochan
---
dev.c | 23 +++
dev.h | 1 +
2 files changed, 24 insertions(+)
diff --git a/dev.c b/dev.c
index cf8d643..ad7b917 100644
--- a/dev.c
+++ b/dev.c
@@ -124,6 +124,29 @@
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
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,
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
---
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 description (basic syntax, proto header fields) for newer added
proto headers:
Ethernet, ARP, IPv4, UDP.
Signed-off-by: Vadim Kochan
---
trafgen.8 | 186 ++
1 file changed, 186 insertions(+)
diff --git
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
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 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
18 matches
Mail list logo