aboutsummaryrefslogtreecommitdiffstats
path: root/packet-dns.c
AgeCommit message (Collapse)AuthorFilesLines
2003-05-24Convert the WKS bitnames variable to a GString, on the (way, way)Gerald Combs1-11/+12
off chance that someone has amazingly long service names defined on their system. Discovered by Timo Sirainen. svn path=/trunk/; revision=7734
2003-05-24Fix instances where the return value of snprintf() was being checked for -1,Gerald Combs1-7/+7
but not for <buf_size> or greater. Discovered by Timo Sirainen. svn path=/trunk/; revision=7731
2003-05-07From Yaniv Kaul: show MBZ flags as either OK if 0 or incorrect if not 0.Guy Harris1-1/+16
svn path=/trunk/; revision=7645
2003-05-05From Yaniv Kaul: handle DNSSEC DO/OK bit in OPT pseudo-RR.Guy Harris1-3/+9
svn path=/trunk/; revision=7643
2003-01-31Update a comment.Guy Harris1-4/+10
svn path=/trunk/; revision=7065
2003-01-31Fix up some field lengths.Guy Harris1-5/+13
Put in a note about one capture I've seen. svn path=/trunk/; revision=7059
2003-01-26Call the GSSAPI dissector when disecting GSSAPI transaction keys. The TKEYTim Potter1-10/+47
request works quite nicely but I'm not sure what to call for the response. Currently it just displays "Unknown header: (cls=2, cons=1, tag=1) which looks like it's some more ASN.1 data. svn path=/trunk/; revision=7002
2002-12-02"ip6_to_str()" takes a const pointer as an argument, so you don't haveGuy Harris1-4/+4
to cast away the constness of pointers passed to it. svn path=/trunk/; revision=6718
2002-12-01From Brad Hards:Guy Harris1-6/+27
Support for mDNS/LLMNR "cache flush" bit Label mDNS and DNS differently in the Protocol column Clean up summary line for PTR records svn path=/trunk/; revision=6709
2002-08-30Print RR number as unsigned.Jörg Mayer1-3/+4
svn path=/trunk/; revision=6145
2002-08-30More fixes from Albert ChinRichard Sharpe1-5/+5
svn path=/trunk/; revision=6135
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-62/+62
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-19dissect LLMNR (formerly known as mDNS) on tcp/udp port 5353.Jun-ichiro itojun Hagino1-1/+5
svn path=/trunk/; revision=6022
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-11/+7
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-07-16From Joerg Mayer: add #includes of "snprintf.h" in modules that usedGuy Harris1-1/+5
"snprintf()" but weren't including "snprintf.h". svn path=/trunk/; revision=5887
2002-06-15Put bounds checking into the code in "get_dns_name()" to handle RFC 2673Guy Harris1-4/+42
extended labels. svn path=/trunk/; revision=5672
2002-05-15Use registered fields for the subfields of the Flags field in DNS andGuy Harris1-89/+134
NBNS. svn path=/trunk/; revision=5475
2002-05-11From Graeme Hewson: add some sanity checks to DNS dissector to avoidGuy Harris1-4/+15
loops. svn path=/trunk/; revision=5443
2002-05-05Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,Guy Harris1-113/+30
extracting PDUs from it and possibly doing reassembly. Make the COPS, DNS, DSI, Gryphon, and SCCP dissectors use it. Add "set_actual_length()", "tcp_dissect_pdus()", "decode_boolean_bitfield()", "decode_numeric_bitfield()", and "decode_enumerated_bitfield()" to the list of routines available to dissectors on platforms where routines in the main program aren't available to dynamically-loaded code. Declare routines in "to_str.h" as "extern"; as I remember, that's necessary to allow the "decode_XXX_bitfield()" routines declared therein to be made available to plugins as per the above. Note that new exported routines should be added to the end of the table if that's the only change being made to the table. Create a new "plugin_api_decls.h" header file, used to declare both the "p_" variables and the "p_" structure members in the routine-exporting mechanism; this reduces the number of places you have to change to change the list of exported routines. svn path=/trunk/; revision=5394
2002-03-19Fix some comments.Guy Harris1-4/+4
svn path=/trunk/; revision=4979
2002-02-22Add some necessary "volatile" declarations.Guy Harris1-2/+2
svn path=/trunk/; revision=4788
2002-02-22Catch the ReportedBoundsError exception in the DNS and TPKT dissectorsGuy Harris1-2/+33
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-22Redo the DNS-over-TCP code to handle the DNS-over-TCP header being splitGuy Harris1-32/+59
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-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-20Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOLGuy Harris1-3/+3
items to the protocol tree; it's interpreted as "the rest of the data in the tvbuff". This can be used if 1) the item covers the entire packet or the remaining payload in the packet or 2) the item's length won't be known until it's dissected, and will be then set with "proto_item_set_len()" - if an exception is thrown in the dissection, it means the item ran *past* the end of the tvbuff, so saying it runs to the end of the tvbuff is reasonable. Convert a number of "proto_tree_add_XXX()" calls using "tvb_length_remaining()", values derived from the result of "tvb_length()", or 0 (in the case of items whose length is unknown) to use -1 instead (using 0 means that if an exception is thrown, selecting the item highlights nothing; using -1 means it highlights all the data for that item that's available). In some places where "tvb_length()" or "tvb_length_remaining()" was used to determine how large a packet is, use "tvb_reported_length()" or "tvb_reported_length_remaining()", instead - the first two calls indicate how much captured data was in the packet, the latter two calls indicate how large the packet actually was (and the fact that using the latter could cause BoundsError exceptions to be thrown is a feature - if such an exception is thrown, the frame really *was* short, and it should be tagged as such). Replace some "proto_tree_add_XXX()" calls with equivalent "proto_tree_add_item()" calls. Fix some indentation. svn path=/trunk/; revision=4578
2002-01-19We no longer do explicit checks in low-level routines for running pastGuy Harris1-13/+1
the end of the data in the packet, so we don't need to do those checks in the callers of those routines - and thus don't need to do those checks in the callers of *those* routines. svn path=/trunk/; revision=4574
2001-12-10Move the pointer to the "column_info" structure in the "frame_data"Guy Harris1-54/+54
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-3/+8
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-09-17Add support for desegmentation of DNS messages.Guy Harris1-1/+40
Make the default for NBSS and ONC RPC-over-TCP desegmentation "on", rather than "off"; the default for desegmentation in general is "off", so this won't change the default behavior, but it lets you turn desegmentation on by flipping only one switch (and turn it off for particular protocols if you desire). svn path=/trunk/; revision=3943
2001-09-17Fix the handling of DNS-over-TCP.Guy Harris1-22/+25
Rename the "cap_len" argument to "dissect_dns_common()" to "msg_len", as it's just the length of the DNS message being dissected. svn path=/trunk/; revision=3941
2001-09-14Make the resolution for time values be nanoseconds rather thanGuy Harris1-19/+19
microseconds. Fix some "signed vs. unsigned" comparison warnings. svn path=/trunk/; revision=3934
2001-08-29Add a "proto_item_append_text()" routine, which is likeGuy Harris1-65/+24
"proto_item_set_text()" except that it appends the result of the formatting to the item's current text, rather than replacing the item's current text. Use it in the DNS dissector. svn path=/trunk/; revision=3880
2001-08-28Get rid of "proto_tree_add_notext()" - if you create a subtree using it,Guy Harris1-3/+5
but, before you set the text, you throw an exception while putting stuff under the subtree, you end up with an absolutely blank protocol tree item, which is really gross. Instead of calling "proto_tree_add_notext()", call "proto_tree_add_text()" with at least a minimal label - yes, it does mean you do some work that will probably be unnecessary, but, absent a scheme to arrange to do that work if it *is* necessary (e.g., catching exceptions), the alternative is an ugly protocol tree display. svn path=/trunk/; revision=3879
2001-07-02For DNS-over-TCP, put the length indicator into the tree for the DNSGuy Harris1-4/+14
request/response. svn path=/trunk/; revision=3633
2001-07-02Tvbuffify the DNS, NBNS, NBDS, and NBSS dissectors.Guy Harris1-844/+371
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-9/+9
"header_field_info" structure, including the ones that are later set by the routines to register fields. svn path=/trunk/; revision=3561
2001-06-18Various signed vs. unsigned fixes, from Joerg Mayer.Guy Harris1-2/+2
svn path=/trunk/; revision=3560
2001-04-23Get rid of unnecessary includes.Guy Harris1-3/+2
Fix up Gerald's e-mail address in some files while we're at it, and fix up Michael T�xen's name in one file as well. svn path=/trunk/; revision=3368
2001-04-17Move the declaration of "ipprotostr()" out of "epan/packet.h" into a newGuy Harris1-1/+2
"ipproto.h" header file. svn path=/trunk/; revision=3313
2001-02-20added support for dissecting SRV RRsNathan Neulinger1-1/+67
svn path=/trunk/; revision=3058
2001-02-20correct TSIG decoding (specifically offset/length in dump list).Jun-ichiro itojun Hagino1-19/+12
svn path=/trunk/; revision=3053
2001-01-22Remove more "CHECK_DISPLAY_AS_DATA()" calls and "pinfo->current_proto ="Guy Harris1-3/+3
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. Don't use col_add_fstr(..., "%s", string); Use col_add_str(..., string); as it does the same thing, but doesn't drag all the heavy *printf machinery in. Fix the DDTP dissector to set the Info column regardless of whether we're building a protocol tree or not, and to set it to "Encrypted payload" if the payload is encrypted. Also fix a typo in a field name. Register the FTP data dissector as being associated with the FTP data protocol, not the FTP protocol (the removed "CHECK_DISPLAY_AS_DATA()" call checked "proto_ftp_data", and the removed "pinfo->current_proto =" line set it to "FTP-DATA", so it should be associated with "proto_ftp_data"). Make the H1 dissector check whether the frame has at least 2 bytes in it before checking the first two bytes; heuristic dissectors must not throw exceptions until they've accepted the packet as one of theirs. Use "tvb_format_text()" rather than "tvb_get_ptr()" and "format_text()" in some dissectors where the result of "tvb_get_ptr()" is used only in the "format_text()" call. In the Quake dissector, don't check whether there are at least 4 bytes in the packet - if we return, the packet won't be dissected at all (it's not as if some other dissector will get to handle it), and, if we don't return, we'll throw an exception if there aren't at least 4 bytes in the packet, so the packet will be marked as short or malformed, as appropriate. In the RIPng dissector, associate the table of strings for the command field with the command field, so that the dissector doesn't have to format the string for the protocol tree entry itself, and so that the filter construction dialog box can let you select "Request" or "Response" from a list rather than requiring you to know the values for "Request" and "Response". Make "dissect_rpc()" static, as it's called only through a heuristic dissector list. Use "col_set_str()" to set the COL_PROTOCOL column for RPC protocols; the string used is from a table provided by the dissector, and is a string constant. Don't format the Info column for WSP into a buffer and then format that buffer into the column with "%s" - "col_add_fstr()" can do the formatting for you, without having to allocate your own buffer (or run through the *printf machinery twice). Don't fetch fields from the WTP packet until you're ready to use them, so that you don't throw an exception before you even set the Protocol column or clear the Info column. Use "pinfo->destport", not "pi.destport", in the Zebra dissector when checking whether the packet is a request or reply, and do the check by comparing with "pinfo->match_port" rather than TCP_PORT_ZEBRA (so that if the dissector is ever registered on another port, it still correctly determines whether the packet is a request or reply - the Network Monitor HTTP dissector has port 80 wired into its brain, which is a bit irritating if you're trying to get it to dissect HTTP proxy traffic on port 3128 or proxy administration UI traffic on port 3132). svn path=/trunk/; revision=2931
2001-01-09Add an additional "protocol index" argument to "{old_}dissector_add()",Guy Harris1-3/+3
"{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-11-19For each column, have both a buffer into which strings for that columnGuy Harris1-3/+3
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-14Check for existence of COL_INFO before adding "Short xxx packet" toGilbert Ramirez1-2/+4
COL_INFO. svn path=/trunk/; revision=2641
2000-10-19Fix some typos.Guy Harris1-4/+4
svn path=/trunk/; revision=2518
2000-10-18Fix from Per Flock to A6 RR decoding.Guy Harris1-14/+22
svn path=/trunk/; revision=2509
2000-10-11DNS updates from Brian Wellington.Guy Harris1-37/+451
svn path=/trunk/; revision=2486
2000-10-02A6 and DNAME resource record support, and RFC 2673 bitstring labelGuy Harris1-3/+124
support, from Per Flock. svn path=/trunk/; revision=2473