Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2001 18:06:44 -0700
From:      Rob Austein <sra@hactrn.net>
To:        ports@FreeBSD.org
Subject:   A couple of patches to the trafshow-3.1 port
Message-ID:  <20011212010650.A027B548@z.hactrn.net>

next in thread | raw e-mail | index | archive | help
--Multipart_Tue_Dec_11_18:06:44_2001-1
Content-Type: text/plain; charset=US-ASCII

Here are a couple of patches to trafshow that I developed today while
using trafshow 3.1 on my laptop to help the terminal room staff debug
some problems on the wireless net here at the IETF in Salt Lake City.
Since these were keyboarded during working group meetings, they are
perhaps not the most elegant work ever done, but they do seem to work.

These both have to do with display of the IP protocol number.  As
shipped, trafshow 3.1 had two problems: (a) the list of protocol
numbers it could list was compiled in (rather than obtained from
/etc/protocols via getprotobyxxx()), and (b) if trafshow couldn't find
the protocol number, it would just write "unknown" rather than listing
the untranslated protocol number itself.  Since much of the traffic we
were tracking was random weird encapsulations that were hidden by
this, I had to do something about it.

As far as I can tell, this program has been orphaned; at least, the
main web site says "huh?" (in Russian).  Please feel free to pass
these patches along to the author if you know how to do so.

Anyway, in the hope that they will be useful, here are the patches.

Perhaps someday I'll hack this up to support IPv6 as well....

--Rob



--Multipart_Tue_Dec_11_18:06:44_2001-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="patch-sra-1"
Content-Transfer-Encoding: base64

LS0tIGRpc3BsYXkuYy5+MX4JVHVlIERlYyAxMSAxMToxMjoxNSAyMDAxCisrKyBkaXNwbGF5LmMJ
VHVlIERlYyAxMSAxMTozNjoyNCAyMDAxCkBAIC0xNjUsNyArMTY1LDcgQEAKIAlpbnQgbGluZTsK
IAlyZWdpc3RlciBpOwogewotCWNoYXIgKnByb3RvOworICAJY2hhciAqcHJvdG8sIHByb3RvYnVm
WzIwXTsKIAlpbnQgbm9ybWFsID0gVFJVRTsKIAogCW1vdmUoU0NSX09GRlMrbGluZSwgMCk7CkBA
IC0xODgsNyArMTg4LDEwIEBACiAJCWFkZHN0cihpbmV0X3ByaW50KGVudHJpZXNbaV0uZHN0LCBl
bnRyaWVzW2ldLmRwb3J0LCBlbnRyaWVzW2ldLnByb3RvKSk7CiAKIAkJcHJvdG8gPSBnZXRwcm90
b25hbWUoZW50cmllc1tpXS5wcm90byk7Ci0JCWlmIChwcm90byA9PSBOVUxMKSBwcm90byA9ICJ1
bmtub3duIjsKKwkJaWYgKHByb3RvID09IE5VTEwpIHsKKwkJICAJc25wcmludGYocHJvdG9idWYs
IHNpemVvZihwcm90b2J1ZiksICIlZCIsIGVudHJpZXNbaV0ucHJvdG8pOworCQkJcHJvdG8gPSBw
cm90b2J1ZjsKKwkJfQogCX0KIAogCXByaW50dygiICUtKi4qcyIsIHByb3RvX3NpemUsIHByb3Rv
X3NpemUsIHByb3RvKTsK

--Multipart_Tue_Dec_11_18:06:44_2001-1
Content-Type: text/plain; charset=US-ASCII



--Multipart_Tue_Dec_11_18:06:44_2001-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="patch-sra-2"
Content-Transfer-Encoding: base64

LS0tIHV0aWwuYy5+MX4JVHVlIERlYyAxMSAxMToxMjoxNiAyMDAxCisrKyB1dGlsLmMJVHVlIERl
YyAxMSAxNzo1MjozNyAyMDAxCkBAIC0xNCw2ICsxNCw4IEBACiAjaW5jbHVkZSA8Y29uZmlnLmg+
CiAjZW5kaWYKIAorI2RlZmluZSBVU0VfR0VUUFJPVE9CWVhYWCAxCisKICNpbmNsdWRlIDxzeXMv
dHlwZXMuaD4KICNpbmNsdWRlIDxzeXMvc3RhdC5oPgogI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4K
QEAgLTI4LDYgKzMwLDEwIEBACiAjZW5kaWYKICNpbmNsdWRlIDx1bmlzdGQuaD4KIAorI2lmIFVT
RV9HRVRQUk9UT0JZWFhYIAorI2luY2x1ZGUgPG5ldGRiLmg+CisjZW5kaWYKKwogI2luY2x1ZGUg
InRyYWZzaG93LmgiCiAKIHZvaWQKQEAgLTExMyw2ICsxMTksNyBAQAogCXJldH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ZGlm
CiAKIAlyZXR1cm4gLTE7CiB9Cg==

--Multipart_Tue_Dec_11_18:06:44_2001-1--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011212010650.A027B548>