aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipv6.c
AgeCommit message (Collapse)AuthorFilesLines
2000-06-05Change dissect_ah() so that dissect_ip() doesn't have to make aGilbert Ramirez1-2/+2
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-05-31Add routines for adding items to a protocol tree that take arguments ofGuy Harris1-7/+7
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-24Display the fragment offset in decimal (as the IPv4 dissector does)Guy Harris1-2/+2
rather than hex. svn path=/trunk/; revision=1997
2000-05-11Add tvbuff class.Gilbert Ramirez1-25/+25
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-04-20Have the IPv6 dissector use the same dissector table as the IPv4Guy Harris1-64/+29
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-16Register an "ip.proto" dissector table for IPv4, and have dissectors forGuy Harris1-1/+2
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-21Jochen Friedrich's fix to IPv6 fragment handling.Guy Harris1-8/+20
svn path=/trunk/; revision=1734
2000-03-14Fix some errors discovered by making GCC do format string/argumentGuy Harris1-3/+3
cross-checking, and by replacing "proto_tree_add_item_format()" by multiple routines to add items of various types. Make the arguments of "proto_tree_add_bytes_format()" and "proto_tree_add_string_format()" that specify the bytes or the string be "const" pointers, so that one can pass a "const" pointer without complaints from the compiler. Squelch a (bogus, but the compiler isn't in a position to know that) complaint about an uninitialized variable. svn path=/trunk/; revision=1716
2000-03-12Break proto_tree_add_item_format() into multiple functions:Gilbert Ramirez1-5/+5
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-10/+10
svn path=/trunk/; revision=1696
2000-02-15Create a header file for every packet-*.c file. Prune the packet.h file.Gilbert Ramirez1-1/+6
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-01-15Fix up a bunch of places where a pointer into the packet buffer was castGuy Harris1-3/+3
to a type requiring 2-byte or better alignment and was then dereferenced; doing that requires that the code generated by your compiler not trap if it makes an unaligned reference, and on most RISC processors the code generated by the compiler *will* trap on an unaligned reference by default. svn path=/trunk/; revision=1480
1999-11-16Replace the ETT_ "enum" members, declared in "packet.h", withGuy Harris1-4/+10
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-10-22Generalize the "ip_src" and "ip_dst" members of the "packet_info"Guy Harris1-9/+6
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-15add missing termination to value_string.Jun-ichiro itojun Hagino1-1/+2
svn path=/trunk/; revision=842
1999-10-15IPComp (RFC2393) decoding.Jun-ichiro itojun Hagino1-1/+4
svn path=/trunk/; revision=838
1999-10-15use proto_tree_add_item() for IPv6 header, to allow filtering like belowJun-ichiro itojun Hagino1-27/+91
possible. ipv6.nxt == 17 ipv6.dst == ff02::9 ipv6.src[0:2] == fe:80 modify dfilter lexical rule to allow standard IPv6 expression to be passed up to parser. XXX backward compat issue in lex rule, maybe XXX IPv6 has chained headers. how will dfilter behave when we have multiple protocol header of the same type? XXX ipv6.nxt is not really useful due to IPv6 chained header. we need a symbol to identify "final" protocol type on the chain (testing ipv6.final but will SEGV). svn path=/trunk/; revision=836
1999-10-14use inet_pton() and inet_ntop(), which are RFC2553 standard functionJun-ichiro itojun Hagino1-165/+1
for converting IPv[46] numeric notation to/from binary form. recent BIND includes those functions so fallback is not necessary on most of the platforms. sorry if it raises any portability problem on other platforms. remove partial inclusion of inet_ntop() in packet-ipv6.c. move ip6_to_str() to packet.c, it fits better there than packet-ipv6.c. svn path=/trunk/; revision=829
1999-10-14implement ipprotostr() in ipproto.c, which basically does ipprotobynumber()Jun-ichiro itojun Hagino1-21/+18
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-3/+6
well. Add some more protocols to the list of value/string pairs for IP protocol types. svn path=/trunk/; revision=822
1999-10-13Some fixes from Jun-ichiro itojun Hagino.Guy Harris1-4/+10
svn path=/trunk/; revision=819
1999-10-12Jun-ichiro itojun Hagino's changes for IPv6 extension header decodingGuy Harris1-31/+147
and RIPng decoding. svn path=/trunk/; revision=818
1999-10-12New proto_tree header_field_info stuff. Header_field_infos now containGilbert Ramirez1-3/+5
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-11- add handling of FT_IPv6 variablesLaurent Deniel1-10/+16
there is still some work to do in resolv.c (get_host_ipaddr6) - add display filters of this kind in packet-ipv6.c just for testing (display filtering is incomplete) svn path=/trunk/; revision=808
1999-08-24Removed unnecessary #include "etypes.h" lines.Gilbert Ramirez1-2/+1
svn path=/trunk/; revision=565
1999-08-03Patch from Bill Fumerola to quiet some EGCS complaints, at least onGuy Harris1-3/+5
FreeBSD. svn path=/trunk/; revision=423
1999-07-29Made the protocol (but not the fields) use the new proto_tree routine,Gilbert Ramirez1-2/+15
allowing users to filter on the existence of these protocols. I also added packet-clip.c to the Nmake makefile. svn path=/trunk/; revision=402
1999-07-13Added support for compiling on win32 with Visual C and 'nmake'. It compiles,Gilbert Ramirez1-1/+4
but does not link. Perhaps someone who understands the MS tools can help out. I made it link a few months ago, but with different version of glib/gtk+. I can't remember how I made it link. Most of the compatibility issues were resolved with adding #ifdef HAVE_UNISTD_H the the source code. Please be sure to add this to all future code. svn path=/trunk/; revision=359
1999-07-07Created a new protocol tree implementation and a new display filterGilbert Ramirez1-16/+14
mechanism that is built into ethereal. Wiretap is now used to read all file formats. Libpcap is used only for capturing. svn path=/trunk/; revision=342
1999-04-09Changed the flowinfo field in the ipv6 header to flow info + traffic class, asGilbert Ramirez1-2/+8
per RFC2460. Thanks to Jun-ichiro for the patch. svn path=/trunk/; revision=245
1999-03-28Jun-ichiro's IPv6 patch is merged in with ethereal and now uses the newGilbert Ramirez1-43/+336
proto*() functions. The configure script tries to use ipv6 name resolution if it knows the type of ipv6 stack the user has (this can be avoided with the --disable-ipv6 switch) Additionally, the configure script now deals with wiretap better. If the user doesn't want to compile wiretap, the wiretap is never visited. A few unnecessary #includes were removed from some wiretap files, and a CPP macro was moved from bpf.c to wtap.h. svn path=/trunk/; revision=229
1999-03-23Removed all references to gtk objects from packet*.[ch] files. They nowGilbert Ramirez1-15/+12
reference the protocol tree with struct proto_tree and struct proto_item objects. That way, the packet decoding source code file can be used with non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged some of the information in packet.h to more appropriate places (like other packet-*.[ch] files). svn path=/trunk/; revision=223
1998-11-17* Added column formatting functionality.Gerald Combs1-16/+17
* Added check_col(), add_col_str() and add_col_fmt() to replace references to ft->win_info. * Added column prefs handling code. svn path=/trunk/; revision=97
1998-11-12A lengthy patch to add the wiretap library. Wiretap is not used by defaultGilbert Ramirez1-2/+1
because it is still in its infancy, but it can be compiled in optionally. The library exists in its own subdirectory ethereal/wiretap. This patch also edits all the packet-*.c files to remove the #include <pcap.h> line which is unnecessary in these files. In the ethereal code, file.c is the most heavily modified with #ifdef WITH_WIRETAP lines for the optional library. svn path=/trunk/; revision=82
1998-09-27Merged in a _huge_ patch from Guy Harris. It adds a time stap column,Gerald Combs1-4/+4
generalizes the column printing code, adds a "frame" tree item to the tree view, and fixes a bunch of miscellaneous coding bugs. svn path=/trunk/; revision=31
1998-09-16Added ID tags to the beginning of each source file.Gerald Combs1-0/+2
svn path=/trunk/; revision=7
1998-09-16Initial revisionGerald Combs1-0/+105
svn path=/trunk/; revision=2