aboutsummaryrefslogtreecommitdiffstats
path: root/packet-icmpv6.c
AgeCommit message (Collapse)AuthorFilesLines
2004-04-22From Shinsuke Suzuki:Guy Harris1-2/+63
- sync ICMPv6 Type number with the official assignment (as of Apr 14 2004) - decode MLDv2 query packet svn path=/trunk/; revision=10659
2004-02-25Use "tvb_get_string()" instead of allocating a (len+1)-sized buffer,Guy Harris1-4/+7
"tvb_memcpy()"ing to it, and putting in a null terminator; "tvb_get_string()" will check whether all bytes of the string are present before allocating the buffer, so that you don't leak memory if the copy throws an exception, and don't crash if the length is absurdly large. Use "tvb_memdup()" instead of allocating a buffer and "tvb_memcpy()"ing to it, so that an exception is thrown before you try to allocate the buffer (for the same reasons as listed above). Before allocating a buffer used when processing a chunk of data from a packet, get a pointer to the chunk with "tvb_get_ptr()", or check that the data is all there with "tvb_ensure_bytes_exist()", so that an exception is thrown before you try to allocate the buffer (for the same reasons as listed above). Fix up the lengths of the tvbuff used when dissecting ONC RPC opaque data with a particular dissector. svn path=/trunk/; revision=10236
2004-01-29From Shusaku Ueda:Guy Harris1-7/+27
- show all Home Agent Addresses of DHAAD Reply - show ICMP options of Mobile Prefix Advertisement svn path=/trunk/; revision=9903
2004-01-18Fix warnings found by -Wstrict-prototypesJörg Mayer1-6/+2
svn path=/trunk/; revision=9722
2003-12-19From David Fort: support for decoding MLD v2 report messages.Guy Harris1-1/+78
svn path=/trunk/; revision=9364
2003-05-28From Laurent Rabret: use "g_free()", not "free()", to free stuffGuy Harris1-2/+2
allocated with "g_malloc()" and related GLib routines. svn path=/trunk/; revision=7758
2003-04-28From Yaniv Kaul: check a reserved field against 0 (the RFC specifies itGuy Harris1-1/+10
must be zero), and displays an indication of whether it's zero or not. svn path=/trunk/; revision=7593
2003-04-27Replace some unchecked malloc calls by g_malloc.Laurent Deniel1-2/+2
svn path=/trunk/; revision=7584
2003-02-04From Teemu Rinta-aho: draft 20 MIPv6 support (now in a file of its own).Guy Harris1-1/+68
svn path=/trunk/; revision=7071
2003-01-20Move into "call_dissector_work()" the stuff to handle dissecting, inGuy Harris1-58/+14
error packets, the copy of the packet that got the error, rather than doing it in the CLNP dissector and the ICMP dissector and the ICMPv6 dissector and the PPP dissector for various control protocols; have it do that work iff "pinfo->in_error_pkt" is set. svn path=/trunk/; revision=6942
2002-12-02Don't cast away constness, and fix variable and structure memberGuy Harris1-2/+2
qualifiers as necessary to ensure that we don't have to. "strcmp()", "strcasecmp()", and "memcmp()" don't return booleans; don't test their results as if they did. Use "guint8", not "guchar", for a pointer to (one or more) 8-bit bytes. Update Michael Tuexen's e-mail address. svn path=/trunk/; revision=6726
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-8/+8
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-16/+8
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. svn path=/trunk/; revision=5932
2002-01-30Make some variables volatile because GCC on Digital UNIX complainedGuy Harris1-7/+7
about them being trashed by setjmp/longjmp (does GCC there stuff them into registers? They're bigger than 64 bits, so they don't even fit into a single register on Alpha). svn path=/trunk/; revision=4636
2002-01-24Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls inGuy Harris1-14/+13
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls that add FT_NONE or FT_PROTO items to the protocol tree, with -1. Replace some calls to "tvb_length()" or "tvb_length_remaining()" with calls to "tvb_reported_length()" and "tvb_reported_length_remaining()", as those give the actual length of the data in the packet, not just the data that happened to be captured. svn path=/trunk/; revision=4605
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-3/+3
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). svn path=/trunk/; revision=4586
2002-01-15From Martti Kuparinen: update the HMIPv6 support to match the latestGuy Harris1-8/+8
draft (draft-ietf-mobileip-hmipv6-05.txt). svn path=/trunk/; revision=4546
2002-01-11Put in a comment giving various Internet Draft names for ICMPv6 stuff weGuy Harris1-1/+15
handle. svn path=/trunk/; revision=4526
2002-01-11Fix some more signed vs. unsigned issues.Guy Harris1-4/+4
svn path=/trunk/; revision=4525
2002-01-10Fix more unsigned items to be displayed with "%u" rather than "%d", asGuy Harris1-4/+4
per Martti Kuparinen's comments. svn path=/trunk/; revision=4515
2002-01-10The filetime is an unsigned quantity, so display it with %u, as perGuy Harris1-2/+2
Martti Kuparinen's comment. svn path=/trunk/; revision=4512
2002-01-09HMIPv6 fix, from Martti Kuparinen.Guy Harris1-7/+7
svn path=/trunk/; revision=4506
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-9/+9
structure to the "packet_info" structure; only stuff that's permanently stored with each frame should be in the "frame_data" structure, and the "column_info" structure is not guaranteed to hold the column values for that frame at all times - it was only in the "frame_data" structure so that it could be passed to dissectors, and, as all dissectors are now passed a pointer to a "packet_info" structure, it could just as well be put in the "packet_info" structure. That saves memory, by shrinking the "frame_data" structure (there's one of those per frame), and also lets us clean up the code a bit. svn path=/trunk/; revision=4370
2001-12-03Make "dissector_add()", "dissector_delete()", and "dissector_change()"Guy Harris1-2/+5
take a dissector handle as an argument, rather than a pointer to a dissector function and a protocol ID. Associate dissector handles with dissector table entries. svn path=/trunk/; revision=4308
2001-11-25Moved from using dissect_data to using call_dissector()Ed Warnicke1-6/+8
svn path=/trunk/; revision=4264
2001-10-01Have a flag in the "packet_info" structure, which indicates whether theGuy Harris1-2/+16
stuff currently being dissected is part of a packet included in an error packet (e.g., an ICMP Unreachable packet). Have the TCP dissector not bother doing reassembly if the TCP segment is part of an error packet, rather than an actual TCP transmission; other dissectors might want to treat those packets specially as well. Add to the "tcpinfo" structure a flag indicating whether the URG flag was set, rather than having the zero or non-zero value of the urgent pointer indicate that. (Yes, at least as I read RFC 793, a zero urgent pointer value isn't useful, as it means "the stuff before this segment is urgent", but it's certainly possible to put onto the wire a TCP segment with URG set and a zero urgent pointer.) Don't dissect the TCP header by grabbing the entire header with "tvb_memcpy()" and then pulling stuff out of it - extract stuff with individual tvbuff calls, and put stuff into the protocol tree and the Info column as we extract it, so that we can dissect a partial header. This lets us, for example, get the source and destination ports from the TCP header of the part of a TCP segment included in a minimum-length ICMPv4 error packet. svn path=/trunk/; revision=3986
2001-09-27When dissecting an ICMP datagram that contains part of an IP datagram,Guy Harris1-3/+12
hand the (possibly-partial) IP datagram to the IP dissector, as we do for IPv6 datagrams inside ICMPv6 and CLNP datagrams inside CLNP ER PDUs. When dissecting IPv6 datagrams inside ICMPv6 and CLNP datagrams inside CLNP ER PDUs, catch the ReportedLengthError exception and ignore it, as they don't guarantee that all of the original PDU is present. svn path=/trunk/; revision=3960
2001-09-25If "snprintf()" can't print all the data because there's not enoughGuy Harris1-2/+2
room, it might return -1 in some versions of glibc; check for that, and quit if that happens. It might also return the number of characters that would've been printed had there been enough room; this means that a loop that does n += snprintf (buf + n, BUF_LENGTH - n, ...); may end up making "n" bigger than BUF_LENGTH, and "snprintf()" might not sanely handle being passed a negative length, so if "n" isn't less than the total length of the string buffer, don't add stuff to it. The "capabilitiesStart" variable in "add_capabilities()" in the WSP dissector is an offset into the PDU data; there's no guarantee that said offet is < 256, and, even if there were, there's no point in making it an 8-bit variable. Add some additional buffer overflow checks to the WSP dissector. svn path=/trunk/; revision=3953
2001-09-05Typo fix, from Martti Kuparinen.Guy Harris1-2/+2
svn path=/trunk/; revision=3910
2001-09-04HMIPv6 support, from Martti Kuparinen.Guy Harris1-2/+60
svn path=/trunk/; revision=3907
2001-07-02Tvbuffify the DNS, NBNS, NBDS, and NBSS dissectors.Guy Harris1-14/+7
Add a "tvb_memeql()" routine, for doing "memcmp()"-style equality comparisons. svn path=/trunk/; revision=3631
2001-06-18From Joerg Mayer: explicitly fill in all members of aGuy Harris1-5/+5
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-06-02Not all platforms have u_int32_t (for example, Windows+MSVC doesn't), soGuy Harris1-2/+2
use "guint32" instead. svn path=/trunk/; revision=3503
2001-06-02Create the tree for an ICMPv6 optionn before putting something in it.Guy Harris1-5/+5
svn path=/trunk/; revision=3499
2001-06-01draft-draves-ipngwg-router-selection-01 support.Jun-ichiro itojun Hagino1-28/+97
fix icmp6 homeagent info option decoding (convert to tvb framework). plug a memory leak. sync some of mobile-ip6 #define symbol names with draft-ietf-ipngwg-2292bis-02. svn path=/trunk/; revision=3497
2001-05-27In the ICMPv6 and OSI CLNP dissectors, when calling the IPv6 or CLNPGuy Harris1-56/+62
dissector to dissect the datagram inside an error report datagram, save the current values of the source and destination addresses, and restore them after the subdissector returns, so that all address columns in the summary pane will reflect the error datagram, not the datagram that provoked the error. Set the Protocol and Info columns upon entry to the ICMPv6 dissector, so that if we throw an exception they don't reflect the protocol above ICMPv6. svn path=/trunk/; revision=3456
2001-04-27More signed-vs-unsigned changes from Joerg Mayer.Guy Harris1-10/+12
svn path=/trunk/; revision=3386
2001-04-23Move the declarations of IP protocol numbers to "ipproto.h" fromGuy Harris1-2/+2
"packet-ip.h". Fix Gerald's address in some files while we're at it. svn path=/trunk/; revision=3366
2001-04-23Now that the IPv6 dissector has been tvbuffified, we can register it; doGuy Harris1-7/+43
so, make it static, and call it only through a handle. In the ICMPv6 dissector, when we dissect the invoking packet in an ICMPv6 error or in a redirected header option, make the columns non-writable, so the summary line for the packet shows it as an ICMPv6 packet, not as the packet included in the ICMPv6 packet. svn path=/trunk/; revision=3361
2001-04-23Tvbuffification of the IPv6 and ICMPv6 dissectors, and some bug fixesGuy Harris1-282/+314
and an update to draft 7 of ICMPv6 name lookups, from Heikki Vatiainen. Fix some formats in the ICMPv6 dissector to use %u, rather than %d, for unsigned quantities. Show various type and code values in ICMPv6 as decimal, not hexadecimal (they're decimal in the RFCs). svn path=/trunk/; revision=3360
2001-03-28Replace proto_tree_add_item_hidden with proto_tree_add_boolean_hidden toOlivier Abad1-2/+2
fix a crash found by Heikki Vatiainen when adding the hf_icmpv6_checksum_bad field. svn path=/trunk/; revision=3201
2001-02-28Add hidden fields for bad checksums to various IP-family protocols.Guy Harris1-2/+10
Initialize the "hf_" value for "icmp.checksum_bad" to -1, the way all other "hf_" values are initialized, and declare it and "ip.checksum_bad" to have base BASE_NONE, not 4. svn path=/trunk/; revision=3087
2001-01-23Mobile IPv6 updates from Borosa Tomislav <tomislav.borosa@SIEMENS.HR>.Gerald Combs1-4/+43
svn path=/trunk/; revision=2935
2001-01-22Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="Guy Harris1-3/+1
statements. Move the setting of the Protocol column in various dissectors before anything is fetched from the packet, and also clear the Info column at that point in those and some other dissectors, so that if an exception is thrown, the columns don't reflect the previous protocol. svn path=/trunk/; revision=2932
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-2/+2
"{old_}heur_dissector_add()", "{old_}conv_dissector_add()", and "register_dissector()", so that an entry in those tables has associated with it the protocol index of the protocol the dissector handles (or -1, if there is no protocol index for it). This is for future use in a number of places. (Arguably, "proto_register_protocol()" should take a dissector pointer as an argument, but 1) it'd have to handle both regular and heuristic dissectors; 2) making it take either a "dissector_t" or a union of that and a "heur_dissector_t" introduces some painful header-file interdependencies so I'm punting on that for now. As with other Ethereal internal APIs, these APIs are subject to change in the future, at least until Ethereal 1.0 comes out....) svn path=/trunk/; revision=2849
2001-01-03Have "proto_register_protocol()" build a list of data structures forGuy Harris1-2/+2
protocols, in addition to adding structures to the list of filterable fields. Give it an extra argument that specifies a "short name" for the protocol, for use in such places as pinfo->current_proto; the dialog box for constructing filters; the preferences tab for the protocol; and so on (although we're not yet using it in all those places). Make the preference name that appears in the preferences file and the command line for the DIAMETER protocol "diameter", not "Diameter"; the convention is that the name in question be all-lower-case. Make some routines and variables that aren't exported static. Update a comment in the ICP dissector to make it clear that the dissector won't see fragments other than the first fragment of a fragmented datagram. svn path=/trunk/; revision=2810
2000-12-14Check the checksum on ICMPv6 packets, if possible.Guy Harris1-5/+45
svn path=/trunk/; revision=2759
2000-11-19For each column, have both a buffer into which strings for that columnGuy Harris1-2/+2
can be put, and a pointer to the string for the column, which might or might not point to that buffer. Add a routine "col_set_str()", which sets the string for the column to the string passed to it as an argument; it should only be handed a static string (a string constant would be ideal). It doesn't do any copying, so it's faster than "col_add_str()". Make the routines that append to columns check whether the pointer to the string for the column points to the buffer for the column and, if not, copy the string for the column to the buffer for the column so that you can append to it (so you can use "col_set_str()" and then use "col_append_str()" or "col_append_fstr()"). Convert a bunch of "col_add_str()" calls that take a string constant as an argument to "col_set_str()" calls. Convert some "col_add_fstr()" calls that take a string constant as the only argument - i.e., the format string doesn't have any "%" slots into which to put strings for subsequent arguments to "col_set_str()" calls (those calls are just like "col_add_str()" calls). Replace an END_OF_FRAME reference in a tvbuffified dissector with a "tvb_length(tvb)" call. svn path=/trunk/; revision=2670
2000-11-11Get rid of the definitions of LITTLE_ENDIAN and BIG_ENDIAN inGuy Harris1-13/+13
"epan/pint.h" - they caused GCC to whine about them being redefined when I compiled on FreeBSD 3.4. Get rid of the stuff in "packet-ipv6.h" that defines various bit vectors differently depending on the byte order of the machine; instead, define them so that they work with items in host byte order. This lets us use a number of them rather than using hardwired hex values. Put "frag.ip6f_offlg" in host byte order before using it; this means that IP6F_MORE_FRAG can still be used even though it now works only on items in host byte order. svn path=/trunk/; revision=2610
2000-11-09Fix a "proto_tree_add_text()" call.Guy Harris1-2/+2
svn path=/trunk/; revision=2593