Commit graph

4743 commits

Author SHA1 Message Date
Guy Harris
541c654ff0 Put all the capture options into a structure.
Move the ringbuffer capture options from the "capture_file" structure to
the structure for capture options, as they're a property of an
in-progress capture, not a property of a particular capture file.

svn path=/trunk/; revision=4799
2002-02-24 09:25:36 +00:00
Guy Harris
1be3629f30 Don't copy the entire EAP header, just extract stuff from it a field at
a time, so we dissect as far as we can.

Set the length of the EAP protocol item to the length of an EAP header.

Put information into the Info column about the EAP code and, for a
request or response, the EAP type.

svn path=/trunk/; revision=4798
2002-02-24 08:10:07 +00:00
Guy Harris
ca8f79df3d Get rid of "init_all_protocols()"; instead, have a routine
"init_dissection()" which calls "epan_conversation_init()", does the
work that "init_all_protocols()" did, and then calls
"reassemble_init()", so that the standard sequence of dissection
initialization is done in one place, rather than having multiple places
call the same sequence of routines.

svn path=/trunk/; revision=4797
2002-02-24 06:45:14 +00:00
Guy Harris
b767826991 Have "get_positive_int()" really check for positive integers, not just
non-negative integers.

Get rid of unused "get_positive_int()" routine in "gtk/capture_dlg.c".

svn path=/trunk/; revision=4796
2002-02-24 06:01:03 +00:00
Guy Harris
8bd63530ed "autostop_filesize" and "autostop_duration" don't need to be in the
"capture_file" structure - they're a property of an in-progress capture,
not a property of an open capture file.  Make them just variables.

The maximum number of packets to be captured should be a variable
separate from the "count" field in the "capture_file" structure - the
latter is a count of the packets in the capture file in question.

Have Boolean variables indicating whether a maximum packet count,
maximum capture file size, and maximum capture duration were specified.
If an option isn't set, and we're doing an "update list of packets in
real time" capture, don't pass the option to the child process with a
command-line argument.

Don't create "stop when the capture file reaches this size" or "stop
when the capture's run for this long" conditions if a maximum capture
file size or a maximum capture duration, respectively, haven't been
specified.  Don't test or free a condition if it wasn't created.

Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag
is the way you specify "no limit on the number of packets".

Initialize the check boxes and spin buttons for the "maximum packets to
capture", "maximum capture size", and "maximum capture duration" options
to the values they had in the last capture.  If an option wasn't
specified, don't read its value from the dialog box and set the
variable.

svn path=/trunk/; revision=4795
2002-02-24 03:33:05 +00:00
Guy Harris
f12ef91219 Free all the stuff pointed to by elements in the "tcp_segment_table"
hash table before freeing the memory chunks for those elements.

Destroy that hash table when we're done, and set the pointer to it to
null so that we'll reallocate it.

svn path=/trunk/; revision=4794
2002-02-24 02:59:30 +00:00
Guy Harris
309e86246e From Peter Valchev: fix editcap to assign the result of "getopt()" to an
"int" and to check "getopt()"s return value with -1 rather than EOF.

Fix other "getopt()" loops to check against -1 as well (EOF is -1 on
most if not all platforms, but the Single UNIX Specification says
"getopt()" returns -1, so we should check against -1, not EOF).

svn path=/trunk/; revision=4793
2002-02-24 01:26:45 +00:00
Guy Harris
f4f3208a00 In the Q.931-over-TPKT-over-TCP dissector, if the TCP segment we're
handed looks as if it contains only a TPKT header (4 bytes long, and
those 4 bytes look like a TPKT header according to "is_tpkt()"), call
the "dissect TPKT over a TCP stream" routine.  If we're doing
reassembly, that routine will force a reassembly because the TPKT
payload isn't in that segment, and the various heuristic XXX-over-TPKT
dissectors will be called again, this time with enough data for them to
say whether the TPKT payload is for them or not; if we're not doing
reassembly, we'll dissect the TPKT header and then call the "dissect a
Q.931 PDU" routine, which will throw an exception because there isn't
any payload from which to fetch data (and that's what we want to
happen).

In the "dissect TPKT over a TCP stream" routine, if reassembly is
enabled, do the check to see if we need to do reassembly to get the
payload before dissecting the TPKT header, so that we don't dissect the
TPKT header and then decide "oops, we need some more data to get the
TPKT payload".

svn path=/trunk/; revision=4792
2002-02-23 21:07:48 +00:00
Guy Harris
7027650b5c "is_tpkt()" is always used to check a TCP segment to see if it might
have a TPKT header at the beginning, so there's not need for it to have
an offset as an argument; its callers don't have to know how big the
TPKT header is (or we can put a #define in "packet-tpkt.h" for it).  Get
rid of the second argument.

svn path=/trunk/; revision=4791
2002-02-23 02:30:16 +00:00
Guy Harris
5d5d507a29 From John Mackenzie: put missing initializations of table entries in
"plugins.c".

svn path=/trunk/; revision=4790
2002-02-23 02:16:12 +00:00
Guy Harris
83b201486f Dissect the payload of EAPOL Key messages.
Put in a comment noting that the payload of EAPOL Encapsulated ASF Alert
messages should perhaps be dissected as SNMP Trap messages.

Put the type of the message into the Info column.

svn path=/trunk/; revision=4789
2002-02-22 23:05:16 +00:00
Guy Harris
3eb8f4ecdd Add some necessary "volatile" declarations.
svn path=/trunk/; revision=4788
2002-02-22 21:52:09 +00:00
Guy Harris
1157a3998b Get rid of an unnecessary "volatile".
Give the type field a value_string array, and use that field when
putting the type into the protocol tree.

Display the data under the EAPOL tree, as it's part of the EAPOL PDU.

Just use "next_tvb" as the tvbuff for the data; don't create a new one
that, the different fourth argument to "tvb_new_subset()"
nonwithstanding, refers to the same data as "next_tvb".

Call the EAP dissector through a handle.

Nobody directly calls the EAP dissector any more, they all call it
through handles; make it static.

svn path=/trunk/; revision=4787
2002-02-22 21:51:18 +00:00
Guy Harris
c786f129c0 From Adam Sulmicki: dissect EAP messages inside RADIUS.
svn path=/trunk/; revision=4786
2002-02-22 21:31:49 +00:00
Tim Potter
c2e21d860b Fixed up value_string for SMBE_unknownlevel error.
svn path=/trunk/; revision=4785
2002-02-22 21:29:02 +00:00
Guy Harris
fb5688bb93 Set "snaplen", not "has_snaplen", to the snapshot length specified in
the capture preferences dialog box.

svn path=/trunk/; revision=4783
2002-02-22 11:41:22 +00:00
Guy Harris
06977d189c Catch the ReportedBoundsError exception in the DNS and TPKT dissectors
when dissecting messages over TCP, so that an error in one message
doesn't stop us from dissecting the next message in the segment, if any.

Put an XXX comment before the code that constructs the tvbuff for each
message inside a TCP segment, noting that we really want tvbuffs to have
three lengths and to have a new type of exception thrown if you go past
the second length but not past the reported length.

svn path=/trunk/; revision=4782
2002-02-22 11:28:03 +00:00
Guy Harris
cb5745cc1e COPS-PR extension support, from Kari Tiirikainen.
Add support for desegmentation of COPS messages and for multiple COPS
messages per TCP segment.

svn path=/trunk/; revision=4781
2002-02-22 11:16:13 +00:00
Guy Harris
d301d2cef4 From Adam Sulmicki: additional AVPs for RADIUS. and making
RD_TP_CONNECT_INFO a RADIUS_STRING rather than a RADIUS_STRING_TAGGED.

svn path=/trunk/; revision=4780
2002-02-22 09:57:04 +00:00
Guy Harris
33620ec7f8 From Adam Sulmicki <adam[AT]cfar.umd.edu>:
Add more type values for EAP.
	Fix off-by-one bug when displaying Code of EAP message.

Get rid of an unnecessary "volatile".

Give the code and type fields value_string arrays, and use them when
putting the code and type into the protocol tree.

Base the decision of whether to put the type field into the tree on the
request code, not on the length of the packet.

Display the Type-Data field, under that name, under the EAP tree, as
it's part of the EAP PDU.

svn path=/trunk/; revision=4779
2002-02-22 09:52:01 +00:00
Guy Harris
e9bc3da370 Handle TPKT packets split across segment boundaries, and multiple TPKT
packets per segment.

Instead of having a routine for dissectors such as the Q.931 dissector
to call to dissect the TPKT header, have a routine that does all the
reassembly and multiple-packets-per-segment work, and have the Q.931
dissector call it.  Export "is_tpkt()", and the new routine, to plugins.

Add preferences for TPKT and Q.931 reassembly.

svn path=/trunk/; revision=4778
2002-02-22 08:56:48 +00:00
Guy Harris
df151b784a Properly set the length of the top-level item.
svn path=/trunk/; revision=4777
2002-02-22 08:54:54 +00:00
Guy Harris
7b176b7096 Redo the DNS-over-TCP code to handle the DNS-over-TCP header being split
across segment boundaries and to, for each DNS-over-TCP PDU, create a
tvbuff containing the header and the body of the PDU, handing that to
the DNS PDU dissector.

svn path=/trunk/; revision=4776
2002-02-22 08:45:02 +00:00
Guy Harris
cbda24e612 From Dermot Bradley:
support for Openwave-specific WSP headers;

	support for Openwave-specific field names;

	support for additional content types from Openwave;

	support for additional language values.

svn path=/trunk/; revision=4775
2002-02-22 07:23:25 +00:00
Guy Harris
27e5901646 Properly handle the "no data" data frames.
svn path=/trunk/; revision=4774
2002-02-22 07:16:35 +00:00
Guy Harris
748d012012 AiroPeek captures have an extra 4 bytes of gunk at the end of every
packet; don't hand that gunk to the 802.11 dissector.

svn path=/trunk/; revision=4773
2002-02-22 07:15:28 +00:00
Ed Warnicke
3560ff5eea Added a preference to allow for setting the COPS tcp port.
svn path=/trunk/; revision=4772
2002-02-22 02:56:58 +00:00
Guy Harris
2f70b4df02 Initial quota support, from Ronnie Sahlberg.
svn path=/trunk/; revision=4771
2002-02-22 00:05:02 +00:00
Guy Harris
e80b68372c Use the right format (one with a numerical format item rather than a
string format item) as the third argument to "val_to_str()".

svn path=/trunk/; revision=4770
2002-02-21 23:54:03 +00:00
Guy Harris
96bfaddff2 The number of bytes of tagged parameters should be computed by seeing
how many bytes remain in the packet starting at the initial offset of
the tagged parameters, not by seeing how many bytes remain in the packet
starting 4 bytes later.  (If you're trying to avoid counting a CRC that
appears at the end of the packet data, then you need to be sure there
*is* a CRC first; this may require using a different DLT_ type, in
libpcap, for those captures.)

svn path=/trunk/; revision=4769
2002-02-21 23:34:33 +00:00
Tim Potter
15c2a5a651 Export dissect_nt_sec_desc() so it can be used by other dissectors.
A NT security descriptor can be either revision 1 or 2 and seem to be the
same format on the wire.

svn path=/trunk/; revision=4768
2002-02-21 18:39:49 +00:00
Gilbert Ramirez
d3b5ddbef1 Add first attempt at creating a tool to take a [t]ethereal core file
and using gdb, extract the packet that was being dissected when the
core file was created. It works in simple cases; it will probably
fail in many other cases. Right now it only creates libpcap files, and uses
text2pcap to do so.

svn path=/trunk/; revision=4767
2002-02-21 16:15:56 +00:00
Guy Harris
20c4601ef8 Be more paranoid, and check to make sure the length of the string or OID
isn't so large as to cause the end offset to wrap around.

svn path=/trunk/; revision=4766
2002-02-21 02:05:53 +00:00
Guy Harris
5f04fd0379 Throw in some sanity checking to make sure a bogus length in an ASN.1
string or OID data type doesn't cause us to hand a bogus length to a
memory allocator.

svn path=/trunk/; revision=4765
2002-02-20 22:46:21 +00:00
Guy Harris
ac4cd62ed8 From Ronnie Sahlberg: add the actual SMB command to the structure that
remembers SMBs for request/response matching, and make sure the request
and the response have the same type (or that the response has a
different type but is a valid response to the request).

svn path=/trunk/; revision=4763
2002-02-20 21:46:42 +00:00
Guy Harris
4002814932 Sun's "yp.x" appears to lie when it claims that the argument to a FIRST
call is a "ypreq_key"; the argument appears to be a "ypreq_nokey"
instead.

The response to an ALL call isn't a single item, it's a sequence of
items - all but the last item has the "more" field true, the last has it
false.  Show all the items.

svn path=/trunk/; revision=4762
2002-02-20 21:02:46 +00:00
Guy Harris
2c0ceea42f Export "conversation_set_dissector()" in the plugin API table.
svn path=/trunk/; revision=4760
2002-02-20 08:24:52 +00:00
Ashok Narayanan
cd44c487d4 Fixed small bug in translation of IXCD in OSPF GMPLS LSA.
svn path=/trunk/; revision=4759
2002-02-19 21:56:56 +00:00
Guy Harris
ddf6a753f0 From Andrew Hood: translate enterprise OIDs in SNMP traps to strings if
possible.

svn path=/trunk/; revision=4758
2002-02-19 09:35:45 +00:00
Guy Harris
642d7239dc Update a comment.
svn path=/trunk/; revision=4757
2002-02-19 03:43:43 +00:00
Guy Harris
51f8197b51 Fix the declaration of "rec_dissector_t" to include a return value type.
svn path=/trunk/; revision=4756
2002-02-19 03:43:08 +00:00
Guy Harris
bcaa0c5c58 Fix up the declaration of "addr_tvb_new_real_data" to match
"tvb_new_real_data()".

svn path=/trunk/; revision=4755
2002-02-19 01:28:43 +00:00
Guy Harris
d1afae8393 For TCP segments that are reassembled into larger packets, show the data
as raw TCP segment data under the TCP protocol tree item, rather than as
a top-level data item - and do so even for the last of the segments
reassembled into that packet.

svn path=/trunk/; revision=4754
2002-02-19 00:14:21 +00:00
Guy Harris
b505843920 Add support for reassembling RPC-over-TCP fragments, and do that in both
RPC and NDMP.

Show the RPC-over-TCP fragment header as a tree with bitfields below it.

Add a routine to show a reported bounds error as an "Unreassembled
Packet" or a "Malformed Packet" depending on whether "pinfo->fragmented"
is set, and have NBNS and RPC use that.

Add "ett_ndmp_file_stats" to the list of ett_ values to be initialized
(it wasn't in that list, and wasn't getting initialized).

When freeing up various hash tables and memory chunks in the RPC
dissector, zero out the pointers to them, just to make sure we don't try
to free them again.

Always destroy the TCP segment key and address memory chunks in
"tcp_desegment_init()", regardless of whether TCP desegmentation is
enabled - we don't *allocate* them if TCP desegmentation isn't enabled,
but we should free them even if it's not enabled.  Also, when we free
them, set the pointers to them to null, so we don't double-free them.

Supply to subdissectors called from the TCP dissector the sequence
number of the first byte handed to the sub dissector.

svn path=/trunk/; revision=4753
2002-02-18 23:51:55 +00:00
Guy Harris
8166da40d5 Have "alloc_field_info()" take a pointer to the field length as an
argument, so if the length was supplied as -1, it can set it to the
length of data remaining in the tvbuff, so that its callers can use that
length when getting the value for the field, rather than leaving the
length in the "field_info" structure as -1.

svn path=/trunk/; revision=4752
2002-02-18 22:26:29 +00:00
Guy Harris
6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris
d92a1cd8e1 With the tvbuffication of all dissectors, the "packet_info" structure no
longer contains length fields, so there's no need to pass a "packet_info
*" argument to "set_actual_length()".

svn path=/trunk/; revision=4748
2002-02-17 00:51:21 +00:00
Guy Harris
ac5a603cb7 Add support for SNA-over-Ethernet (Ethernet type 80d5).
svn path=/trunk/; revision=4747
2002-02-17 00:16:19 +00:00
Guy Harris
31fc804847 From Joerg Mayer: remove trailing blanks from hex dump in
print/Tethereal.

svn path=/trunk/; revision=4742
2002-02-15 11:56:10 +00:00
Guy Harris
d49247e450 AiroPeek puts variable-length, not padded fixed-length, 802.11 headers
into captures.

The data rate header is in .5 megabyte/second units, not .5
kilobyte/second units.

svn path=/trunk/; revision=4741
2002-02-15 11:37:56 +00:00