aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ip.c
AgeCommit message (Collapse)AuthorFilesLines
2000-06-05Change dissect_ah() so that dissect_ip() doesn't have to make aGilbert Ramirez1-11/+1
special case for it. dissect_ah() is registered with the "ip.proto" handoff table, and dissect_ah() calls the next dissector using this same "ip.proto" handoff table. The old dissect_ah() is kept as dissect_ah_old() since dissect_ipv6() still uses it. I need to convert some more functions before I can get rid of dissect_ah_old(). svn path=/trunk/; revision=2039
2000-06-02Show ICMP sequence number as two bytes, not as integer.Gilbert Ramirez1-3/+3
svn path=/trunk/; revision=2037
2000-05-31Add routines for adding items to a protocol tree that take arguments ofGuy Harris1-27/+27
a particular type, rather than taking a varargs list, along the lines of the "proto_tree_add_XXX_format()" routines. Replace most calls to "proto_tree_add_item()" and "proto_tree_add_item_hidden()" with calls to those routines. Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to "proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()" routines that don't take the item to be added as an argument - instead, they fetch the argument from the packet whose tvbuff was handed to them, from the offset handed to them. svn path=/trunk/; revision=2031
2000-05-28Give the Appletalk DDP dissector a dissector hash table, and have theGuy Harris1-95/+1
protocols encapsulated inside DDP register themselves with that table. Pull the EIGRP dissector into its own file, as suggested by Paul Ionescu; it's not an IP-specific protocol. svn path=/trunk/; revision=2022
2000-05-26Support for SCTP in the capture dialog, from Michael Tuexen.Guy Harris1-1/+4
svn path=/trunk/; revision=2012
2000-05-24Patch from Scott Howard to show the IP fragment offset as a byte offsetGuy Harris1-3/+3
rather than an 8-byte offset. svn path=/trunk/; revision=1996
2000-05-22EIGRP over Appletalk and EIGRP over IPX support, from Paul Ionescu.Guy Harris1-3/+3
svn path=/trunk/; revision=1994
2000-05-11Add tvbuff class.Gilbert Ramirez1-85/+85
Add exceptions routines. Convert proto_tree_add_*() routines to require tvbuff_t* argument. Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as the tvbuff_t* argument to proto_tree_add_*() routines. dissect_packet() creates a tvbuff_t, wraps the next dissect call in a TRY block, will print "Short Frame" on the proto_tree if a BoundsError exception is caught. The FDDI dissector is converted to use tvbuff's. svn path=/trunk/; revision=1939
2000-05-10Fix a typo in the packet counter.Gerald Combs1-2/+2
svn path=/trunk/; revision=1934
2000-04-20Have the IPv6 dissector use the same dissector table as the IPv4Guy Harris1-33/+15
dissector. Don't dissect the payload of any fragmented IPv6 packet unless it's the initial fragment (that's what we do for IPv4). svn path=/trunk/; revision=1882
2000-04-17Register a "llc.dsap" dissector table for 802.2 LLC, and have dissectorsGuy Harris1-1/+3
for protocols that run inside 802.2 LLC register themselves with it using "dissector_add()". Make various dissectors static if they can be, and remove from header files declarations of those dissectors. svn path=/trunk/; revision=1872
2000-04-16Register an "ip.proto" dissector table for IPv4, and have dissectors forGuy Harris1-55/+30
protocols that run inside IPv4 register themselves with it using "dissector_add()". Make various dissectors static if they can be, and get rid of any header files that no longer contain any information as a result of that change. svn path=/trunk/; revision=1870
2000-04-16Register a "ppp.protocol" dissector table for PPP, and have dissectorsGuy Harris1-1/+3
for protocols that run inside PPP register themselves with it using "dissector_add()". svn path=/trunk/; revision=1869
2000-04-13Change the sub-dissector handoff registration routines so that theGilbert Ramirez1-1/+8
sub-dissector table is not stored in the header_field_info struct, but in a separate namespace. Dissector tables are now registered by name and not by field ID. For example: udp_dissector_table = register_dissector_table("udp.port"); Because of this different namespace, dissector tables can have names that are not field names. This is useful for ethertype, since multiple fields are "ethertypes". packet-ethertype.c replaces ethertype.c (the name was changed so that it would be named in the same fashion as all the filenames passed to make-reg-dotc) Although it registers no protocol or field, it registers one dissector table: ethertype_dissector_table = register_dissector_table("ethertype"); All protocols that can be called because of an ethertype field now register that fact with dissector_add() calls. In this way, one dissector_table services all ethertype fields (hf_eth_type, hf_llc_type, hf_null_etype, hf_vlan_etype) Furthermore, the code allows for names of protocols to exist in the etype_vals, yet a dissector for that protocol doesn't exist. The name of the dissector is printed in COL_INFO. You're welcome, Richard. :-) svn path=/trunk/; revision=1848
2000-03-21Add support for TXT and WKS records to the DNS dissector.Guy Harris1-16/+1
Add EIGRP and VINES to the list of protocols "ipprotostr()" knows about. Get rid of the "proto_vals" table in "packet-ip.c" - it's not used, and the two entries it had that weren't in the table in "ipproto.c" have been moved there. svn path=/trunk/; revision=1735
2000-03-16Put the EIGRP packet type into the INFO column in the packet list entryGuy Harris1-13/+13
for an EIGRP packet. svn path=/trunk/; revision=1726
2000-03-12Break proto_tree_add_item_format() into multiple functions:Gilbert Ramirez1-10/+10
proto_tree_add_protocol_format() proto_tree_add_uint_format() proto_tree_add_ipxnet_format() proto_tree_add_ipv4_format() proto_tree_add_ipv6_format() proto_tree_add_bytes_format() proto_tree_add_string_format() proto_tree_add_ether_format() proto_tree_add_time_format() proto_tree_add_double_format() proto_tree_add_boolean_format() If using GCC 2.x, we can check the print-format against the variable args passed in. Regardless of compiler, we can now check at run-time that the field type passed into the function corresponds to what that function expects (FT_UINT, FT_BOOLEAN, etc.) Note that proto_tree_add_protocol_format() does not require a value field, since the value of a protocol is always NULL. It's more intuitive w/o the vestigial argument. Fixed a proto_tree_add_item_format-related bug in packet-isis-hello.c Fixed a variable usage bug in packet-v120.c. (ett_* was used instead of hf_*) Checked in Guy's fix for the function declearation for proto_tree_add_text() and proto_tree_add_notext(). svn path=/trunk/; revision=1713
2000-03-07Fix some "proto_tree_add_text()" calls.Guy Harris1-14/+14
svn path=/trunk/; revision=1696
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez1-6/+19
This change allows you to add a new packet-*.c file and not cause a recompilation of everything that #include's packet.h Add the plugin_api.[ch] files ot the plugins/Makefile.am packaging list. Add #define YY_NO_UNPUT 1 to the lex source so that the yyunput symbol is not defined, squelching a compiler complaint when compiling the generated C file. svn path=/trunk/; revision=1637
2000-02-09Integrate Ed Meaney's <emeaney@altiga.com> changes for using libpcapGilbert Ramirez1-1/+4
from WinDump with Ethereal. We now have packet capturing on Win32. :) svn path=/trunk/; revision=1612
2000-02-02In dissect_ipopt_timestamp() :Olivier Abad1-13/+6
Correct a bug reported by Paul Ionescu when dissecting a timestamp IP option. The offsets where not correct. svn path=/trunk/; revision=1596
2000-01-24Heikki Vatiainen's patch to add a flag to control whether to interpretGuy Harris1-11/+97
the IPv4 TOS field as a TOS field or as a DiffServ field, and allow that field to be controlled by a command-line option or an option in the "Display:Options" dialog box. svn path=/trunk/; revision=1532
2000-01-23In "dissect_eth()", update "pi.len" and "pi.captured_len" regardless ofGuy Harris1-2/+6
whether we're building a protocol tree or not. Make "dissect_eth()" use "BYTES_ARE_IN_FRAME()" to see if we have a full Ethernet header - it can be called with a non-zero offset, if Ethernet frames are encapsulated inside other frames (e.g., ATM LANE). Make capture routines take an "offset" argument if the corresponding dissect routine takes one (for symmetry, and for Cisco ISL or any other protocol that encapsulates Ethernet or Token-Ring frames inside other frames). Pass the frame lengths to capture routines via the "pi" structure, rather than as an in-line argument, so that they can macros such as "BYTES_ARE_IN_FRAME()" the way the corresponding dissect routines do. Make capture routines update "pi.len" and "pi.captured_len" the same way the corresponding diseect routines do, if the capture routines then call other capture routines. Make "capture_vlan()" count as "other" frames that are too short, the way other capture routines do. svn path=/trunk/; revision=1525
2000-01-20Joerg Mayer's updates to the VINES dissector and to protocol layersGuy Harris1-1/+9
above VINES. svn path=/trunk/; revision=1514
2000-01-16Get rid of the include of "util.h" that some dissectors do - it's notGuy Harris1-2/+1
necessary. svn path=/trunk/; revision=1496
1999-12-13Fix problem with number of format args for "option length too short".Gilbert Ramirez1-2/+2
Problem reported by James Coe <jammer@cin.net> svn path=/trunk/; revision=1309
1999-12-09Thou Shalt Not Cast Pointers Into A Packet To Pointers To AnythingGuy Harris1-5/+7
Bigger Than A Byte, as there's no guarantee that the pointer is aligned the way you'd like (consider, for example, FDDI packets, which may be aligned on an *odd-byte* boundary). svn path=/trunk/; revision=1268
1999-12-08Added Philip Gladstone <philip@raptor.com>'s patch to check IP headerGilbert Ramirez1-2/+23
checksum, and noted the need for user-selectable lines in the GUI tree. svn path=/trunk/; revision=1242
1999-11-21Added Heikki Vatiainen's <hessu@cs.tut.fi> VRRP dissector.Gilbert Ramirez1-1/+4
svn path=/trunk/; revision=1083
1999-11-17Typo fix, from Heikki Vatiainen.Guy Harris1-2/+2
svn path=/trunk/; revision=1045
1999-11-16Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1-19/+55
dynamically-assigned "ett_" integer values, assigned by "proto_register_subtree_array()"; this: obviates the need to update "packet.h" whenever you add a new subtree type - you only have to add a call to "proto_register_subtree_array()" to a "register" routine and an array of pointers to "ett_", if they're not already there, and add a pointer to the new "ett_" variable to the array, if they are there; would allow run-time-loaded dissectors to allocate subtree types when they're loaded. svn path=/trunk/; revision=1043
1999-11-02Format the IP header length as an unsigned quantity.Guy Harris1-2/+2
svn path=/trunk/; revision=965
1999-11-02Make a bunch of the bitfields in the IP header filterable items.Guy Harris1-33/+68
svn path=/trunk/; revision=963
1999-10-30Don Lafontaine's IGRP/EIGRP dissector.Guy Harris1-16/+102
svn path=/trunk/; revision=949
1999-10-22Generalize the "ip_src" and "ip_dst" members of the "packet_info"Guy Harris1-12/+17
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst" addresses, where an address is an address type, an address length in bytes, and a pointer to that many bytes. "dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}" are the network-layer source/destination; "{src,dst}" are the source/destination from the highest of those two layers that we have in the packet. Add a port type to "packet_info" as well, specifying whether it's a TCP or UDP port. Don't set the address and port columns in the dissector functions; just set the address and port members of the "packet_info" structure. Set the columns in "fill_in_columns()"; this means that if we're showing COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate the string from "src" or "dst", we don't generate a string for the link-layer address and then overwrite it with a string for the network-layer address (generating those strings costs CPU). Add support for "conversations", where a "conversation" is (at present) a source and destination address and a source and destination port. (In the future, we may support "conversations" above the transport layer, e.g. a TFTP conversation, where the first packet goes from the client to the TFTP server port, but the reply comes back from a different port, and all subsequent packets go between the client address/port and the server address/new port, or an NFS conversation, which might include lock manager, status monitor, and mount packets, as well as NFS packets.) Currently, all we support is a call that takes the source and destination address/port pairs, looks them up in a hash table, and: if nothing is found, creates a new entry in the hash table, and assigns it a unique 32-bit conversation ID, and returns that conversation ID; if an entry is found, returns its conversation ID. Use that in the SMB and AFS code to keep track of individual SMB or AFS conversations. We need to match up requests and replies, as, for certain replies, the operation code for the request to which it's a reply doesn't show up in the reply - you have to find the request with a matching transaction ID. Transaction IDs are per-conversation, so the hash table for requests should include a conversation ID and transaction ID as the key. This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses transparently (and should allow the SMB decoder to handle NetBIOS atop other protocols as well, if the source and destination address and port values in the "packet_info" structure are set appropriately). In the "Follow TCP Connection" code, check to make sure that the addresses are IPv4 addressses; ultimately, that code should be changed to use the conversation code instead, which will let it handle IPv6 transparently. svn path=/trunk/; revision=909
1999-10-22Check to make sure the header length is at least the minimum length forGuy Harris1-2/+11
an IP header. svn path=/trunk/; revision=906
1999-10-16- replace proto_tree_add_item_format by proto_tree_add_item.Laurent Deniel1-17/+9
- fix hf_ip_len type field (FT_UINT16). svn path=/trunk/; revision=866
1999-10-15IPComp (RFC2393) decoding.Jun-ichiro itojun Hagino1-2/+5
svn path=/trunk/; revision=838
1999-10-14add string IP protocol name into info field of fragmented packet.Jun-ichiro itojun Hagino1-3/+3
svn path=/trunk/; revision=833
1999-10-14implement ipprotostr() in ipproto.c, which basically does ipprotobynumber()Jun-ichiro itojun Hagino1-3/+5
for ip.ip_p and ip6.ip6_nxt (and other IPv6 header chain). use val_to_str() as much as possible in dissect_{ipv6,pim,ripng}(). make --disable-zlib a default for netbsd (temporary workaround). svn path=/trunk/; revision=827
1999-10-13Jun-ichiro itojun Hagino's code for PIM, and some fixes from him asGuy Harris1-2/+12
well. Add some more protocols to the list of value/string pairs for IP protocol types. svn path=/trunk/; revision=822
1999-10-12New proto_tree header_field_info stuff. Header_field_infos now containGilbert Ramirez1-23/+48
the base for numbers to be displayed in, bitmasks for bitfields, and blurbs (which are one or two sentences describing the field). proto_tree_add*() routines now automatically handle bitfields. You tell it which header field you are adding, and just pass it the value of the entire field, and the proto_tree routines will do the masking and shifting for you. This means that bitfields are more naturally filtered via dfilter now. Added Phil Techau's support for signed integers in dfilters/proto_tree. Added the beginning of the SNA dissector. It's not complete, but I'm committing it now because it has example after example of how to use bitfields with the new header_field_info struct and proto_tree routines. It was the impetus to change how header_field_info works. svn path=/trunk/; revision=815
1999-10-02Add ICMP display filters.Laurent Deniel1-9/+29
svn path=/trunk/; revision=751
1999-10-02Fix IGMP dfilter (some fields were registered and soLaurent Deniel1-11/+17
documented in man but the new dfilter functions were not used). svn path=/trunk/; revision=750
1999-09-23Dirk Bonne's fix to ICMP timestamp dissection.Guy Harris1-5/+3
svn path=/trunk/; revision=713
1999-09-14Daniel Ryde's patch to show the IP flags as 4 bits, rather than showingGuy Harris1-5/+5
the full octet containing the flags and the upper 4 bits of the fragment offset. svn path=/trunk/; revision=678
1999-08-31We now use "snprintf()" in "dissect_ip_tcp_options()", so we may need toGuy Harris1-1/+10
include "snprintf.h" to declare it. svn path=/trunk/; revision=621
1999-08-28For unknown options without "syntax" errors, show the length in bytes.Guy Harris1-8/+13
svn path=/trunk/; revision=605
1999-08-28Handle unknown options in "dissect_ip_tcp_options()" better; we assumeGuy Harris1-19/+35
that the only options that contain *no* length byte are the IP and TCP EOL and NOP options so that we can treat unknown options as VARIABLE_LENGTH with a minimum of 2, and at least be able to move on to the next option by using the length in the option, rather than just reporting the unknown option and processing no options after it. svn path=/trunk/; revision=604
1999-08-28PPP options in LCP, IPCP, etc. are like IP and TCP options - one octetGuy Harris1-35/+46
of option code, one octet of length (which includes the two option code and length bytes), followed by 0 or more octets of option data, with some options being fixed-length and some being variable-length. Put some stuff from the PPP control protocol option parsing code into the IP-and-TCP option parsing code, and use the latter instead of the former. (That code might also be usable for CDP as well, with some stuff added to it.) Shuffle the arguments to "dissect_ip_tcp_options()" to resemble those of various other dissectors (i.e., with the "proto_tree *" at the end). Add in code to dissect a pile of PPP options documented in various RFCs. svn path=/trunk/; revision=601