RE: [netsniff-ng] Replay pcap file on Xenomai kernel in real time

2016-02-01 Thread Umair Ali
Hello Tobias, I have read the read_pcap function. I am not expert in C just a beginner. I have understand the basic flow from the read_pcap function but still not fully. I am using the real time kernel Xenomai 3.0.1 and it uses the real time Ethernet driver and hence the name of the Ethernet

[netsniff-ng] [PATCH 3/7] trafgen: eth: Add setting next protocol id

2016-02-01 Thread Vadim Kochan
Move setting next protocol id field from higher protocols (ARP, IPv4) to Ethernet. It makes code little more generic w/o checking each lower protocol and setting specific field id. Signed-off-by: Vadim Kochan --- trafgen_l2.c | 24 +++- trafgen_l3.c | 4

[netsniff-ng] [PATCH 2/7] trafgen: proto: Add set_next_proto callback to struct proto_hdr

2016-02-01 Thread Vadim Kochan
Add set_next_proto callback to proto_hdr struct to allow lower protocol set next protocol id by enum proto_id. Extended proto_lower_default_add(...) function to take upper protocol to delegate it's id to lower protocol to set next protocol field. Signed-off-by: Vadim Kochan

[netsniff-ng] [PATCH 4/7] trafgen: ipv4: Add setting next protocol id

2016-02-01 Thread Vadim Kochan
Move setting lower protocol id field value from UDP & TCP protocols to IPv4 only, so lower layer will know exactly value to set in protocol id field. Signed-off-by: Vadim Kochan --- trafgen_l3.c | 30 -- trafgen_l4.c | 16 ++-- 2 files

[netsniff-ng] [PATCH 1/7] trafgen: proto: Simplify getting lower protocol after init

2016-02-01 Thread Vadim Kochan
Change proto_header_init(...) and proto_lower_default_add(...) functions to return struct proto_hdr * to do not call proto_current_header(...) after, so it makes more sense to get struct proto_hdr * right after initializing protocol by id. Signed-off-by: Vadim Kochan ---

[netsniff-ng] [PATCH 6/7] trafgen: parser: Add syntax for VLAN header creating

2016-02-01 Thread Vadim Kochan
Add 'vlan()' function to generate VLAN header. Fields supported: tpid|proto Set TPID (Tag Protocol Identifier) (default 0x8100) 1ad Set TPID field as 0x88a8 1q Set TPID field as 0x8100 tci Set TCI (Tag Control Information)

[netsniff-ng] [PATCH 7/7] trafgen: man: Add help for VLAN header function

2016-02-01 Thread Vadim Kochan
Add usage, syntax & parameters description for 'vlan()' function. Signed-off-by: Vadim Kochan --- trafgen.8 | 43 +++ 1 file changed, 43 insertions(+) diff --git a/trafgen.8 b/trafgen.8 index 207cfc5..1fe5536 100644 --- a/trafgen.8 +++

Re: [netsniff-ng] Replay pcap file on Xenomai kernel in real time

2016-02-01 Thread Daniel Borkmann
On 02/01/2016 04:51 PM, Tobias Klauser wrote: On 2016-02-01 at 15:38:28 +0100, Umair Ali wrote: [...] Sorry, but reviewing a random dump of code (that doesn't even compile) goes beyond the scope of what I'd consider support/help for netsniff-ng. +1 Ali, I find your

Re: [netsniff-ng] Replay pcap file on Xenomai kernel in real time

2016-02-01 Thread Tobias Klauser
On 2016-02-01 at 15:38:28 +0100, Umair Ali wrote: > Thanks a lot for the help offer. I can understand what you want to say. > > I need your feedback on the code which I have written. The flow of the code > is as follows > - Reader the pcap file. the pcap file contained the