Re: [netsniff-ng] netsniff-ng: mac80211: Better print layout for "HT Capabilities" element ?

2015-04-22 Thread Vadim Kochan
On Thu, Apr 23, 2015 at 12:05:55AM +0200, Daniel Borkmann wrote:
> On 04/22/2015 11:50 PM, Vadim Kochan wrote:
> ...
> >I think that "HT Capabilities" element info should be showed in more 
> >structured view so
> >it will be more readable what do you think ?
> >
> >Does someone have a better option ?
> 
> Yes, I'm fine with that.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "netsniff-ng" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to netsniff-ng+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

OK, I have some working output example:


[ Radiotap Version (0), Length (26), Flags (0x482f) ]
 [ 802.11 Frame Control (0x0040)]
 [ Proto Version (0), Type (0, Management), Duration (0),
Destination (ff:ff:ff:ff:ff:ff) 
Source (9c:4e:36:a5:38:98) => (Intel Corporate:a5:38:98)
BSSID (ff:ff:ff:ff:ff:ff) 
Fragmentnr. (0), Seqnr. (1980). Subtype (4, Probe Request) ]
 [ Subtype Probe Request: 
Info Elements:
 SSID (0, Len (8)): blizzard
 Supp. Rates (1, Len (8)): 1 2 5.5 11 6 9 12 18 
 Ext Support Rates (50, Len(4)): 24 36 48 54 
 HT Capabilities (45, Len(26)):
 Info:
 LDCP Cod Cap (0)
 Supp Ch Width Set (0)
 SM Pwr Save(0)
 HT-Greenfield (1)
 Short GI for 20/40 MHz (1/0)
 Tx/Rx STBC (0/1)
 HT-Delayed Block Ack (0)
 Max A-MSDU Len (1)
 DSSS/CCK Mode in 40 MHz (0)
 Res (0x0)
 Forty MHz Intol (0)
 L-SIG TXOP Protection Supp (0)
 A-MPDU Params:
 Max Len Exp (0)
 Min Start Spacing (2)
 Res (0x7)
 Supp MCS Set:
 Rx MCS Bitmask (0x)
 Res (0x0)
 Rx High Supp Data Rate (0)
 Res (0x0)
 Tx MCS Set Def (0)
 Tx Rx MCS Set Not Eq (0)
 Tx Max Number Spat Str Supp (0)
 Tx Uneq Mod Supp (0)
 Res (0x0)
 Ext Cap:
 PCO (0)
 PCO Trans Time (0)
 Res (0x0)
 MCS Feedb (0)
 +HTC Supp (0)
 RD Resp (0)
 Res (0x0)
 Transm Beamf:
 Impl Transm Beamf Rec Cap (0)
 Rec/Transm Stagg Sound Cap (0/0)
 Rec/Trans NDP Cap (0/0)
 Impl Transm Beamf Cap (0)
 Cal (0)
 Expl CSI Transm Beamf Cap (0)
 Expl Noncmpr/Compr Steering Cap (0/0)
 Expl Trans Beamf CSI Feedb (0)
 Expl Noncmpr/Cmpr Feedb Cap (0/0)
 Min Grpg (0)
 CSI Num Beamf Ant Supp (0)
 Noncmpr/Cmpr Steering Nr Beamf Ant Supp (0/0)
 CSI Max Nr Rows Beamf Supp (0)
 Ch Estim Cap (0)
 Res (0x0)
 ASEL:
 Ant Select Cap (0)
 Expl CSI Feedb Based Transm ASEL Cap (0)
 Ant Indic Feedb Based Transm ASEL Cap (0)
 Expl CSI Feedb Cap (0)
 Ant Indic Feedb Cap (0)
 Rec ASEL Cap (0)
 Transm Sound PPDUs Cap (0)
 Res (0x0)
Reserved (21, Len (110)): Failed to dissect Subtype ]

May be it would be good to add '(' and ')' around information elements
to visually separate them ?


 [ Subtype Probe Request: 
Info Elements:
 (SSID (0, Len (8)): blizzard),
 (Supp. Rates (1, Len (8)): 1 2 5.5 11 6 9 12 18),
 (Ext Support Rates (50, Len(4)): 24 36 48 54), 
 (HT Capabilities (45, Len(26)):
 Info:
 LDCP Cod

Re: [netsniff-ng] netsniff-ng: mac80211: Better print layout for "HT Capabilities" element ?

2015-04-22 Thread Daniel Borkmann

On 04/22/2015 11:50 PM, Vadim Kochan wrote:
...

I think that "HT Capabilities" element info should be showed in more structured 
view so
it will be more readable what do you think ?

Does someone have a better option ?


Yes, I'm fine with that.

--
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] netsniff-ng: mac80211: Better print layout for "HT Capabilities" element ?

2015-04-22 Thread Vadim Kochan
Hi,


I think that "HT Capabilities" element info should be showed in more structured 
view so
it will be more readable what do you think ?

Does someone have a better option ?

Current
---

[ Radiotap Version (0), Length (26), Flags (0x482f) ]
 [ 802.11 Frame Control (0x0040)]
 [ Proto Version (0), Type (0, Management), Duration (0),
Destination (ff:ff:ff:ff:ff:ff) 
Source (9c:4e:36:a5:38:98) => (Intel Corporate:a5:38:98)
BSSID (ff:ff:ff:ff:ff:ff) 
Fragmentnr. (0), Seqnr. (1980). Subtype (4, Probe Request) ]
 [ Subtype Probe Request: 
Parameters: SSID (0, Len (8)): blizzard
 Supp. Rates (1, Len (8)): 1 2 5.5 11 6 9 12 18 
 Ext Support Rates (50, Len(4)): 24 36 48 54 
 HT Capabilities (45, Len(26)): Info (LDCP Cod Cap (0), Supp Ch Width 
Set (0), SM Pwr Save(0), HT-Greenfield (1), Short GI for 20/40 MHz (1/0), Tx/Rx 
STBC (0/1), 
   HT-Delayed Block Ack (0), Max A-MSDU Len (1), DSSS/CCK Mode in 40 MHz (0), 
Res (0x0), Forty MHz Intol (0), L-SIG TXOP Protection Supp (0)), A-MPDU Params 
(Max L
   en Exp (0), Min Start Spacing (2), Res (0x7)), Supp MCS Set (Rx MCS Bitmask 
(0x), Res (0x0), Rx High Supp Data Rate (0), Res (0x0), Tx MCS Set 
Def (
   0), Tx Rx MCS Set Not Eq (0), Tx Max Number Spat Str Supp (0), Tx Uneq Mod 
Supp (0), Res (0x0)), Ext Cap (PCO (0), PCO Trans Time (0), Res (0x0), MCS 
Feedb (0),
   +HTC Supp (0), RD Resp (0), Res (0x0)), Transm Beamf (Impl Transm Beamf Rec 
Cap (0), Rec/Transm Stagg Sound Cap (0/0), Rec/Trans NDP Cap (0/0), Impl Transm 
Beam
   f Cap (0), Cal (0), Expl CSI Transm Beamf Cap (0), Expl Noncmpr/Compr 
Steering Cap (0/0), Expl Trans Beamf CSI Feedb (0), Expl Noncmpr/Cmpr Feedb Cap 
(0/0), Min
   Grpg (0), CSI Num Beamf Ant Supp (0), Noncmpr/Cmpr Steering Nr Beamf Ant 
Supp (0/0), CSI Max Nr Rows Beamf Supp (0), Ch Estim Cap (0), Res (0x0)), ASEL 
(Ant Sel
   ect Cap (0), Expl CSI Feedb Based Transm ASEL Cap (0), Ant Indic Feedb Based 
Transm ASEL Cap (0), Expl CSI Feedb Cap (0), Ant Indic Feedb Cap (0), Rec ASEL 
Cap 
   (0), Transm Sound PPDUs Cap (0), Res (0x0))
Reserved (21, Len (110)): Failed to dissect Subtype ]


New
---
[ Radiotap Version (0), Length (26), Flags (0x482f) ]
 [ 802.11 Frame Control (0x0040)]
 [ Proto Version (0), Type (0, Management), Duration (0),
Destination (ff:ff:ff:ff:ff:ff) 
Source (9c:4e:36:a5:38:98) => (Intel Corporate:a5:38:98)
BSSID (ff:ff:ff:ff:ff:ff) 
Fragmentnr. (0), Seqnr. (1980). Subtype (4, Probe Request) ]
 [ Subtype Probe Request: 
Parameters: SSID (0, Len (8)): blizzard
 Supp. Rates (1, Len (8)): 1 2 5.5 11 6 9 12 18 
 Ext Support Rates (50, Len(4)): 24 36 48 54 
 HT Capabilities (45, Len(26)):
   Info
LDCP Cod Cap (0),
Supp Ch Width Set (0),
SM Pwr Save(0),
HT-Greenfield (1),
Short GI for 20/40 MHz (1/0),
Tx/Rx STBC (0/1), 
HT-Delayed Block Ack (0),
Max A-MSDU Len (1),
DSSS/CCK Mode in 40 MHz (0),
Res (0x0),
Forty MHz Intol (0),
L-SIG TXOP Protection Supp (0)

   A-MPDU Params:
Max Len Exp (0)
Min Start Spacing (2)
Res (0x7)

   Supp MCS Set:
Rx MCS Bitmask (0x),
Res (0x0), Rx High Supp Data Rate (0),
Res (0x0),
Tx MCS Set Def (0),
Tx Rx MCS Set Not Eq (0),
Tx Max Number Spat Str Supp (0),
Tx Uneq Mod Supp (0), Res (0x0)

   Ext Cap:
PCO (0),
PCO Trans Time (0),
Res (0x0),
MCS Feedb (0),
+HTC Supp (0),
RD Resp (0),
Res (0x0)

   Transm Beamf:
Impl Transm Beamf Rec Cap (0),
Rec/Transm Stagg Sound Cap (0/0),
Rec/Trans NDP Cap (0/0),
Impl Transm Beamf Cap (0),
Cal (0),
Expl CSI Transm Beamf Cap (0),
Expl Noncmpr/Compr Steering Cap (0/0),
Expl Trans Beamf CSI Feedb (0),
Expl Noncmpr/Cmpr Feedb Cap (0/0),
Min Grpg (0),
CSI Num Beamf Ant Supp (0),
Noncmpr/Cmpr Steering Nr Beamf Ant Supp (0/0),
CSI Max Nr Rows Beamf Supp (0),
Ch Estim Cap (0), Res (0x0)

   ASEL:
Ant Select Cap (0),
Expl CSI Feedb Based Transm ASEL Cap (0),
Ant Indic Feedb Based Transm ASEL Cap (0),
Expl CSI Feedb Cap (0),
Ant Indic Feedb Cap (0),
Rec ASEL Cap (0),
Transm Sound PPDUs Cap (0),
Res (0x0)
   
Reserved (21, Len (110)): Fa

Re: [netsniff-ng] [PATCH] netsniff-ng: Dont set IO prio when reading pcap file

2015-04-22 Thread Tobias Klauser
On 2015-04-22 at 18:26:11 +0200, Vadim Kochan  wrote:
> From: Vadim Kochan 
> 
> It allows to read pcap file for users who have no
> permissions to set process IO prio.
> 
> Signed-off-by: Vadim Kochan 

Applied with Daniel's Acked-by. Thanks a lot Vadim!

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] [PATCH] netsniff-ng: Dont set IO prio when reading pcap file

2015-04-22 Thread Daniel Borkmann

On 04/22/2015 06:26 PM, Vadim Kochan wrote:

From: Vadim Kochan 

It allows to read pcap file for users who have no
permissions to set process IO prio.

Signed-off-by: Vadim Kochan 


I'm okay with that, read_pcap() is slow-path anyway.

Thanks

--
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] netsniff-ng: Do we need to set IO prio when do only read from pcap ?

2015-04-22 Thread Vadim Kochan
On Wed, Apr 22, 2015 at 05:37:42PM +0200, Daniel Borkmann wrote:
> On 04/22/2015 05:09 PM, Vadim Kochan wrote:
> ...
> >Sure, I will try to fix it, really I dont have a fix yet. The issue goes
> >from pcap ops in init one function, where IO prio is set, the first
> >think which came up in my mind is to have separate pcap ops for read
> >only where set IO prio will be not called ... but I am not sure if it is
> >correct.
> 
> I think we have two options:
> 
> 1) Don't panic on error, but perhaps just throw a warning to the user
>instead in case of insufficient permissions.
> 
> 2) Change init_once_pcap() into void (*init_once_pcap)(bool enforce_prio);
>and push down the enforcement into the various functions, and inside
>read_pcap(), you'd set __pcap_io->init_once_pcap(false). And in case
>the enforcement is not set, we just move on silently.
> 
> Perhaps 2nd option is cleaner?

OK, I 've send a fix but it needs also to be applied the patch with a title:

[PATCH] netsniff-ng: Seems typo in getting current group id
https://groups.google.com/forum/?hl=en#!topic/netsniff-ng/7vKdK3FesSU

Because of initializing wrong ctx->gid the user could not change the
group because of the permissions when reading pcap file.

Regards,

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] [PATCH] netsniff-ng: Dont set IO prio when reading pcap file

2015-04-22 Thread Vadim Kochan
From: Vadim Kochan 

It allows to read pcap file for users who have no
permissions to set process IO prio.

Signed-off-by: Vadim Kochan 
---
 netsniff-ng.c | 6 +++---
 pcap_io.h | 2 +-
 pcap_mm.c | 5 +++--
 pcap_rw.c | 5 +++--
 pcap_sg.c | 5 +++--
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/netsniff-ng.c b/netsniff-ng.c
index c0d70c8..139bef9 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -228,7 +228,7 @@ static void pcap_to_xmit(struct ctx *ctx)
}
 
if (__pcap_io->init_once_pcap)
-   __pcap_io->init_once_pcap();
+   __pcap_io->init_once_pcap(true);
 
ret = __pcap_io->pull_fhdr_pcap(fd, &ctx->magic, &ctx->link_type);
if (ret)
@@ -567,7 +567,7 @@ static void read_pcap(struct ctx *ctx)
}
 
if (__pcap_io->init_once_pcap)
-   __pcap_io->init_once_pcap();
+   __pcap_io->init_once_pcap(false);
 
ret = __pcap_io->pull_fhdr_pcap(fd, &ctx->magic, &ctx->link_type);
if (ret)
@@ -963,7 +963,7 @@ static void recv_only_or_dump(struct ctx *ctx)
ifflags = device_enter_promiscuous_mode(ctx->device_in);
 
if (dump_to_pcap(ctx) && __pcap_io->init_once_pcap)
-   __pcap_io->init_once_pcap();
+   __pcap_io->init_once_pcap(true);
 
drop_privileges(ctx->enforce, ctx->uid, ctx->gid);
 
diff --git a/pcap_io.h b/pcap_io.h
index c3fc951..35faa51 100644
--- a/pcap_io.h
+++ b/pcap_io.h
@@ -122,7 +122,7 @@ enum pcap_mode {
 };
 
 struct pcap_file_ops {
-   void (*init_once_pcap)(void);
+   void (*init_once_pcap)(bool enforce_prio);
int (*pull_fhdr_pcap)(int fd, uint32_t *magic, uint32_t *linktype);
int (*push_fhdr_pcap)(int fd, uint32_t magic, uint32_t linktype);
int (*prepare_access_pcap)(int fd, enum pcap_mode mode, bool jumbo);
diff --git a/pcap_mm.c b/pcap_mm.c
index 5b3cfcb..f7b248e 100644
--- a/pcap_mm.c
+++ b/pcap_mm.c
@@ -148,9 +148,10 @@ static void __pcap_mm_prepare_access_rd(int fd)
ptr_va_curr = ptr_va_start + sizeof(struct pcap_filehdr);
 }
 
-static void pcap_mm_init_once(void)
+static void pcap_mm_init_once(bool enforce_prio)
 {
-   set_ioprio_be();
+   if (enforce_prio)
+   set_ioprio_be();
 }
 
 static int pcap_mm_prepare_access(int fd, enum pcap_mode mode, bool jumbo)
diff --git a/pcap_rw.c b/pcap_rw.c
index 5a739da..b6be922 100644
--- a/pcap_rw.c
+++ b/pcap_rw.c
@@ -57,9 +57,10 @@ static ssize_t pcap_rw_read(int fd, pcap_pkthdr_t *phdr, 
enum pcap_type type,
return hdrsize + hdrlen;
 }
 
-static void pcap_rw_init_once(void)
+static void pcap_rw_init_once(bool enforce_prio)
 {
-   set_ioprio_rt();
+   if (enforce_prio)
+   set_ioprio_rt();
 }
 
 static void pcap_rw_fsync(int fd)
diff --git a/pcap_sg.c b/pcap_sg.c
index 9d07656..80c2c5d 100644
--- a/pcap_sg.c
+++ b/pcap_sg.c
@@ -145,9 +145,10 @@ static void pcap_sg_fsync(int fd)
fdatasync(fd);
 }
 
-static void pcap_sg_init_once(void)
+static void pcap_sg_init_once(bool enforce_prio)
 {
-   set_ioprio_rt();
+   if (enforce_prio)
+   set_ioprio_rt();
 }
 
 static int pcap_sg_prepare_access(int fd, enum pcap_mode mode, bool jumbo)
-- 
2.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] [PATCH] netsniff-ng: Seems typo in getting current group id

2015-04-22 Thread Tobias Klauser
On 2015-04-22 at 16:36:50 +0200, Vadim Kochan  wrote:
> From: Vadim Kochan 
> 
> Changed to use ctx->gid when call getgid() on init_ctx.
> 
> Signed-off-by: Vadim Kochan 

Nice catch! Thanks a lot Vadim.

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] netsniff-ng: Do we need to set IO prio when do only read from pcap ?

2015-04-22 Thread Vadim Kochan
On Wed, Apr 22, 2015 at 05:37:42PM +0200, Daniel Borkmann wrote:
> On 04/22/2015 05:09 PM, Vadim Kochan wrote:
> ...
> >Sure, I will try to fix it, really I dont have a fix yet. The issue goes
> >from pcap ops in init one function, where IO prio is set, the first
> >think which came up in my mind is to have separate pcap ops for read
> >only where set IO prio will be not called ... but I am not sure if it is
> >correct.
> 
> I think we have two options:
> 
> 1) Don't panic on error, but perhaps just throw a warning to the user
>instead in case of insufficient permissions.
> 
> 2) Change init_once_pcap() into void (*init_once_pcap)(bool enforce_prio);
>and push down the enforcement into the various functions, and inside
>read_pcap(), you'd set __pcap_io->init_once_pcap(false). And in case
>the enforcement is not set, we just move on silently.
> 
> Perhaps 2nd option is cleaner?

Sure 2nd looks OK, but still what about this pcap_rw.c: ?

const struct pcap_file_ops pcap_rw_ops = {
.init_once_pcap = pcap_rw_init_once,
.pull_fhdr_pcap = pcap_generic_pull_fhdr,
.push_fhdr_pcap = pcap_generic_push_fhdr,
.read_pcap = pcap_rw_read,
.write_pcap = pcap_rw_write,
.fsync_pcap = pcap_rw_fsync,
};

New ops goes right after:

const struct pcap_file_ops pcap_ro_ops = {
.pull_fhdr_pcap = pcap_generic_pull_fhdr,
.read_pcap = pcap_rw_read,
};

Also it requires to use new pcap ops index in pcap_io.h:

static const struct pcap_file_ops *pcap_ops[] __maybe_unused = {
[PCAP_OPS_RW]   =   &pcap_rw_ops,
[PCAP_OPS_RO]   =   &pcap_ro_ops,
[PCAP_OPS_SG]   =   &pcap_sg_ops,
[PCAP_OPS_MM]   =   &pcap_mm_ops,
};

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] netsniff-ng: Do we need to set IO prio when do only read from pcap ?

2015-04-22 Thread Daniel Borkmann

On 04/22/2015 05:09 PM, Vadim Kochan wrote:
...

Sure, I will try to fix it, really I dont have a fix yet. The issue goes
from pcap ops in init one function, where IO prio is set, the first
think which came up in my mind is to have separate pcap ops for read
only where set IO prio will be not called ... but I am not sure if it is
correct.


I think we have two options:

1) Don't panic on error, but perhaps just throw a warning to the user
   instead in case of insufficient permissions.

2) Change init_once_pcap() into void (*init_once_pcap)(bool enforce_prio);
   and push down the enforcement into the various functions, and inside
   read_pcap(), you'd set __pcap_io->init_once_pcap(false). And in case
   the enforcement is not set, we just move on silently.

Perhaps 2nd option is cleaner?

--
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] netsniff-ng: Do we need to set IO prio when do only read from pcap ?

2015-04-22 Thread Vadim Kochan
On Wed, Apr 22, 2015 at 05:02:52PM +0200, Daniel Borkmann wrote:
> On 04/22/2015 05:00 PM, Vadim Kochan wrote:
> >Hi,
> >
> >It is not possible to just read pcap by netsniff-ng if user permissions
> >does not allow to set processes IO prio, so it is really needed to do it
> >just for print pcap file ?
> 
> Thanks for the report Vadim!
> 
> No, it's not a requirement. Do you mind sending a patch?
> 
> Thanks,
> Daniel
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "netsniff-ng" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to netsniff-ng+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Sure, I will try to fix it, really I dont have a fix yet. The issue goes
from pcap ops in init one function, where IO prio is set, the first
think which came up in my mind is to have separate pcap ops for read
only where set IO prio will be not called ... but I am not sure if it is
correct.

Regards,
Vadim Kochan

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] netsniff-ng: Do we need to set IO prio when do only read from pcap ?

2015-04-22 Thread Daniel Borkmann

On 04/22/2015 05:00 PM, Vadim Kochan wrote:

Hi,

It is not possible to just read pcap by netsniff-ng if user permissions
does not allow to set processes IO prio, so it is really needed to do it
just for print pcap file ?


Thanks for the report Vadim!

No, it's not a requirement. Do you mind sending a patch?

Thanks,
Daniel

--
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] netsniff-ng: Do we need to set IO prio when do only read from pcap ?

2015-04-22 Thread Vadim Kochan
Hi,

It is not possible to just read pcap by netsniff-ng if user permissions
does not allow to set processes IO prio, so it is really needed to do it
just for print pcap file ?

Thanks,

Vadim Kochan

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] [PATCH] netsniff-ng: Seems typo in getting current group id

2015-04-22 Thread Vadim Kochan
From: Vadim Kochan 

Changed to use ctx->gid when call getgid() on init_ctx.

Signed-off-by: Vadim Kochan 
---
 netsniff-ng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netsniff-ng.c b/netsniff-ng.c
index c0d70c8..4ad8b19 100644
--- a/netsniff-ng.c
+++ b/netsniff-ng.c
@@ -1096,7 +1096,7 @@ static void init_ctx(struct ctx *ctx)
memset(ctx, 0, sizeof(*ctx));
 
ctx->uid = getuid();
-   ctx->uid = getgid();
+   ctx->gid = getgid();
 
ctx->cpu = -1;
ctx->packet_type = -1;
-- 
2.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [netsniff-ng] [PATCH] iosched: Print error cause if setting io prio failed

2015-04-22 Thread Tobias Klauser
On 2015-04-22 at 16:07:29 +0200, Vadim Kochan  wrote:
> From: Vadim Kochan 
> 
> Add error cause message when ioprio_setpid fails.
> 
> Signed-off-by: Vadim Kochan 

Applied, thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] [PATCH] iosched: Print error cause if setting io prio failed

2015-04-22 Thread Vadim Kochan
From: Vadim Kochan 

Add error cause message when ioprio_setpid fails.

Signed-off-by: Vadim Kochan 
---
 iosched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iosched.c b/iosched.c
index 7417973..ff82126 100644
--- a/iosched.c
+++ b/iosched.c
@@ -47,7 +47,7 @@ static void ioprio_setpid(pid_t pid, int ioprio, int ioclass)
int ret = ioprio_set(ioprio_who_process, pid,
 ioprio | ioclass << IOPRIO_CLASS_SHIFT);
if (ret < 0)
-   panic("Failed to set io prio for pid!\n");
+   panic("Failed to set io prio for pid: %s\n", strerror(errno));
 }
 
 void ioprio_print(void)
-- 
2.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"netsniff-ng" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to netsniff-ng+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[netsniff-ng] netsniff-ng 0.5.9-rc5

2015-04-22 Thread Tobias Klauser
It's been more than a while since the last release candidate even though
I promised a release within 2-3 weeks from -rc4. That one obviously
didn't happen due to various reasons...

Since there have been several changes since then - some of them quite
substantial - we'd like to have another release candidate before
releasing the final v0.5.9.

So please give it some good testing and if no major regressions surface,
we'll have v0.5.9 in a week or so.

Thanks and happy testing!

---

netsniff-ng 0.5.9-rc5 has been released to the public (http://netsniff-ng.org/).

It can be fetched via Git:

   git clone git://github.com/netsniff-ng/netsniff-ng.git
   git checkout v0.5.9-rc5

Or via HTTP from one of our mirrors:

   http://pub.netsniff-ng.org/netsniff-ng/netsniff-ng-0.5.9-rc5.tar.gz
   http://mirror.distanz.ch/netsniff-ng/netsniff-ng-0.5.9-rc5.tar.gz
   http://github.com/netsniff-ng/netsniff-ng/archive/v0.5.9-rc5.tar.gz

The release can be verified via Git (see README):

   git tag -v v0.5.9-rc5

Major high-level changes since the last release are:

1) Packet fanout support for netsniff-ng. From Michał Purzyński.

2) Several improvements when using netsniff-ng on wireless interfaces. From
   Vadim Kochan.

3) Allow to filter traffic from an input pcap to an output pcap using
   netsniff-ng. From Vadim Kochan.

4) Bug fixes, performance improvements and general fixes all over the place.
   From Daniel Borkmann, Eric Dumazet, Vadim Kochan, Mark Latimer, Tillmann
   Karras, wilson, and Tobias Klauser.

Contributions since last release:

 48  Tobias Klauser
 17  Vadim Kochan
  4  Daniel Borkmann
  1  wilson
  1  Tillmann Karras
  1  Michał Purzyński
  1  Mark Latimer
  1  Eric Dumazet

Git changelog since last release:

Tobias Klauser (48):
  trafgen: Replace variable length arrays
  build: Add continuous integration support via travis-ci
  mausezahn: Fix non-ANSI function declarations
  build: travis: Install dependencies before build
  build: travis: Pass on CC environment variable to make
  build: travis: Disable clang for now
  trafgen: Consistently use unsigned int for number of CPUs
  trafgen: Don't duplicate copyright/bug report/license string
  netsniff-ng: Don't duplicate copyright/bug report/license string
  ifpps: Don't duplicate copyright/bug report/license string
  astraceroute: Don't duplicate copyright/bug report/license string
  flowtop: Don't duplicate copyright/bug report/license string
  bpfc: Don't duplicate copyright/bug report/license string
  build: Change return type of main in configure compile test programs
  build: travis: Re-enable clang and also use it for configure
  build: Detect compiler (gcc or clang) and filter out compiler flags
  flowtop: Simplify entry skip logic
  flowtop: Use integer conversion to determine PID proc entries
  build: Don't overwrite CC variable
  netsniff-ng: Remove useless check for ctx.device_in
  sock: Error out if setting of the system socket memory fails
  dissector: Don't re-initialize packet_types array
  dissectors: 80211_mac_hdr: Fix clang warning
  dissectors: 80211_mac_hdr: Remove remaining binary constants
  netsniff-ng: Unindent goto label
  netsniff-ng: Remvoe unnecessary cast to void *
  csum: Use ISO C fixed width types
  INSTALL: Fix formatting
  netsniff-ng: Move variable definition
  ring_rx: Fix typo in header guard #endif
  netsniff-ng: Fix tpacketv2-only capturing
  built_in: Remove unused macro force_cast
  build: Make ccache opt-in rather than opt-out
  netsniff-ng: Combine redundant pcap file rotation logic into function
  all: Reduce amount of empty liens in usage and version output a bit
  xmalloc: Remove unnecessary NULL check before realloc()
  xmalloc: Make xrealloc() arguments conform to realloc()
  proto: Make protocol->key member const
  build: Initialize value of $C (sparse checker enable/disable)
  trafgen: Remove note about trafgen.txf example from help text
  netsniff-ng: No trailing whitespaces in generated trafgen config files
  netsniff-ng: Explicitely NULL-terminate readlink() result buffer
  xmalloc: Add attribute warn_unused_result to allocation functions
  mausezahn: Make sure '\0' is written after strncpy
  ring: Make ifname paramter to ring_size() const
  dev: Close socket in error path of device_ifindex_get()
  dissectors: 80211_mac_hdr: Check return value of pkt_pull
  netsniff-ng v0.5.9-rc5

Vadim Kochan (17):
  sock: Add cause message in case of error
  gitignore: Add compiled executables
  netsniff: Allow filter input pcap file to output pcap
  geoip: Fix update failing
  mz: Dont bind to dev if help was specified
  mz: Allow to print packet types by '-t help'
  mz: Add igmp v1/v2 packet type crafting support
  flowtop: Don't init screen until collector is