Bug 51002 - new feature for net/trafshow
Summary: new feature for net/trafshow
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-15 21:40 UTC by Luigi Rizzo
Modified: 2003-06-27 08:38 UTC (History)
0 users

See Also:


Attachments
file.diff (3.24 KB, patch)
2003-04-15 21:40 UTC, Luigi Rizzo
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luigi Rizzo 2003-04-15 21:40:17 UTC
the attached patch implements a new option for net/trafsnow. From the
manpage:
       -m     [src-ip M] [dst-ip M] [src-port M] [dst-port M] [proto M]
              Mask the specified field with mask M (which should be  specified
              as  an  hex number e.g. 0xffff0000) before further processing of
              the packet. This allows to aggregate traffic in the  display  to
              ease analysis.

Fix: attached is a patch to put in ports/net/trafshow/files/patch-mask
Comment 1 Ryan Thompson 2003-04-18 06:59:24 UTC
> >Description:
> the attached patch implements a new option for net/trafsnow. From the
> manpage:
>        -m     [src-ip M] [dst-ip M] [src-port M] [dst-port M] [proto M]
>               Mask the specified field with mask M (which should be  specified
>               as  an  hex number e.g. 0xffff0000) before further processing of
>               the packet. This allows to aggregate traffic in the  display  to
>               ease analysis.

Luigi,

This seems like an interesting feature. The patch appears to have at
least a few issues. (I only had a few minutes to look into this):

o The masks are reset to zero when -m is specified (so all fields are
  completely masked, which isn't very helpful ;-)
o Using strtol() on an unsigned value will return LONG_MAX =
  0x7fffffff for any fully specified masks.
o Masks are applied in reverse order, so a mask of 0xffffff00 will
  mask the most significant byte (/8) instead of the least significant
  byte (/24) as expected.
o Unnecessary (debug?) output seems to have been left behind

Has this patch been tested?

- Ryan

--
  Ryan Thompson <ryan@sasknow.com>

  SaskNow Technologies - http://www.sasknow.com
  901-1st Avenue North - Saskatoon, SK - S7K 1Y4

        Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America
Comment 2 Ryan Thompson 2003-06-27 07:31:47 UTC
This PR can be closed. I've just filed ports/53807, which contains an
updated patch from the originator.

Thanks,
- Ryan

-- 
  Ryan Thompson <ryan@sasknow.com>

  SaskNow Technologies - http://www.sasknow.com
  901-1st Avenue North - Saskatoon, SK - S7K 1Y4

        Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America
Comment 3 Erwin Lansing freebsd_committer freebsd_triage 2003-06-27 08:37:44 UTC
State Changed
From-To: open->closed

Superseded by ports/53807