1998-09-16 02:39:15 +00:00
|
|
|
/* packet-dns.c
|
|
|
|
* Routines for DNS packet disassembly
|
2006-12-31 00:00:06 +00:00
|
|
|
* Copyright 2004, Nicolas DICHTEL - 6WIND - <nicolas.dichtel@6wind.com>
|
2004-11-12 09:46:31 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-09-16 03:22:19 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-09-16 02:39:15 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-09-16 02:39:15 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-12-31 00:00:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* RFC 1034, RFC 1035
|
|
|
|
* RFC 2136 for dynamic DNS
|
|
|
|
* http://files.multicastdns.org/draft-cheshire-dnsext-multicastdns.txt
|
|
|
|
* for multicast DNS
|
2009-02-11 13:25:00 +00:00
|
|
|
* RFC 4795 for link-local multicast name resolution (LLMNR)
|
1998-09-16 02:39:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <memory.h>
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2006-08-23 09:48:16 +00:00
|
|
|
#include <epan/conversation.h>
|
2006-03-20 10:52:53 +00:00
|
|
|
#include <epan/emem.h>
|
2004-09-29 00:52:45 +00:00
|
|
|
#include <epan/ipproto.h>
|
2004-08-06 19:57:49 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
1998-10-14 19:35:00 +00:00
|
|
|
#include "packet-dns.h"
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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-05-05 00:16:38 +00:00
|
|
|
#include "packet-tcp.h"
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2005-05-29 13:02:57 +00:00
|
|
|
#include <epan/strutil.h>
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_dns = -1;
|
2001-07-02 07:29:03 +00:00
|
|
|
static int hf_dns_length = -1;
|
1999-10-16 15:08:11 +00:00
|
|
|
static int hf_dns_flags = -1;
|
2002-05-15 07:24:20 +00:00
|
|
|
static int hf_dns_flags_response = -1;
|
|
|
|
static int hf_dns_flags_opcode = -1;
|
|
|
|
static int hf_dns_flags_authoritative = -1;
|
2009-02-11 13:25:00 +00:00
|
|
|
static int hf_dns_flags_conflict_query = -1;
|
|
|
|
static int hf_dns_flags_conflict_response = -1;
|
2002-05-15 07:24:20 +00:00
|
|
|
static int hf_dns_flags_truncated = -1;
|
|
|
|
static int hf_dns_flags_recdesired = -1;
|
2009-02-11 13:25:00 +00:00
|
|
|
static int hf_dns_flags_tentative = -1;
|
2002-05-15 07:24:20 +00:00
|
|
|
static int hf_dns_flags_recavail = -1;
|
2003-05-07 03:00:32 +00:00
|
|
|
static int hf_dns_flags_z = -1;
|
2002-05-15 07:24:20 +00:00
|
|
|
static int hf_dns_flags_authenticated = -1;
|
|
|
|
static int hf_dns_flags_checkdisable = -1;
|
|
|
|
static int hf_dns_flags_rcode = -1;
|
1999-10-16 15:08:11 +00:00
|
|
|
static int hf_dns_transaction_id = -1;
|
|
|
|
static int hf_dns_count_questions = -1;
|
2004-11-12 09:46:31 +00:00
|
|
|
static int hf_dns_count_zones = -1;
|
1999-10-16 15:08:11 +00:00
|
|
|
static int hf_dns_count_answers = -1;
|
2004-11-12 09:46:31 +00:00
|
|
|
static int hf_dns_count_prerequisites = -1;
|
|
|
|
static int hf_dns_count_updates = -1;
|
1999-10-16 15:08:11 +00:00
|
|
|
static int hf_dns_count_auth_rr = -1;
|
|
|
|
static int hf_dns_count_add_rr = -1;
|
2004-12-26 00:22:16 +00:00
|
|
|
static int hf_dns_qry_name = -1;
|
|
|
|
static int hf_dns_qry_type = -1;
|
|
|
|
static int hf_dns_qry_class = -1;
|
2006-11-12 22:12:39 +00:00
|
|
|
static int hf_dns_qry_class_mdns = -1;
|
|
|
|
static int hf_dns_qry_qu = -1;
|
2004-12-26 00:22:16 +00:00
|
|
|
static int hf_dns_rr_name = -1;
|
|
|
|
static int hf_dns_rr_type = -1;
|
|
|
|
static int hf_dns_rr_class = -1;
|
2006-11-12 22:12:39 +00:00
|
|
|
static int hf_dns_rr_class_mdns = -1;
|
|
|
|
static int hf_dns_rr_cache_flush = -1;
|
2004-12-26 00:22:16 +00:00
|
|
|
static int hf_dns_rr_ttl = -1;
|
|
|
|
static int hf_dns_rr_len = -1;
|
2008-12-18 19:01:08 +00:00
|
|
|
static int hf_dns_nsec3_algo = -1;
|
|
|
|
static int hf_dns_nsec3_flags = -1;
|
|
|
|
static int hf_dns_nsec3_flag_optout = -1;
|
|
|
|
static int hf_dns_nsec3_iterations = -1;
|
|
|
|
static int hf_dns_nsec3_salt_length = -1;
|
|
|
|
static int hf_dns_nsec3_salt_value = -1;
|
|
|
|
static int hf_dns_nsec3_hash_length = -1;
|
|
|
|
static int hf_dns_nsec3_hash_value = -1;
|
2005-12-25 12:03:18 +00:00
|
|
|
static int hf_dns_tsig_error = -1;
|
|
|
|
static int hf_dns_tsig_fudge = -1;
|
|
|
|
static int hf_dns_tsig_mac_size = -1;
|
|
|
|
static int hf_dns_tsig_mac = -1;
|
|
|
|
static int hf_dns_tsig_original_id = -1;
|
|
|
|
static int hf_dns_tsig_algorithm_name = -1;
|
|
|
|
static int hf_dns_tsig_other_len = -1;
|
|
|
|
static int hf_dns_tsig_other_data = -1;
|
2006-08-23 09:48:16 +00:00
|
|
|
static int hf_dns_response_in = -1;
|
|
|
|
static int hf_dns_response_to = -1;
|
|
|
|
static int hf_dns_time = -1;
|
2009-07-31 07:05:43 +00:00
|
|
|
static int hf_dns_sshfp_fingerprint = -1;
|
2009-08-03 18:23:04 +00:00
|
|
|
static int hf_dns_hip_hit = -1;
|
|
|
|
static int hf_dns_hip_pk = -1;
|
2009-08-05 18:17:18 +00:00
|
|
|
static int hf_dns_dhcid_rdata = -1;
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
static int hf_dns_apl_coded_prefix = -1;
|
|
|
|
static int hf_dns_apl_negation = -1;
|
|
|
|
static int hf_dns_apl_afdlength = -1;
|
|
|
|
static int hf_dns_nsap_rdata = -1;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_dns = -1;
|
|
|
|
static gint ett_dns_qd = -1;
|
|
|
|
static gint ett_dns_rr = -1;
|
|
|
|
static gint ett_dns_qry = -1;
|
|
|
|
static gint ett_dns_ans = -1;
|
|
|
|
static gint ett_dns_flags = -1;
|
2008-12-18 19:01:08 +00:00
|
|
|
static gint ett_nsec3_flags = -1;
|
1999-11-27 08:59:28 +00:00
|
|
|
static gint ett_t_key_flags = -1;
|
2003-01-26 01:00:05 +00:00
|
|
|
static gint ett_t_key = -1;
|
2005-12-25 12:03:18 +00:00
|
|
|
static gint ett_dns_mac = -1;
|
|
|
|
|
|
|
|
static dissector_table_t dns_tsig_dissector_table=NULL;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2001-09-17 02:07:00 +00:00
|
|
|
/* desegmentation of DNS over TCP */
|
|
|
|
static gboolean dns_desegment = TRUE;
|
|
|
|
|
2003-01-26 01:00:05 +00:00
|
|
|
/* Dissector handle for GSSAPI */
|
|
|
|
static dissector_handle_t gssapi_handle;
|
2004-11-21 21:23:30 +00:00
|
|
|
static dissector_handle_t ntlmssp_handle;
|
2003-01-26 01:00:05 +00:00
|
|
|
|
2006-08-23 09:48:16 +00:00
|
|
|
/* Structure containing transaction specific information */
|
|
|
|
typedef struct _dns_transaction_t {
|
|
|
|
guint32 req_frame;
|
|
|
|
guint32 rep_frame;
|
|
|
|
nstime_t req_time;
|
|
|
|
} dns_transaction_t;
|
|
|
|
|
|
|
|
/* Structure containing conversation specific information */
|
|
|
|
typedef struct _dns_conv_info_t {
|
|
|
|
emem_tree_t *pdus;
|
|
|
|
} dns_conv_info_t;
|
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
/* DNS structs and definitions */
|
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
/* Ports used for DNS. */
|
2009-09-21 12:00:03 +00:00
|
|
|
#define UDP_PORT_DNS 53
|
|
|
|
#define TCP_PORT_DNS 53
|
|
|
|
#define SCTP_PORT_DNS 53
|
|
|
|
#define UDP_PORT_MDNS 5353
|
|
|
|
#define TCP_PORT_MDNS 5353
|
|
|
|
#define UDP_PORT_LLMNR 5355
|
|
|
|
#if 0
|
|
|
|
/* PPID used for DNS/SCTP (will be changed when IANA assgined) */
|
|
|
|
#define DNS_PAYLOAD_PROTOCOL_ID 1000
|
|
|
|
#endif
|
2000-04-04 06:17:30 +00:00
|
|
|
|
1999-01-04 09:13:46 +00:00
|
|
|
/* Offsets of fields in the DNS header. */
|
|
|
|
#define DNS_ID 0
|
|
|
|
#define DNS_FLAGS 2
|
|
|
|
#define DNS_QUEST 4
|
1999-10-07 07:44:29 +00:00
|
|
|
#define DNS_ANS 6
|
1999-01-04 09:13:46 +00:00
|
|
|
#define DNS_AUTH 8
|
1999-10-07 07:44:29 +00:00
|
|
|
#define DNS_ADD 10
|
1999-01-04 09:13:46 +00:00
|
|
|
|
|
|
|
/* Length of DNS header. */
|
|
|
|
#define DNS_HDRLEN 12
|
1998-09-16 02:39:15 +00:00
|
|
|
|
|
|
|
/* type values */
|
|
|
|
#define T_A 1 /* host address */
|
1999-03-22 23:31:05 +00:00
|
|
|
#define T_NS 2 /* authoritative name server */
|
|
|
|
#define T_MD 3 /* mail destination (obsolete) */
|
|
|
|
#define T_MF 4 /* mail forwarder (obsolete) */
|
1998-09-16 02:39:15 +00:00
|
|
|
#define T_CNAME 5 /* canonical name */
|
|
|
|
#define T_SOA 6 /* start of authority zone */
|
1999-03-22 23:31:05 +00:00
|
|
|
#define T_MB 7 /* mailbox domain name (experimental) */
|
|
|
|
#define T_MG 8 /* mail group member (experimental) */
|
|
|
|
#define T_MR 9 /* mail rename domain name (experimental) */
|
|
|
|
#define T_NULL 10 /* null RR (experimental) */
|
1998-09-16 02:39:15 +00:00
|
|
|
#define T_WKS 11 /* well known service */
|
|
|
|
#define T_PTR 12 /* domain name pointer */
|
|
|
|
#define T_HINFO 13 /* host information */
|
1999-03-22 23:31:05 +00:00
|
|
|
#define T_MINFO 14 /* mailbox or mail list information */
|
1998-09-16 02:39:15 +00:00
|
|
|
#define T_MX 15 /* mail routing information */
|
|
|
|
#define T_TXT 16 /* text strings */
|
1999-03-22 23:31:05 +00:00
|
|
|
#define T_RP 17 /* responsible person (RFC 1183) */
|
|
|
|
#define T_AFSDB 18 /* AFS data base location (RFC 1183) */
|
|
|
|
#define T_X25 19 /* X.25 address (RFC 1183) */
|
|
|
|
#define T_ISDN 20 /* ISDN address (RFC 1183) */
|
|
|
|
#define T_RT 21 /* route-through (RFC 1183) */
|
|
|
|
#define T_NSAP 22 /* OSI NSAP (RFC 1706) */
|
|
|
|
#define T_NSAP_PTR 23 /* PTR equivalent for OSI NSAP (RFC 1348 - obsolete) */
|
2000-10-11 04:12:06 +00:00
|
|
|
#define T_SIG 24 /* digital signature (RFC 2535) */
|
|
|
|
#define T_KEY 25 /* public key (RFC 2535) */
|
1999-03-22 23:31:05 +00:00
|
|
|
#define T_PX 26 /* pointer to X.400/RFC822 mapping info (RFC 1664) */
|
|
|
|
#define T_GPOS 27 /* geographical position (RFC 1712) */
|
|
|
|
#define T_AAAA 28 /* IPv6 address (RFC 1886) */
|
|
|
|
#define T_LOC 29 /* geographical location (RFC 1876) */
|
2000-10-11 04:12:06 +00:00
|
|
|
#define T_NXT 30 /* "next" name (RFC 2535) */
|
1999-03-22 23:31:05 +00:00
|
|
|
#define T_EID 31 /* ??? (Nimrod?) */
|
|
|
|
#define T_NIMLOC 32 /* ??? (Nimrod?) */
|
|
|
|
#define T_SRV 33 /* service location (RFC 2052) */
|
|
|
|
#define T_ATMA 34 /* ??? */
|
2006-12-31 00:00:06 +00:00
|
|
|
#define T_NAPTR 35 /* naming authority pointer (RFC 3403) */
|
2000-10-11 04:12:06 +00:00
|
|
|
#define T_KX 36 /* Key Exchange (RFC 2230) */
|
|
|
|
#define T_CERT 37 /* Certificate (RFC 2538) */
|
2000-08-18 09:05:02 +00:00
|
|
|
#define T_A6 38 /* IPv6 address with indirection (RFC 2874) */
|
2000-10-02 17:42:38 +00:00
|
|
|
#define T_DNAME 39 /* Non-terminal DNS name redirection (RFC 2672) */
|
2000-03-30 01:33:10 +00:00
|
|
|
#define T_OPT 41 /* OPT pseudo-RR (RFC 2671) */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
#define T_APL 42 /* Lists of Address Prefixes (APL RR) (RFC 3123) */
|
2003-12-19 23:13:42 +00:00
|
|
|
#define T_DS 43 /* Delegation Signature(RFC 3658) */
|
2009-07-31 07:05:43 +00:00
|
|
|
#define T_SSHFP 44 /* Using DNS to Securely Publish SSH Key Fingerprints (RFC 4255) */
|
2004-12-02 08:28:10 +00:00
|
|
|
#define T_IPSECKEY 45 /* draft-ietf-ipseckey-rr */
|
2004-01-23 00:51:47 +00:00
|
|
|
#define T_RRSIG 46 /* future RFC 2535bis */
|
|
|
|
#define T_NSEC 47 /* future RFC 2535bis */
|
|
|
|
#define T_DNSKEY 48 /* future RFC 2535bis */
|
2009-08-05 18:17:18 +00:00
|
|
|
#define T_DHCID 49 /* DHCID RR (RFC 4701) */
|
2008-12-18 19:01:08 +00:00
|
|
|
#define T_NSEC3 50 /* Next secure hash (RFC 5155) */
|
|
|
|
#define T_NSEC3PARAM 51 /* NSEC3 parameters (RFC 5155) */
|
2009-08-03 18:23:04 +00:00
|
|
|
#define T_HIP 55 /* Host Identity Protocol (HIP) RR (RFC 5205) */
|
2009-07-31 16:37:53 +00:00
|
|
|
#define T_SPF 99 /* SPF RR (RFC 4408) section 3 */
|
2000-10-11 04:12:06 +00:00
|
|
|
#define T_TKEY 249 /* Transaction Key (RFC 2930) */
|
|
|
|
#define T_TSIG 250 /* Transaction Signature (RFC 2845) */
|
2000-07-21 01:29:04 +00:00
|
|
|
#define T_WINS 65281 /* Microsoft's WINS RR */
|
|
|
|
#define T_WINS_R 65282 /* Microsoft's WINS-R RR */
|
2009-07-29 07:10:02 +00:00
|
|
|
#define T_DLV 32769 /* DNSSEC Lookaside Validation (DLV) DNS Resource Record (RFC 4431) */
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2000-08-09 07:15:19 +00:00
|
|
|
/* Class values */
|
|
|
|
#define C_IN 1 /* the Internet */
|
|
|
|
#define C_CS 2 /* CSNET (obsolete) */
|
|
|
|
#define C_CH 3 /* CHAOS */
|
|
|
|
#define C_HS 4 /* Hesiod */
|
2000-10-11 04:12:06 +00:00
|
|
|
#define C_NONE 254 /* none */
|
|
|
|
#define C_ANY 255 /* any */
|
2006-11-12 22:12:39 +00:00
|
|
|
|
|
|
|
#define C_QU (1<<15) /* High bit is set in queries for unicast queries */
|
2002-12-01 20:50:52 +00:00
|
|
|
#define C_FLUSH (1<<15) /* High bit is set for MDNS cache flush */
|
2000-08-09 07:15:19 +00:00
|
|
|
|
1999-01-04 09:13:46 +00:00
|
|
|
/* Bit fields in the flags */
|
|
|
|
#define F_RESPONSE (1<<15) /* packet is response */
|
|
|
|
#define F_OPCODE (0xF<<11) /* query opcode */
|
2002-05-15 07:24:20 +00:00
|
|
|
#define OPCODE_SHIFT 11
|
1999-01-04 09:13:46 +00:00
|
|
|
#define F_AUTHORITATIVE (1<<10) /* response is authoritative */
|
2009-02-11 13:25:00 +00:00
|
|
|
#define F_CONFLICT (1<<10) /* conflict detected */
|
1999-01-04 09:13:46 +00:00
|
|
|
#define F_TRUNCATED (1<<9) /* response is truncated */
|
|
|
|
#define F_RECDESIRED (1<<8) /* recursion desired */
|
2009-02-11 13:25:00 +00:00
|
|
|
#define F_TENTATIVE (1<<8) /* response is tentative */
|
1999-01-04 09:13:46 +00:00
|
|
|
#define F_RECAVAIL (1<<7) /* recursion available */
|
2009-02-11 13:25:00 +00:00
|
|
|
#define F_Z (1<<6) /* Z */
|
2000-04-26 12:01:50 +00:00
|
|
|
#define F_AUTHENTIC (1<<5) /* authentic data (RFC2535) */
|
|
|
|
#define F_CHECKDISABLE (1<<4) /* checking disabled (RFC2535) */
|
1999-01-04 09:13:46 +00:00
|
|
|
#define F_RCODE (0xF<<0) /* reply code */
|
|
|
|
|
2002-05-15 07:24:20 +00:00
|
|
|
static const true_false_string tfs_flags_response = {
|
|
|
|
"Message is a response",
|
|
|
|
"Message is a query"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string tfs_flags_authoritative = {
|
|
|
|
"Server is an authority for domain",
|
|
|
|
"Server is not an authority for domain"
|
|
|
|
};
|
|
|
|
|
2009-02-11 13:25:00 +00:00
|
|
|
static const true_false_string tfs_flags_conflict_query = {
|
|
|
|
"The sender received multiple responses",
|
|
|
|
"None"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string tfs_flags_conflict_response = {
|
|
|
|
"The name is not considered unique",
|
|
|
|
"The name is considered unique"
|
|
|
|
};
|
|
|
|
|
2002-05-15 07:24:20 +00:00
|
|
|
static const true_false_string tfs_flags_truncated = {
|
|
|
|
"Message is truncated",
|
|
|
|
"Message is not truncated"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string tfs_flags_recdesired = {
|
|
|
|
"Do query recursively",
|
|
|
|
"Don't do query recursively"
|
|
|
|
};
|
|
|
|
|
2009-02-11 13:25:00 +00:00
|
|
|
static const true_false_string tfs_flags_tentative = {
|
|
|
|
"Tentative",
|
|
|
|
"Not tentative"
|
|
|
|
};
|
|
|
|
|
2002-05-15 07:24:20 +00:00
|
|
|
static const true_false_string tfs_flags_recavail = {
|
|
|
|
"Server can do recursive queries",
|
|
|
|
"Server can't do recursive queries"
|
|
|
|
};
|
|
|
|
|
2003-05-07 03:00:32 +00:00
|
|
|
static const true_false_string tfs_flags_z = {
|
|
|
|
"reserved - incorrect!",
|
|
|
|
"reserved (0)"
|
|
|
|
};
|
|
|
|
|
2002-05-15 07:24:20 +00:00
|
|
|
static const true_false_string tfs_flags_authenticated = {
|
|
|
|
"Answer/authority portion was authenticated by the server",
|
|
|
|
"Answer/authority portion was not authenticated by the server"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string tfs_flags_checkdisable = {
|
|
|
|
"Non-authenticated data is acceptable",
|
|
|
|
"Non-authenticated data is unacceptable"
|
|
|
|
};
|
|
|
|
|
1999-01-04 09:13:46 +00:00
|
|
|
/* Opcodes */
|
2002-05-15 07:24:20 +00:00
|
|
|
#define OPCODE_QUERY 0 /* standard query */
|
|
|
|
#define OPCODE_IQUERY 1 /* inverse query */
|
|
|
|
#define OPCODE_STATUS 2 /* server status request */
|
|
|
|
#define OPCODE_NOTIFY 4 /* zone change notification */
|
|
|
|
#define OPCODE_UPDATE 5 /* dynamic update */
|
|
|
|
|
|
|
|
static const value_string opcode_vals[] = {
|
|
|
|
{ OPCODE_QUERY, "Standard query" },
|
|
|
|
{ OPCODE_IQUERY, "Inverse query" },
|
|
|
|
{ OPCODE_STATUS, "Server status request" },
|
|
|
|
{ OPCODE_NOTIFY, "Zone change notification" },
|
|
|
|
{ OPCODE_UPDATE, "Dynamic update" },
|
|
|
|
{ 0, NULL } };
|
1999-01-04 09:13:46 +00:00
|
|
|
|
|
|
|
/* Reply codes */
|
2002-05-15 07:24:20 +00:00
|
|
|
#define RCODE_NOERROR 0
|
|
|
|
#define RCODE_FORMERR 1
|
|
|
|
#define RCODE_SERVFAIL 2
|
|
|
|
#define RCODE_NXDOMAIN 3
|
|
|
|
#define RCODE_NOTIMPL 4
|
|
|
|
#define RCODE_REFUSED 5
|
|
|
|
#define RCODE_YXDOMAIN 6
|
|
|
|
#define RCODE_YXRRSET 7
|
|
|
|
#define RCODE_NXRRSET 8
|
|
|
|
#define RCODE_NOTAUTH 9
|
|
|
|
#define RCODE_NOTZONE 10
|
2000-10-11 04:12:06 +00:00
|
|
|
|
|
|
|
static const value_string rcode_vals[] = {
|
|
|
|
{ RCODE_NOERROR, "No error" },
|
|
|
|
{ RCODE_FORMERR, "Format error" },
|
|
|
|
{ RCODE_SERVFAIL, "Server failure" },
|
|
|
|
{ RCODE_NXDOMAIN, "No such name" },
|
|
|
|
{ RCODE_NOTIMPL, "Not implemented" },
|
|
|
|
{ RCODE_REFUSED, "Refused" },
|
|
|
|
{ RCODE_YXDOMAIN, "Name exists" },
|
|
|
|
{ RCODE_YXRRSET, "RRset exists" },
|
|
|
|
{ RCODE_NXRRSET, "RRset does not exist" },
|
|
|
|
{ RCODE_NOTAUTH, "Not authoritative" },
|
|
|
|
{ RCODE_NOTZONE, "Name out of zone" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
2008-12-18 19:01:08 +00:00
|
|
|
#define NSEC3_HASH_RESERVED 0
|
|
|
|
#define NSEC3_HASH_SHA1 1
|
|
|
|
|
|
|
|
#define NSEC3_FLAG_OPTOUT 1
|
|
|
|
|
|
|
|
static const value_string hash_algorithms[] = {
|
|
|
|
{ NSEC3_HASH_RESERVED, "Reserved" },
|
|
|
|
{ NSEC3_HASH_SHA1, "SHA-1" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
|
|
|
static const true_false_string tfs_flags_nsec3_optout = {
|
|
|
|
"Additional insecure delegations allowed",
|
|
|
|
"Additional insecure delegations forbidden"
|
|
|
|
};
|
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
/* TSIG/TKEY extended errors */
|
|
|
|
#define TSIGERROR_BADSIG (16)
|
|
|
|
#define TSIGERROR_BADKEY (17)
|
|
|
|
#define TSIGERROR_BADTIME (18)
|
|
|
|
#define TSIGERROR_BADMODE (19)
|
|
|
|
#define TSIGERROR_BADNAME (20)
|
|
|
|
#define TSIGERROR_BADALG (21)
|
|
|
|
|
|
|
|
static const value_string tsigerror_vals[] = {
|
|
|
|
{ TSIGERROR_BADSIG, "Bad signature" },
|
|
|
|
{ TSIGERROR_BADKEY, "Bad key" },
|
|
|
|
{ TSIGERROR_BADTIME, "Bad time failure" },
|
|
|
|
{ TSIGERROR_BADMODE, "Bad mode such name" },
|
|
|
|
{ TSIGERROR_BADNAME, "Bad name implemented" },
|
|
|
|
{ TSIGERROR_BADALG, "Bad algorithm" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
|
|
|
#define TKEYMODE_SERVERASSIGNED (1)
|
|
|
|
#define TKEYMODE_DIFFIEHELLMAN (2)
|
|
|
|
#define TKEYMODE_GSSAPI (3)
|
|
|
|
#define TKEYMODE_RESOLVERASSIGNED (4)
|
|
|
|
#define TKEYMODE_DELETE (5)
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2003-11-26 23:23:37 +00:00
|
|
|
#define TDSDIGEST_RESERVED (0)
|
|
|
|
#define TDSDIGEST_SHA1 (1)
|
2009-07-29 07:10:02 +00:00
|
|
|
#define TDSDIGEST_SHA256 (2)
|
2003-11-26 23:23:37 +00:00
|
|
|
|
2009-07-31 07:05:43 +00:00
|
|
|
/*
|
|
|
|
* SSHFP (RFC 4255) algorithm number and fingerprint types
|
|
|
|
*/
|
|
|
|
#define TSSHFP_ALGO_RESERVED (0)
|
|
|
|
#define TSSHFP_ALGO_RSA (1)
|
|
|
|
#define TSSHFP_ALGO_DSA (2)
|
|
|
|
#define TSSHFP_FTYPE_RESERVED (0)
|
|
|
|
#define TSSHFP_FTYPE_SHA1 (1)
|
|
|
|
|
2009-08-03 18:23:04 +00:00
|
|
|
/* HIP PK ALGO RFC 5205 */
|
|
|
|
#define THIP_ALGO_DSA (1)
|
|
|
|
#define THIP_ALGO_RSA (2)
|
|
|
|
#define THIP_ALGO_RESERVED (0)
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
/* RFC 3213 */
|
|
|
|
#define TAPL_ADDR_FAMILY_IPV4 (1)
|
|
|
|
#define TAPL_ADDR_FAMILY_IPV6 (2)
|
|
|
|
#define DNS_APL_NEGATION (1<<7)
|
|
|
|
#define DNS_APL_AFDLENGTH (0x7F<<0)
|
|
|
|
|
|
|
|
static const true_false_string tfs_dns_apl_negation = {
|
|
|
|
"Yes (!)",
|
|
|
|
"No (0)"
|
|
|
|
};
|
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
/* See RFC 1035 for all RR types for which no RFC is listed, except for
|
|
|
|
the ones with "???", and for the Microsoft WINS and WINS-R RRs, for
|
|
|
|
which one should look at
|
|
|
|
|
2000-07-21 01:40:41 +00:00
|
|
|
http://www.windows.com/windows2000/en/server/help/sag_DNS_imp_UsingWinsLookup.htm
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
and
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
http://www.microsoft.com/windows2000/library/resources/reskit/samplechapters/cncf/cncf_imp_wwaw.asp
|
|
|
|
|
|
|
|
which discuss them to some extent. */
|
2004-12-26 00:22:16 +00:00
|
|
|
|
|
|
|
static const value_string dns_types[] = {
|
|
|
|
{ 0, "Unused" },
|
|
|
|
{ T_A, "A" },
|
|
|
|
{ T_NS, "NS" },
|
|
|
|
{ T_MD, "MD" },
|
|
|
|
{ T_MF, "MF" },
|
|
|
|
{ T_CNAME, "CNAME" },
|
|
|
|
{ T_SOA, "SOA" },
|
|
|
|
{ T_MB, "MB" },
|
|
|
|
{ T_MG, "MG" },
|
|
|
|
{ T_MR, "MR" },
|
|
|
|
{ T_NULL, "NULL" },
|
|
|
|
{ T_WKS, "WKS" },
|
|
|
|
{ T_PTR, "PTR" },
|
|
|
|
{ T_HINFO, "HINFO" },
|
|
|
|
{ T_MINFO, "MINFO" },
|
|
|
|
{ T_MX, "MX" },
|
|
|
|
{ T_TXT, "TXT" },
|
|
|
|
{ T_RP, "RP" }, /* RFC 1183 */
|
|
|
|
{ T_AFSDB, "AFSDB" }, /* RFC 1183 */
|
|
|
|
{ T_X25, "X25" }, /* RFC 1183 */
|
|
|
|
{ T_ISDN, "ISDN" }, /* RFC 1183 */
|
|
|
|
{ T_RT, "RT" }, /* RFC 1183 */
|
|
|
|
{ T_NSAP, "NSAP" }, /* RFC 1706 */
|
|
|
|
{ T_NSAP_PTR, "NSAP-PTR" }, /* RFC 1348 */
|
|
|
|
{ T_SIG, "SIG" }, /* RFC 2535 */
|
|
|
|
{ T_KEY, "KEY" }, /* RFC 2535 */
|
|
|
|
{ T_PX, "PX" }, /* RFC 1664 */
|
|
|
|
{ T_GPOS, "GPOS" }, /* RFC 1712 */
|
|
|
|
{ T_AAAA, "AAAA" }, /* RFC 1886 */
|
|
|
|
{ T_LOC, "LOC" }, /* RFC 1886 */
|
|
|
|
{ T_NXT, "NXT" }, /* RFC 1876 */
|
|
|
|
{ T_EID, "EID" },
|
|
|
|
{ T_NIMLOC, "NIMLOC" },
|
|
|
|
{ T_SRV, "SRV" }, /* RFC 2052 */
|
|
|
|
{ T_ATMA, "ATMA" },
|
2006-12-31 00:00:06 +00:00
|
|
|
{ T_NAPTR, "NAPTR" }, /* RFC 3403 */
|
2004-12-26 00:22:16 +00:00
|
|
|
{ T_KX, "KX" }, /* RFC 2230 */
|
|
|
|
{ T_CERT, "CERT" }, /* RFC 2538 */
|
|
|
|
{ T_A6, "A6" }, /* RFC 2874 */
|
|
|
|
{ T_DNAME, "DNAME" }, /* RFC 2672 */
|
|
|
|
|
|
|
|
{ T_OPT, "OPT" }, /* RFC 2671 */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
{ T_APL, "APL" }, /* RFC 3123 */
|
2004-12-26 00:22:16 +00:00
|
|
|
{ T_DS, "DS" }, /* RFC 3658 */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
{ T_SSHFP, "SSHFP" }, /* Using DNS to Securely Publish SSH Key Fingerprints (RFC 4255) */
|
2004-12-26 00:22:16 +00:00
|
|
|
{ T_IPSECKEY, "IPSECKEY" }, /* draft-ietf-ipseckey-rr */
|
|
|
|
{ T_RRSIG, "RRSIG" }, /* future RFC 2535bis */
|
|
|
|
{ T_NSEC, "NSEC" }, /* future RFC 2535bis */
|
|
|
|
{ T_DNSKEY, "DNSKEY" }, /* future RFC 2535bis */
|
2009-08-05 18:17:18 +00:00
|
|
|
{ T_DHCID, "DHCID" }, /* DHCID RR (RFC 4701) */
|
2008-12-18 19:01:08 +00:00
|
|
|
{ T_NSEC3, "NSEC3" }, /* Next secure hash (RFC 5155) */
|
|
|
|
{ T_NSEC3PARAM, "NSEC3PARAM" }, /* Next secure hash (RFC 5155) */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-08-03 18:23:04 +00:00
|
|
|
{ T_HIP, "HIP" }, /* Host Identity Protocol (HIP) RR (RFC 5205) */
|
2008-12-18 19:01:08 +00:00
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
{ T_SPF, "SPF" }, /* SPF RR (RFC 4408) section 3 */
|
2004-12-26 00:22:16 +00:00
|
|
|
{ 100, "UINFO" },
|
|
|
|
{ 101, "UID" },
|
|
|
|
{ 102, "GID" },
|
|
|
|
{ 103, "UNSPEC" },
|
|
|
|
|
|
|
|
{ T_TKEY, "TKEY"},
|
|
|
|
{ T_TSIG, "TSIG"},
|
|
|
|
|
|
|
|
{ T_WINS, "WINS"},
|
|
|
|
{ T_WINS_R, "WINS-R"},
|
|
|
|
|
|
|
|
{ 251, "IXFR"},
|
|
|
|
{ 252, "AXFR"},
|
|
|
|
{ 253, "MAILB"},
|
|
|
|
{ 254, "MAILA"},
|
|
|
|
{ 255, "ANY"},
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
|
|
|
{ T_DLV, "DLV" }, /* Domain Lookaside Validation DNS Resource Record (RFC 4431) */
|
2004-12-26 00:22:16 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
|
|
|
|
2005-06-26 19:56:52 +00:00
|
|
|
static const char *
|
2002-08-02 23:36:07 +00:00
|
|
|
dns_type_name (guint type)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
2004-12-26 00:22:16 +00:00
|
|
|
return val_to_str(type, dns_types, "Unknown (%u)");
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
|
1999-03-22 23:31:05 +00:00
|
|
|
static char *
|
2004-12-26 00:22:16 +00:00
|
|
|
dns_type_description (guint type)
|
1999-03-22 23:31:05 +00:00
|
|
|
{
|
2004-12-26 00:22:16 +00:00
|
|
|
static const char *type_names[] = {
|
1999-03-22 23:31:05 +00:00
|
|
|
"unused",
|
|
|
|
"Host address",
|
2002-08-28 21:04:11 +00:00
|
|
|
"Authoritative name server",
|
1999-03-22 23:31:05 +00:00
|
|
|
"Mail destination",
|
|
|
|
"Mail forwarder",
|
|
|
|
"Canonical name for an alias",
|
|
|
|
"Start of zone of authority",
|
|
|
|
"Mailbox domain name",
|
|
|
|
"Mail group member",
|
|
|
|
"Mail rename domain name",
|
|
|
|
"Null resource record",
|
|
|
|
"Well-known service description",
|
|
|
|
"Domain name pointer",
|
|
|
|
"Host information",
|
|
|
|
"Mailbox or mail list information",
|
|
|
|
"Mail exchange",
|
|
|
|
"Text strings",
|
|
|
|
"Responsible person", /* RFC 1183 */
|
|
|
|
"AFS data base location", /* RFC 1183 */
|
|
|
|
"X.25 address", /* RFC 1183 */
|
|
|
|
"ISDN number", /* RFC 1183 */
|
|
|
|
"Route through", /* RFC 1183 */
|
|
|
|
"OSI NSAP", /* RFC 1706 */
|
|
|
|
"OSI NSAP name pointer", /* RFC 1348 */
|
2000-10-11 04:12:06 +00:00
|
|
|
"Signature", /* RFC 2535 */
|
|
|
|
"Public key", /* RFC 2535 */
|
1999-03-22 23:31:05 +00:00
|
|
|
"Pointer to X.400/RFC822 mapping info", /* RFC 1664 */
|
|
|
|
"Geographical position", /* RFC 1712 */
|
|
|
|
"IPv6 address", /* RFC 1886 */
|
|
|
|
"Location", /* RFC 1876 */
|
2000-10-11 04:12:06 +00:00
|
|
|
"Next", /* RFC 2535 */
|
1999-03-22 23:31:05 +00:00
|
|
|
"EID",
|
|
|
|
"NIMLOC",
|
|
|
|
"Service location", /* RFC 2052 */
|
|
|
|
"ATMA",
|
2000-03-30 01:33:10 +00:00
|
|
|
"Naming authority pointer", /* RFC 2168 */
|
2000-10-11 04:12:06 +00:00
|
|
|
"Key Exchange", /* RFC 2230 */
|
|
|
|
"Certificate", /* RFC 2538 */
|
2000-08-18 09:05:02 +00:00
|
|
|
"IPv6 address with indirection", /* RFC 2874 */
|
2000-10-02 17:42:38 +00:00
|
|
|
"Non-terminal DNS name redirection", /* RFC 2672 */
|
2000-03-30 01:33:10 +00:00
|
|
|
NULL,
|
2003-11-26 23:23:37 +00:00
|
|
|
"EDNS0 option", /* RFC 2671 */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
"Lists of Address Prefixes", /* RFC 3123 */
|
2004-01-23 00:51:47 +00:00
|
|
|
"Delegation Signer", /* RFC 3658 */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
"SSH public host key fingerprint", /* RFC 4255 */
|
2004-12-02 08:28:10 +00:00
|
|
|
"key to use with IPSEC", /* draft-ietf-ipseckey-rr */
|
2004-01-23 00:51:47 +00:00
|
|
|
"RR signature", /* future RFC 2535bis */
|
|
|
|
"Next secured", /* future RFC 2535bis */
|
2008-12-18 19:01:08 +00:00
|
|
|
"DNS public key", /* future RFC 2535bis */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
"DHCP Information", /* RFC 4701 */
|
2008-12-18 19:01:08 +00:00
|
|
|
"Next secured hash", /* RFC 5155 */
|
2009-07-31 07:05:43 +00:00
|
|
|
"NSEC3 parameters", /* RFC 5155 */
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
"Host Identity Protocol"
|
1999-03-22 23:31:05 +00:00
|
|
|
};
|
2005-06-26 19:56:52 +00:00
|
|
|
const char *short_name;
|
2004-12-26 00:22:16 +00:00
|
|
|
const char *long_name;
|
|
|
|
|
|
|
|
short_name = dns_type_name(type);
|
|
|
|
if (short_name == NULL) {
|
2009-10-25 11:43:30 +00:00
|
|
|
return ep_strdup_printf("Unknown (%u)", type);
|
2004-12-26 00:22:16 +00:00
|
|
|
}
|
2000-03-30 01:33:10 +00:00
|
|
|
if (type < sizeof(type_names)/sizeof(type_names[0]))
|
2004-12-26 00:22:16 +00:00
|
|
|
long_name = type_names[type];
|
|
|
|
else {
|
|
|
|
/* special cases */
|
|
|
|
switch (type) {
|
|
|
|
/* meta */
|
|
|
|
case T_TKEY:
|
|
|
|
long_name = "Transaction Key";
|
|
|
|
break;
|
|
|
|
case T_TSIG:
|
|
|
|
long_name = "Transaction Signature";
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* queries */
|
|
|
|
case 251:
|
|
|
|
long_name = "Request for incremental zone transfer"; /* RFC 1995 */
|
|
|
|
break;
|
|
|
|
case 252:
|
|
|
|
long_name = "Request for full zone transfer";
|
|
|
|
break;
|
|
|
|
case 253:
|
|
|
|
long_name = "Request for mailbox-related records";
|
|
|
|
break;
|
|
|
|
case 254:
|
|
|
|
long_name = "Request for mail agent resource records";
|
|
|
|
break;
|
|
|
|
case 255:
|
|
|
|
long_name = "Request for all records";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
long_name = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2004-12-26 00:22:16 +00:00
|
|
|
if (long_name != NULL)
|
2009-10-25 11:43:30 +00:00
|
|
|
return ep_strdup_printf("%s (%s)", short_name, long_name);
|
2004-12-26 00:22:16 +00:00
|
|
|
else
|
2009-10-25 11:43:30 +00:00
|
|
|
return ep_strdup(short_name);
|
1999-03-22 23:31:05 +00:00
|
|
|
}
|
|
|
|
|
2004-12-26 00:22:16 +00:00
|
|
|
static const value_string dns_classes[] = {
|
|
|
|
{C_IN, "IN"},
|
|
|
|
{C_CS, "CS"},
|
|
|
|
{C_CH, "CH"},
|
|
|
|
{C_HS, "HS"},
|
|
|
|
{C_NONE, "NONE"},
|
|
|
|
{C_ANY, "ANY"},
|
|
|
|
{0,NULL}
|
|
|
|
};
|
1999-03-22 23:31:05 +00:00
|
|
|
|
2005-06-26 19:56:52 +00:00
|
|
|
const char *
|
1998-09-16 02:39:15 +00:00
|
|
|
dns_class_name(int class)
|
|
|
|
{
|
2004-12-26 00:22:16 +00:00
|
|
|
return val_to_str(class, dns_classes, "Unknown (%u)");
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2005-10-08 12:31:06 +00:00
|
|
|
/* This function returns the number of bytes consumed and the expanded string
|
|
|
|
* in *name.
|
|
|
|
* The string is allocated with ep scope and does not need to be free()d.
|
|
|
|
* it will be automatically free()d when the packet has been dissected.
|
|
|
|
*/
|
1999-05-27 05:35:08 +00:00
|
|
|
int
|
2008-08-11 12:00:27 +00:00
|
|
|
get_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset,
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar **name)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
2001-07-02 07:11:40 +00:00
|
|
|
int start_offset = offset;
|
2009-03-23 12:41:56 +00:00
|
|
|
guchar *np;
|
1999-05-27 05:35:08 +00:00
|
|
|
int len = -1;
|
2000-04-12 06:59:28 +00:00
|
|
|
int chars_processed = 0;
|
2001-07-02 07:11:40 +00:00
|
|
|
int data_size = tvb_reported_length_remaining(tvb, dns_data_offset);
|
2001-06-18 01:49:17 +00:00
|
|
|
int component_len;
|
2001-07-02 07:11:40 +00:00
|
|
|
int indir_offset;
|
2005-10-08 12:31:06 +00:00
|
|
|
int maxname;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2002-05-11 18:46:38 +00:00
|
|
|
const int min_len = 1; /* Minimum length of encoded name (for root) */
|
|
|
|
/* If we're about to return a value (probably negative) which is less
|
|
|
|
* than the minimum length, we're looking at bad data and we're liable
|
|
|
|
* to put the dissector into a loop. Instead we throw an exception */
|
|
|
|
|
2005-10-08 12:31:06 +00:00
|
|
|
maxname=MAXDNAME;
|
2007-04-23 10:59:26 +00:00
|
|
|
np=ep_alloc(maxname);
|
|
|
|
*name=np;
|
2005-10-08 12:31:06 +00:00
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
maxname--; /* reserve space for the trailing '\0' */
|
1999-10-07 07:44:29 +00:00
|
|
|
for (;;) {
|
2008-08-11 12:00:27 +00:00
|
|
|
if (max_len && offset - start_offset > max_len - 1)
|
|
|
|
break;
|
2001-07-02 07:11:40 +00:00
|
|
|
component_len = tvb_get_guint8(tvb, offset);
|
1999-10-07 07:44:29 +00:00
|
|
|
offset++;
|
|
|
|
if (component_len == 0)
|
|
|
|
break;
|
2000-04-12 06:59:28 +00:00
|
|
|
chars_processed++;
|
1999-05-27 05:35:08 +00:00
|
|
|
switch (component_len & 0xc0) {
|
|
|
|
|
|
|
|
case 0x00:
|
|
|
|
/* Label */
|
2005-10-08 12:31:06 +00:00
|
|
|
if (np != *name) {
|
1999-05-27 05:35:08 +00:00
|
|
|
/* Not the first component - put in a '.'. */
|
|
|
|
if (maxname > 0) {
|
|
|
|
*np++ = '.';
|
|
|
|
maxname--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (component_len > 0) {
|
2008-08-11 12:00:27 +00:00
|
|
|
if (max_len && offset - start_offset > max_len - 1)
|
|
|
|
THROW(ReportedBoundsError);
|
1999-05-27 05:35:08 +00:00
|
|
|
if (maxname > 0) {
|
2001-07-02 07:11:40 +00:00
|
|
|
*np++ = tvb_get_guint8(tvb, offset);
|
1999-05-27 05:35:08 +00:00
|
|
|
maxname--;
|
|
|
|
}
|
|
|
|
component_len--;
|
1999-10-07 07:44:29 +00:00
|
|
|
offset++;
|
2000-04-12 06:59:28 +00:00
|
|
|
chars_processed++;
|
1999-05-27 05:35:08 +00:00
|
|
|
}
|
|
|
|
break;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
case 0x40:
|
2000-10-02 17:42:38 +00:00
|
|
|
/* Extended label (RFC 2673) */
|
|
|
|
switch (component_len & 0x3f) {
|
|
|
|
|
|
|
|
case 0x01:
|
|
|
|
/* Bitstring label */
|
|
|
|
{
|
|
|
|
int bit_count;
|
|
|
|
int label_len;
|
2002-06-15 20:38:34 +00:00
|
|
|
int print_len;
|
2000-10-02 17:42:38 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
bit_count = tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
2000-10-02 17:42:38 +00:00
|
|
|
label_len = (bit_count - 1) / 8 + 1;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-06-15 20:38:34 +00:00
|
|
|
if (maxname > 0) {
|
2005-08-17 23:10:28 +00:00
|
|
|
print_len = g_snprintf(np, maxname + 1, "\\[x");
|
2003-05-24 17:45:10 +00:00
|
|
|
if (print_len != -1 && print_len <= maxname) {
|
2005-08-17 23:10:28 +00:00
|
|
|
/* Some versions of g_snprintf return -1 if they'd truncate
|
2003-05-24 17:45:10 +00:00
|
|
|
the output. Others return <buf_size> or greater. */
|
2002-06-15 20:38:34 +00:00
|
|
|
np += print_len;
|
|
|
|
maxname -= print_len;
|
|
|
|
} else {
|
|
|
|
/* Nothing printed, as there's no room.
|
|
|
|
Suppress all subsequent printing. */
|
|
|
|
maxname = 0;
|
|
|
|
}
|
|
|
|
}
|
2000-10-02 17:42:38 +00:00
|
|
|
while(label_len--) {
|
2002-06-15 20:38:34 +00:00
|
|
|
if (maxname > 0) {
|
2005-08-17 23:10:28 +00:00
|
|
|
print_len = g_snprintf(np, maxname + 1, "%02x",
|
2002-06-15 20:38:34 +00:00
|
|
|
tvb_get_guint8(tvb, offset));
|
2003-05-24 17:45:10 +00:00
|
|
|
if (print_len != -1 && print_len <= maxname) {
|
2005-08-17 23:10:28 +00:00
|
|
|
/* Some versions of g_snprintf return -1 if they'd truncate
|
2003-05-24 17:45:10 +00:00
|
|
|
the output. Others return <buf_size> or greater. */
|
2002-06-15 20:38:34 +00:00
|
|
|
np += print_len;
|
|
|
|
maxname -= print_len;
|
|
|
|
} else {
|
|
|
|
/* Nothing printed, as there's no room.
|
|
|
|
Suppress all subsequent printing. */
|
|
|
|
maxname = 0;
|
|
|
|
}
|
|
|
|
}
|
2001-07-02 07:11:40 +00:00
|
|
|
offset++;
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
2002-06-15 20:38:34 +00:00
|
|
|
if (maxname > 0) {
|
2005-08-17 23:10:28 +00:00
|
|
|
print_len = g_snprintf(np, maxname + 1, "/%d]", bit_count);
|
2003-05-24 17:45:10 +00:00
|
|
|
if (print_len != -1 && print_len <= maxname) {
|
2005-08-17 23:10:28 +00:00
|
|
|
/* Some versions of g_snprintf return -1 if they'd truncate
|
2003-05-24 17:45:10 +00:00
|
|
|
the output. Others return <buf_size> or greater. */
|
2002-06-15 20:38:34 +00:00
|
|
|
np += print_len;
|
|
|
|
maxname -= print_len;
|
|
|
|
} else {
|
|
|
|
/* Nothing printed, as there's no room.
|
|
|
|
Suppress all subsequent printing. */
|
|
|
|
maxname = 0;
|
|
|
|
}
|
|
|
|
}
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2005-10-08 12:31:06 +00:00
|
|
|
*name="<Unknown extended label>";
|
2000-10-02 17:42:38 +00:00
|
|
|
/* Parsing will propably fail from here on, since the */
|
|
|
|
/* label length is unknown... */
|
2002-05-11 18:46:38 +00:00
|
|
|
len = offset - start_offset;
|
|
|
|
if (len < min_len)
|
|
|
|
THROW(ReportedBoundsError);
|
|
|
|
return len;
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
case 0x80:
|
2002-05-11 18:46:38 +00:00
|
|
|
THROW(ReportedBoundsError);
|
1999-05-27 05:35:08 +00:00
|
|
|
|
|
|
|
case 0xc0:
|
|
|
|
/* Pointer. */
|
2001-07-02 07:11:40 +00:00
|
|
|
indir_offset = dns_data_offset +
|
|
|
|
(((component_len & ~0xc0) << 8) | tvb_get_guint8(tvb, offset));
|
|
|
|
offset++;
|
2000-04-12 06:59:28 +00:00
|
|
|
chars_processed++;
|
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
/* If "len" is negative, we are still working on the original name,
|
|
|
|
not something pointed to by a pointer, and so we should set "len"
|
|
|
|
to the length of the original name. */
|
|
|
|
if (len < 0)
|
2001-07-02 07:11:40 +00:00
|
|
|
len = offset - start_offset;
|
2000-04-12 06:59:28 +00:00
|
|
|
|
|
|
|
/* If we've looked at every character in the message, this pointer
|
|
|
|
will make us look at some character again, which means we're
|
|
|
|
looping. */
|
|
|
|
if (chars_processed >= data_size) {
|
2005-10-08 12:31:06 +00:00
|
|
|
*name="<Name contains a pointer that loops>";
|
2002-05-11 18:46:38 +00:00
|
|
|
if (len < min_len)
|
|
|
|
THROW(ReportedBoundsError);
|
2000-04-12 06:59:28 +00:00
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
offset = indir_offset;
|
1999-05-27 05:35:08 +00:00
|
|
|
break; /* now continue processing from there */
|
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
*np = '\0';
|
|
|
|
/* If "len" is negative, we haven't seen a pointer, and thus haven't
|
|
|
|
set the length, so set it. */
|
|
|
|
if (len < 0)
|
2001-07-02 07:11:40 +00:00
|
|
|
len = offset - start_offset;
|
1999-05-27 05:35:08 +00:00
|
|
|
/* Zero-length name means "root server" */
|
2005-10-08 12:31:06 +00:00
|
|
|
if (**name == '\0')
|
|
|
|
*name="<Root>";
|
2002-05-11 18:46:38 +00:00
|
|
|
if (len < min_len)
|
|
|
|
THROW(ReportedBoundsError);
|
1998-09-16 02:39:15 +00:00
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
2001-07-02 07:11:40 +00:00
|
|
|
get_dns_name_type_class(tvbuff_t *tvb, int offset, int dns_data_offset,
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar **name_ret, int *name_len_ret, int *type_ret, int *class_ret)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
|
|
|
int len;
|
|
|
|
int name_len;
|
|
|
|
int type;
|
|
|
|
int class;
|
1999-10-07 07:44:29 +00:00
|
|
|
int start_offset = offset;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
name_len = get_dns_name(tvb, offset, 0, dns_data_offset, name_ret);
|
1999-10-07 09:21:38 +00:00
|
|
|
offset += name_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
type = tvb_get_ntohs(tvb, offset);
|
1999-10-07 07:44:29 +00:00
|
|
|
offset += 2;
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
class = tvb_get_ntohs(tvb, offset);
|
1999-10-07 07:44:29 +00:00
|
|
|
offset += 2;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
|
|
|
*type_ret = type;
|
|
|
|
*class_ret = class;
|
1998-10-14 19:35:00 +00:00
|
|
|
*name_len_ret = name_len;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-10-07 07:44:29 +00:00
|
|
|
len = offset - start_offset;
|
1998-09-16 02:39:15 +00:00
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
1999-09-21 07:15:38 +00:00
|
|
|
static double
|
2001-07-02 07:11:40 +00:00
|
|
|
rfc1867_size(tvbuff_t *tvb, int offset)
|
1999-09-21 07:15:38 +00:00
|
|
|
{
|
2001-07-02 07:11:40 +00:00
|
|
|
guint8 val;
|
1999-09-21 07:15:38 +00:00
|
|
|
double size;
|
|
|
|
guint32 exponent;
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
val = tvb_get_guint8(tvb, offset);
|
1999-10-07 07:44:29 +00:00
|
|
|
size = (val & 0xF0) >> 4;
|
|
|
|
exponent = (val & 0x0F);
|
1999-09-21 07:15:38 +00:00
|
|
|
while (exponent != 0) {
|
|
|
|
size *= 10;
|
|
|
|
exponent--;
|
|
|
|
}
|
|
|
|
return size / 100; /* return size in meters, not cm */
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *
|
2001-07-02 07:11:40 +00:00
|
|
|
rfc1867_angle(tvbuff_t *tvb, int offset, const char *nsew)
|
1999-09-21 07:15:38 +00:00
|
|
|
{
|
|
|
|
guint32 angle;
|
|
|
|
char direction;
|
|
|
|
guint32 degrees, minutes, secs, tsecs;
|
2002-08-30 15:17:12 +00:00
|
|
|
/* "%u deg %u min %u.%03u sec %c" */
|
1999-09-21 07:15:38 +00:00
|
|
|
static char buf[10+1+3+1 + 2+1+3+1 + 2+1+3+1+3+1 + 1 + 1];
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
angle = tvb_get_ntohl(tvb, offset);
|
1999-09-21 07:15:38 +00:00
|
|
|
|
|
|
|
if (angle < 0x80000000U) {
|
|
|
|
angle = 0x80000000U - angle;
|
|
|
|
direction = nsew[1];
|
|
|
|
} else {
|
|
|
|
angle = angle - 0x80000000U;
|
|
|
|
direction = nsew[0];
|
|
|
|
}
|
|
|
|
tsecs = angle % 1000;
|
|
|
|
angle = angle / 1000;
|
|
|
|
secs = angle % 60;
|
|
|
|
angle = angle / 60;
|
|
|
|
minutes = angle % 60;
|
|
|
|
degrees = angle / 60;
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(buf, sizeof(buf), "%u deg %u min %u.%03u sec %c", degrees, minutes, secs,
|
1999-09-21 07:15:38 +00:00
|
|
|
tsecs, direction);
|
|
|
|
return buf;
|
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
|
|
|
|
static int
|
2001-07-02 07:11:40 +00:00
|
|
|
dissect_dns_query(tvbuff_t *tvb, int offset, int dns_data_offset,
|
2006-11-12 22:12:39 +00:00
|
|
|
column_info *cinfo, proto_tree *dns_tree, gboolean is_mdns)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
|
|
|
int len;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *name;
|
|
|
|
gchar *name_out;
|
1998-10-14 19:35:00 +00:00
|
|
|
int name_len;
|
1998-09-16 02:39:15 +00:00
|
|
|
int type;
|
|
|
|
int class;
|
2006-11-12 22:12:39 +00:00
|
|
|
int qu;
|
2005-06-26 19:56:52 +00:00
|
|
|
const char *type_name;
|
2001-07-02 07:11:40 +00:00
|
|
|
int data_offset;
|
|
|
|
int data_start;
|
1999-03-23 03:14:46 +00:00
|
|
|
proto_tree *q_tree;
|
|
|
|
proto_item *tq;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
data_start = data_offset = offset;
|
1998-10-14 19:35:00 +00:00
|
|
|
|
2005-10-08 12:31:06 +00:00
|
|
|
len = get_dns_name_type_class(tvb, offset, dns_data_offset, &name, &name_len,
|
1998-10-14 19:35:00 +00:00
|
|
|
&type, &class);
|
2001-07-02 07:11:40 +00:00
|
|
|
data_offset += len;
|
2006-11-12 22:12:39 +00:00
|
|
|
if (is_mdns) {
|
|
|
|
/* Split the QU flag and the class */
|
|
|
|
qu = class & C_QU;
|
|
|
|
class &= ~C_QU;
|
|
|
|
} else
|
|
|
|
qu = 0;
|
1999-10-07 02:26:45 +00:00
|
|
|
|
1998-10-15 06:40:51 +00:00
|
|
|
type_name = dns_type_name(type);
|
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
/*
|
|
|
|
* The name might contain octets that aren't printable characters,
|
|
|
|
* format it for display.
|
|
|
|
*/
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(name, strlen(name));
|
2005-06-04 11:47:38 +00:00
|
|
|
|
2005-05-29 13:02:57 +00:00
|
|
|
if (cinfo != NULL) {
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s %s", type_name, name_out);
|
2006-11-12 22:35:21 +00:00
|
|
|
if (is_mdns)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, ", \"%s\" question", qu ? "QU" : "QM");
|
2005-05-29 13:02:57 +00:00
|
|
|
}
|
1999-11-07 21:00:40 +00:00
|
|
|
if (dns_tree != NULL) {
|
2002-08-28 21:04:11 +00:00
|
|
|
tq = proto_tree_add_text(dns_tree, tvb, offset, len, "%s: type %s, class %s",
|
2005-05-29 13:02:57 +00:00
|
|
|
name_out, type_name, dns_class_name(class));
|
2006-11-12 22:35:21 +00:00
|
|
|
if (is_mdns)
|
|
|
|
proto_item_append_text(tq, ", \"%s\" question", qu ? "QU" : "QM");
|
1999-11-16 11:44:20 +00:00
|
|
|
q_tree = proto_item_add_subtree(tq, ett_dns_qd);
|
1998-10-15 06:40:51 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_tree_add_string(q_tree, hf_dns_qry_name, tvb, offset, name_len, name);
|
1999-11-07 21:00:40 +00:00
|
|
|
offset += name_len;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_uint_format(q_tree, hf_dns_qry_type, tvb, offset, 2, type,
|
|
|
|
"Type: %s", dns_type_description(type));
|
1999-11-07 21:00:40 +00:00
|
|
|
offset += 2;
|
1998-10-14 19:35:00 +00:00
|
|
|
|
2006-11-12 22:12:39 +00:00
|
|
|
if (is_mdns) {
|
|
|
|
proto_tree_add_uint(q_tree, hf_dns_qry_class_mdns, tvb, offset, 2, class);
|
|
|
|
proto_tree_add_boolean(q_tree, hf_dns_qry_qu, tvb, offset, 2, qu);
|
|
|
|
} else
|
|
|
|
proto_tree_add_uint(q_tree, hf_dns_qry_class, tvb, offset, 2, class);
|
2009-03-30 19:39:01 +00:00
|
|
|
|
1999-11-07 21:00:40 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
return data_offset - data_start;
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-12-26 00:22:16 +00:00
|
|
|
static proto_tree *
|
2001-07-02 07:11:40 +00:00
|
|
|
add_rr_to_tree(proto_item *trr, int rr_type, tvbuff_t *tvb, int offset,
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *name, int namelen, int type, int class, int flush,
|
2006-11-12 22:12:39 +00:00
|
|
|
guint ttl, gushort data_len, gboolean is_mdns)
|
1998-10-14 19:35:00 +00:00
|
|
|
{
|
1999-03-23 03:14:46 +00:00
|
|
|
proto_tree *rr_tree;
|
1998-10-14 19:35:00 +00:00
|
|
|
|
1999-07-07 22:52:57 +00:00
|
|
|
rr_tree = proto_item_add_subtree(trr, rr_type);
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_string(rr_tree, hf_dns_rr_name, tvb, offset, namelen, name);
|
1998-10-14 19:35:00 +00:00
|
|
|
offset += namelen;
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_uint_format(rr_tree, hf_dns_rr_type, tvb, offset, 2, type,
|
|
|
|
"Type: %s", dns_type_description(type));
|
1998-10-14 19:35:00 +00:00
|
|
|
offset += 2;
|
2006-11-12 22:12:39 +00:00
|
|
|
if (is_mdns) {
|
|
|
|
proto_tree_add_uint(rr_tree, hf_dns_rr_class_mdns, tvb, offset, 2, class);
|
|
|
|
proto_tree_add_boolean(rr_tree, hf_dns_rr_cache_flush, tvb, offset, 2, flush);
|
|
|
|
} else
|
|
|
|
proto_tree_add_uint(rr_tree, hf_dns_rr_class, tvb, offset, 2, class);
|
1998-10-14 19:35:00 +00:00
|
|
|
offset += 2;
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_uint_format(rr_tree, hf_dns_rr_ttl, tvb, offset, 4, ttl,
|
|
|
|
"Time to live: %s", time_secs_to_str(ttl));
|
1998-10-14 19:35:00 +00:00
|
|
|
offset += 4;
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_uint(rr_tree, hf_dns_rr_len, tvb, offset, 2, data_len);
|
1998-10-14 19:35:00 +00:00
|
|
|
return rr_tree;
|
|
|
|
}
|
|
|
|
|
2004-12-26 00:22:16 +00:00
|
|
|
|
2000-03-30 01:52:40 +00:00
|
|
|
static proto_tree *
|
2001-07-02 07:11:40 +00:00
|
|
|
add_opt_rr_to_tree(proto_item *trr, int rr_type, tvbuff_t *tvb, int offset,
|
2006-11-12 23:42:08 +00:00
|
|
|
const char *name, int namelen, int type, int class, int flush,
|
|
|
|
guint ttl, gushort data_len, gboolean is_mdns)
|
2000-03-30 01:33:10 +00:00
|
|
|
{
|
2003-05-05 08:14:31 +00:00
|
|
|
proto_tree *rr_tree, *Z_tree;
|
|
|
|
proto_item *Z_item = NULL;
|
2000-03-30 01:33:10 +00:00
|
|
|
|
|
|
|
rr_tree = proto_item_add_subtree(trr, rr_type);
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_string(rr_tree, hf_dns_rr_name, tvb, offset, namelen, name);
|
2000-03-30 01:33:10 +00:00
|
|
|
offset += namelen;
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_uint_format(rr_tree, hf_dns_rr_type, tvb, offset, 2, type,
|
|
|
|
"Type: %s", dns_type_description(type));
|
2000-03-30 01:33:10 +00:00
|
|
|
offset += 2;
|
2006-11-12 23:42:08 +00:00
|
|
|
if (is_mdns) {
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 2, "%s",
|
|
|
|
decode_numeric_bitfield(class, 0x7fff, 16,
|
|
|
|
"UDP payload size: %u"));
|
|
|
|
proto_tree_add_boolean(rr_tree, hf_dns_rr_cache_flush, tvb, offset, 2,
|
|
|
|
flush);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 2, "UDP payload size: %u",
|
2000-03-30 01:33:10 +00:00
|
|
|
class & 0xffff);
|
2006-11-12 23:42:08 +00:00
|
|
|
}
|
2000-03-30 01:33:10 +00:00
|
|
|
offset += 2;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 1, "Higher bits in extended RCODE: 0x%x",
|
2000-03-30 01:33:10 +00:00
|
|
|
(ttl >> 24) & 0xff0);
|
|
|
|
offset++;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 1, "EDNS0 version: %u",
|
2000-03-30 01:33:10 +00:00
|
|
|
(ttl >> 16) & 0xff);
|
|
|
|
offset++;
|
2003-05-05 08:14:31 +00:00
|
|
|
Z_item = proto_tree_add_text(rr_tree, tvb, offset, 2, "Z: 0x%x", ttl & 0xffff);
|
|
|
|
if (ttl & 0x8000) {
|
|
|
|
Z_tree = proto_item_add_subtree(Z_item, rr_type);
|
|
|
|
proto_tree_add_text(Z_tree, tvb, offset, 2, "Bit 0 (DO bit): 1 (Accepts DNSSEC security RRs)");
|
|
|
|
proto_tree_add_text(Z_tree, tvb, offset, 2, "Bits 1-15: 0x%x (reserved)", (ttl >> 17) & 0xff);
|
|
|
|
}
|
2000-03-30 01:33:10 +00:00
|
|
|
offset += 2;
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_uint(rr_tree, hf_dns_rr_len, tvb, offset, 2, data_len);
|
2000-03-30 01:33:10 +00:00
|
|
|
return rr_tree;
|
|
|
|
}
|
|
|
|
|
2008-12-18 19:01:08 +00:00
|
|
|
static int
|
|
|
|
dissect_type_bitmap(proto_tree *rr_tree, tvbuff_t *tvb, int cur_offset, int rr_len)
|
2009-03-30 19:39:01 +00:00
|
|
|
{
|
2008-12-18 19:01:08 +00:00
|
|
|
int mask, blockbase, blocksize;
|
|
|
|
int i, initial_offset, rr_type;
|
|
|
|
guint8 bits;
|
|
|
|
|
|
|
|
initial_offset = cur_offset;
|
|
|
|
while (rr_len != 0) {
|
|
|
|
blockbase = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
blocksize = tvb_get_guint8(tvb, cur_offset + 1);
|
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
rr_type = blockbase * 256;
|
2009-03-30 19:39:01 +00:00
|
|
|
for( ; blocksize; blocksize-- ) {
|
2008-12-18 19:01:08 +00:00
|
|
|
bits = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
mask = 1<<7;
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
if (bits & mask) {
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1,
|
|
|
|
"RR type in bit map: %s",
|
|
|
|
dns_type_description(rr_type));
|
|
|
|
}
|
|
|
|
mask >>= 1;
|
|
|
|
rr_type++;
|
|
|
|
}
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return(initial_offset - cur_offset);
|
|
|
|
}
|
|
|
|
|
1999-11-27 08:59:28 +00:00
|
|
|
/*
|
2000-10-11 04:12:06 +00:00
|
|
|
* SIG, KEY, and CERT RR algorithms.
|
1999-11-27 08:59:28 +00:00
|
|
|
*/
|
2008-12-18 19:01:08 +00:00
|
|
|
#define DNS_ALGO_RSAMD5 1 /* RSA/MD5 */
|
|
|
|
#define DNS_ALGO_DH 2 /* Diffie-Hellman */
|
|
|
|
#define DNS_ALGO_DSA 3 /* DSA */
|
|
|
|
#define DNS_ALGO_ECC 4 /* Elliptic curve crypto */
|
|
|
|
#define DNS_ALGO_RSASHA1 5 /* RSA/SHA1 */
|
|
|
|
#define DNS_ALGO_DSA_NSEC3_SHA1 6 /* DSA + NSEC3/SHA1 */
|
|
|
|
#define DNS_ALGO_RSASHA1_NSEC3_SHA1 7 /* RSA/SHA1 + NSEC3/SHA1 */
|
|
|
|
#define DNS_ALGO_HMACMD5 157 /* HMAC/MD5 */
|
|
|
|
#define DNS_ALGO_INDIRECT 252 /* Indirect key */
|
|
|
|
#define DNS_ALGO_PRIVATEDNS 253 /* Private, domain name */
|
|
|
|
#define DNS_ALGO_PRIVATEOID 254 /* Private, OID */
|
1999-11-27 08:59:28 +00:00
|
|
|
|
|
|
|
static const value_string algo_vals[] = {
|
2008-12-18 19:01:08 +00:00
|
|
|
{ DNS_ALGO_RSAMD5, "RSA/MD5" },
|
|
|
|
{ DNS_ALGO_DH, "Diffie-Hellman" },
|
|
|
|
{ DNS_ALGO_DSA, "DSA" },
|
|
|
|
{ DNS_ALGO_ECC, "Elliptic curve crypto" },
|
|
|
|
{ DNS_ALGO_RSASHA1, "RSA/SHA1" },
|
|
|
|
{ DNS_ALGO_DSA_NSEC3_SHA1, "DSA + NSEC3/SHA1" },
|
|
|
|
{ DNS_ALGO_RSASHA1_NSEC3_SHA1,"RSA/SHA1 + NSEC3/SHA1" },
|
|
|
|
{ DNS_ALGO_HMACMD5, "HMAC/MD5" },
|
|
|
|
{ DNS_ALGO_INDIRECT, "Indirect key" },
|
|
|
|
{ DNS_ALGO_PRIVATEDNS, "Private, domain name" },
|
|
|
|
{ DNS_ALGO_PRIVATEOID, "Private, OID" },
|
|
|
|
{ 0, NULL }
|
1999-11-27 08:59:28 +00:00
|
|
|
};
|
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
#define DNS_CERT_PGP 1 /* PGP */
|
|
|
|
#define DNS_CERT_PKIX 2 /* PKIX */
|
|
|
|
#define DNS_CERT_SPKI 3 /* SPKI */
|
|
|
|
#define DNS_CERT_PRIVATEURI 253 /* Private, URI */
|
|
|
|
#define DNS_CERT_PRIVATEOID 254 /* Private, OID */
|
|
|
|
|
|
|
|
static const value_string cert_vals[] = {
|
|
|
|
{ DNS_CERT_PGP, "PGP" },
|
|
|
|
{ DNS_CERT_PKIX, "PKIX" },
|
|
|
|
{ DNS_CERT_SPKI, "SPKI" },
|
|
|
|
{ DNS_CERT_PRIVATEURI, "Private, URI" },
|
|
|
|
{ DNS_CERT_PRIVATEOID, "Private, OID" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2003-12-10 19:35:03 +00:00
|
|
|
/**
|
|
|
|
* Compute the key id of a KEY RR depending of the algorithm used.
|
|
|
|
*/
|
2004-01-20 00:11:59 +00:00
|
|
|
static guint16
|
2009-03-30 19:39:01 +00:00
|
|
|
compute_key_id(tvbuff_t *tvb, int offset, int size, guint8 algo)
|
2003-12-10 19:35:03 +00:00
|
|
|
{
|
2003-12-11 08:54:19 +00:00
|
|
|
guint32 ac;
|
2004-01-20 00:11:59 +00:00
|
|
|
guint8 c1, c2;
|
2003-12-10 19:35:03 +00:00
|
|
|
|
2005-06-10 18:28:22 +00:00
|
|
|
DISSECTOR_ASSERT(size >= 4);
|
2009-03-30 19:39:01 +00:00
|
|
|
|
2003-12-10 19:35:03 +00:00
|
|
|
switch( algo ) {
|
|
|
|
case DNS_ALGO_RSAMD5:
|
2004-01-20 00:11:59 +00:00
|
|
|
return (guint16)(tvb_get_guint8(tvb, offset + size - 3) << 8) + tvb_get_guint8( tvb, offset + size - 2 );
|
|
|
|
default:
|
2003-12-10 19:35:03 +00:00
|
|
|
for (ac = 0; size > 1; size -= 2, offset += 2) {
|
|
|
|
c1 = tvb_get_guint8( tvb, offset );
|
|
|
|
c2 = tvb_get_guint8( tvb, offset + 1 );
|
|
|
|
ac += (c1 << 8) + c2 ;
|
|
|
|
}
|
|
|
|
if (size > 0) {
|
|
|
|
c1 = tvb_get_guint8( tvb, offset );
|
|
|
|
ac += c1 << 8;
|
|
|
|
}
|
|
|
|
ac += (ac >> 16) & 0xffff;
|
2004-01-20 00:11:59 +00:00
|
|
|
return (guint16)(ac & 0xffff);
|
2003-12-10 19:35:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
static int
|
2008-06-27 16:15:30 +00:00
|
|
|
dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset,
|
2006-11-12 22:12:39 +00:00
|
|
|
column_info *cinfo, proto_tree *dns_tree, packet_info *pinfo,
|
|
|
|
gboolean is_mdns)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
|
|
|
int len;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *name;
|
|
|
|
gchar *name_out;
|
1998-10-14 19:35:00 +00:00
|
|
|
int name_len;
|
1998-09-16 02:39:15 +00:00
|
|
|
int type;
|
|
|
|
int class;
|
2006-11-12 22:12:39 +00:00
|
|
|
int flush;
|
2005-06-26 19:56:52 +00:00
|
|
|
const char *class_name;
|
|
|
|
const char *type_name;
|
2001-07-02 07:11:40 +00:00
|
|
|
int data_offset;
|
1999-10-07 07:44:29 +00:00
|
|
|
int cur_offset;
|
2001-07-02 07:11:40 +00:00
|
|
|
int data_start;
|
2002-08-02 23:36:07 +00:00
|
|
|
guint ttl;
|
|
|
|
gushort data_len;
|
2000-03-07 05:57:13 +00:00
|
|
|
proto_tree *rr_tree = NULL;
|
|
|
|
proto_item *trr = NULL;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2008-06-27 16:15:30 +00:00
|
|
|
data_start = data_offset = offsetx;
|
|
|
|
cur_offset = offsetx;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2008-06-27 16:15:30 +00:00
|
|
|
len = get_dns_name_type_class(tvb, offsetx, dns_data_offset, &name, &name_len,
|
1998-10-14 19:35:00 +00:00
|
|
|
&type, &class);
|
2001-07-02 07:11:40 +00:00
|
|
|
data_offset += len;
|
1999-10-07 07:44:29 +00:00
|
|
|
cur_offset += len;
|
2006-11-12 23:42:08 +00:00
|
|
|
if (is_mdns) {
|
2006-11-12 22:12:39 +00:00
|
|
|
/* Split the FLUSH flag and the class */
|
|
|
|
flush = class & C_FLUSH;
|
|
|
|
class &= ~C_FLUSH;
|
|
|
|
} else
|
|
|
|
flush = 0;
|
1999-10-07 02:26:45 +00:00
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
type_name = dns_type_name(type);
|
|
|
|
class_name = dns_class_name(class);
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
ttl = tvb_get_ntohl(tvb, data_offset);
|
|
|
|
data_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
cur_offset += 4;
|
1998-10-14 19:35:00 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
data_len = tvb_get_ntohs(tvb, data_offset);
|
|
|
|
data_offset += 2;
|
1999-10-07 07:44:29 +00:00
|
|
|
cur_offset += 2;
|
1998-10-14 19:35:00 +00:00
|
|
|
|
2006-11-12 22:12:39 +00:00
|
|
|
if (cinfo != NULL) {
|
2001-12-10 00:26:21 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", type_name);
|
2006-11-12 22:12:39 +00:00
|
|
|
if (is_mdns && flush)
|
|
|
|
col_append_str(cinfo, COL_INFO, ", cache flush");
|
|
|
|
}
|
2000-03-21 06:21:37 +00:00
|
|
|
if (dns_tree != NULL) {
|
2005-06-27 07:50:11 +00:00
|
|
|
/*
|
|
|
|
* The name might contain octets that aren't printable characters,
|
|
|
|
* format it for display.
|
|
|
|
*/
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(name, strlen(name));
|
2000-03-30 01:33:10 +00:00
|
|
|
if (type != T_OPT) {
|
2008-06-27 16:15:30 +00:00
|
|
|
trr = proto_tree_add_text(dns_tree, tvb, offsetx,
|
2005-01-13 07:51:08 +00:00
|
|
|
(data_offset - data_start) + data_len,
|
|
|
|
"%s: type %s, class %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out, type_name, class_name);
|
2008-06-27 16:15:30 +00:00
|
|
|
rr_tree = add_rr_to_tree(trr, ett_dns_rr, tvb, offsetx, name, name_len,
|
2006-11-12 22:12:39 +00:00
|
|
|
type, class, flush, ttl, data_len, is_mdns);
|
2000-03-30 01:33:10 +00:00
|
|
|
} else {
|
2008-06-27 16:15:30 +00:00
|
|
|
trr = proto_tree_add_text(dns_tree, tvb, offsetx,
|
2005-01-13 07:51:08 +00:00
|
|
|
(data_offset - data_start) + data_len,
|
2005-06-27 07:50:11 +00:00
|
|
|
"%s: type %s", name_out, type_name);
|
2008-06-27 16:15:30 +00:00
|
|
|
rr_tree = add_opt_rr_to_tree(trr, ett_dns_rr, tvb, offsetx, name, name_len,
|
2006-11-12 23:42:08 +00:00
|
|
|
type, class, flush, ttl, data_len, is_mdns);
|
2000-03-30 01:33:10 +00:00
|
|
|
}
|
2006-11-12 23:42:08 +00:00
|
|
|
if (is_mdns && flush)
|
|
|
|
proto_item_append_text(trr, ", cache flush");
|
2000-03-21 06:21:37 +00:00
|
|
|
}
|
|
|
|
|
2004-11-12 09:46:31 +00:00
|
|
|
if (data_len == 0)
|
|
|
|
return data_offset - data_start;
|
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
switch (type) {
|
2000-03-21 06:21:37 +00:00
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
case T_A:
|
2001-07-02 07:11:40 +00:00
|
|
|
{
|
|
|
|
const guint8 *addr;
|
|
|
|
guint32 addr_int;
|
|
|
|
|
|
|
|
addr = tvb_get_ptr(tvb, cur_offset, 4);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", ip_to_str(addr));
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", addr %s", ip_to_str(addr));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Addr: %s",
|
|
|
|
ip_to_str(addr));
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2002-12-01 20:50:52 +00:00
|
|
|
if ((class & 0x7f) == C_IN) {
|
2001-07-02 07:11:40 +00:00
|
|
|
memcpy(&addr_int, addr, sizeof(addr_int));
|
2004-11-17 08:53:20 +00:00
|
|
|
add_ipv4_name(addr_int, name);
|
2001-07-02 07:11:40 +00:00
|
|
|
}
|
2000-08-08 16:21:24 +00:00
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
break;
|
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
case T_NS:
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *ns_name;
|
1998-10-14 19:35:00 +00:00
|
|
|
int ns_name_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
ns_name_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &ns_name);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(ns_name, strlen(ns_name));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", ns %s", name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, ns_name_len, "Name server: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
case T_CNAME:
|
1999-03-22 23:31:05 +00:00
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *cname;
|
1999-03-22 23:31:05 +00:00
|
|
|
int cname_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
cname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &cname);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(cname, strlen(cname));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", cname %s", name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, cname_len, "Primary name: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_SOA:
|
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *mname;
|
1999-05-27 05:35:08 +00:00
|
|
|
int mname_len;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *rname;
|
1999-05-27 05:35:08 +00:00
|
|
|
int rname_len;
|
|
|
|
guint32 serial;
|
|
|
|
guint32 refresh;
|
|
|
|
guint32 retry;
|
|
|
|
guint32 expire;
|
|
|
|
guint32 minimum;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
mname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &mname);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(mname, strlen(mname));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", mname %s", name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, mname_len, "Primary name server: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset += mname_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
rname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &rname);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(rname, strlen(rname));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rname_len, "Responsible authority's mailbox: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset += rname_len;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
serial = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Serial number: %u",
|
1999-11-07 21:00:40 +00:00
|
|
|
serial);
|
|
|
|
cur_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
refresh = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Refresh interval: %s",
|
1999-11-07 21:00:40 +00:00
|
|
|
time_secs_to_str(refresh));
|
|
|
|
cur_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
retry = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Retry interval: %s",
|
1999-11-07 21:00:40 +00:00
|
|
|
time_secs_to_str(retry));
|
|
|
|
cur_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
expire = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Expiration limit: %s",
|
1999-11-07 21:00:40 +00:00
|
|
|
time_secs_to_str(expire));
|
|
|
|
cur_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
minimum = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Minimum TTL: %s",
|
1999-11-07 21:00:40 +00:00
|
|
|
time_secs_to_str(minimum));
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-03-22 23:31:05 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-05-27 05:35:08 +00:00
|
|
|
case T_PTR:
|
1999-03-22 23:31:05 +00:00
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *pname;
|
1999-03-22 23:31:05 +00:00
|
|
|
int pname_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
pname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &pname);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(pname, strlen(pname));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", %s", name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, pname_len, "Domain name: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-03-22 23:31:05 +00:00
|
|
|
}
|
|
|
|
break;
|
1999-09-21 07:15:38 +00:00
|
|
|
|
2000-03-21 05:15:12 +00:00
|
|
|
case T_WKS:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
2001-07-02 07:11:40 +00:00
|
|
|
const guint8 *wks_addr;
|
2000-03-21 05:15:12 +00:00
|
|
|
guint8 protocol;
|
|
|
|
guint8 bits;
|
2000-03-21 06:21:37 +00:00
|
|
|
int mask;
|
2000-03-21 05:15:12 +00:00
|
|
|
int port_num;
|
|
|
|
int i;
|
2009-04-14 18:31:02 +00:00
|
|
|
emem_strbuf_t *bitnames = ep_strbuf_new_label(NULL);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4) {
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
goto bad_rr;
|
|
|
|
break;
|
|
|
|
}
|
2001-07-02 07:11:40 +00:00
|
|
|
wks_addr = tvb_get_ptr(tvb, cur_offset, 4);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", ip_to_str(wks_addr));
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", addr %s", ip_to_str(wks_addr));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Addr: %s",
|
|
|
|
ip_to_str(wks_addr));
|
2000-03-21 05:15:12 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
protocol = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Protocol: %s",
|
2000-03-21 05:15:12 +00:00
|
|
|
ipprotostr(protocol));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
port_num = 0;
|
|
|
|
while (rr_len != 0) {
|
2001-07-02 07:11:40 +00:00
|
|
|
bits = tvb_get_guint8(tvb, cur_offset);
|
2000-03-21 05:15:12 +00:00
|
|
|
if (bits != 0) {
|
2000-03-21 06:21:37 +00:00
|
|
|
mask = 1<<7;
|
2009-03-30 17:24:50 +00:00
|
|
|
ep_strbuf_truncate(bitnames, 0);
|
2000-03-21 06:21:37 +00:00
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
if (bits & mask) {
|
2009-03-30 17:24:50 +00:00
|
|
|
if (bitnames->len > 0) {
|
|
|
|
ep_strbuf_append(bitnames, ", ");
|
|
|
|
}
|
2000-03-21 05:15:12 +00:00
|
|
|
switch (protocol) {
|
|
|
|
|
|
|
|
case IP_PROTO_TCP:
|
2009-03-30 17:24:50 +00:00
|
|
|
ep_strbuf_append(bitnames, get_tcp_port(port_num));
|
2000-03-21 05:15:12 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case IP_PROTO_UDP:
|
2009-03-30 17:24:50 +00:00
|
|
|
ep_strbuf_append(bitnames, get_udp_port(port_num));
|
2000-03-21 05:15:12 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2009-03-30 17:24:50 +00:00
|
|
|
ep_strbuf_append_printf(bitnames, "%u", port_num);
|
2000-03-21 05:15:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-03-21 06:21:37 +00:00
|
|
|
mask >>= 1;
|
2000-03-21 05:15:12 +00:00
|
|
|
port_num++;
|
|
|
|
}
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1,
|
2009-03-30 17:24:50 +00:00
|
|
|
"Bits: 0x%02x (%s)", bits, bitnames->str);
|
2000-03-21 05:15:12 +00:00
|
|
|
} else
|
|
|
|
port_num += 8;
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-03-21 05:15:12 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-11-12 22:43:32 +00:00
|
|
|
case T_HINFO:
|
|
|
|
{
|
|
|
|
int cpu_offset;
|
|
|
|
int cpu_len;
|
2001-07-02 07:11:40 +00:00
|
|
|
const guint8 *cpu;
|
1999-11-12 22:43:32 +00:00
|
|
|
int os_offset;
|
|
|
|
int os_len;
|
2001-07-02 07:11:40 +00:00
|
|
|
const guint8 *os;
|
1999-11-12 22:43:32 +00:00
|
|
|
|
|
|
|
cpu_offset = cur_offset;
|
2001-07-02 07:11:40 +00:00
|
|
|
cpu_len = tvb_get_guint8(tvb, cpu_offset);
|
|
|
|
cpu = tvb_get_ptr(tvb, cpu_offset + 1, cpu_len);
|
1999-11-12 22:43:32 +00:00
|
|
|
os_offset = cpu_offset + 1 + cpu_len;
|
2001-07-02 07:11:40 +00:00
|
|
|
os_len = tvb_get_guint8(tvb, os_offset);
|
|
|
|
os = tvb_get_ptr(tvb, os_offset + 1, os_len);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %.*s %.*s", cpu_len, cpu,
|
2001-07-02 07:11:40 +00:00
|
|
|
os_len, os);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", CPU %.*s, OS %.*s",
|
2001-07-02 07:11:40 +00:00
|
|
|
cpu_len, cpu, os_len, os);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cpu_offset, 1 + cpu_len, "CPU: %.*s",
|
|
|
|
cpu_len, cpu);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, os_offset, 1 + os_len, "OS: %.*s",
|
|
|
|
os_len, os);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-11-12 22:43:32 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-09-21 07:15:38 +00:00
|
|
|
case T_MX:
|
|
|
|
{
|
1999-10-07 07:44:29 +00:00
|
|
|
guint16 preference = 0;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *mx_name;
|
1999-09-21 07:15:38 +00:00
|
|
|
int mx_name_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
preference = tvb_get_ntohs(tvb, cur_offset);
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
mx_name_len = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &mx_name);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(mx_name, strlen(mx_name));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %u %s", preference, name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", preference %u, mx %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
preference, name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Preference: %u", preference);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 2, mx_name_len, "Mail exchange: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-09-21 07:15:38 +00:00
|
|
|
}
|
|
|
|
break;
|
1999-11-27 07:46:44 +00:00
|
|
|
|
2000-03-21 05:15:12 +00:00
|
|
|
case T_TXT:
|
2009-07-31 16:37:53 +00:00
|
|
|
case T_SPF:
|
2000-03-21 05:15:12 +00:00
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
int txt_offset;
|
|
|
|
int txt_len;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-03-21 06:21:37 +00:00
|
|
|
txt_offset = cur_offset;
|
|
|
|
while (rr_len != 0) {
|
2001-07-02 07:11:40 +00:00
|
|
|
txt_len = tvb_get_guint8(tvb, txt_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, txt_offset, 1 + txt_len,
|
|
|
|
"Text: %.*s", txt_len, tvb_get_ptr(tvb, txt_offset + 1, txt_len));
|
2000-03-21 06:21:37 +00:00
|
|
|
txt_offset += 1 + txt_len;
|
|
|
|
rr_len -= 1 + txt_len;
|
2000-03-21 05:15:12 +00:00
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-03-21 05:15:12 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-01-23 00:51:47 +00:00
|
|
|
case T_RRSIG:
|
1999-11-27 08:59:28 +00:00
|
|
|
case T_SIG:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
2001-07-02 07:11:40 +00:00
|
|
|
guint16 type_covered;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime_t nstime;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *signer_name;
|
1999-11-27 08:59:28 +00:00
|
|
|
int signer_name_len;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
type_covered = tvb_get_ntohs(tvb, cur_offset);
|
2004-12-26 00:22:16 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Type covered: %s",
|
|
|
|
dns_type_description(type_covered));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s",
|
|
|
|
val_to_str(tvb_get_guint8(tvb, cur_offset), algo_vals,
|
1999-11-27 08:59:28 +00:00
|
|
|
"Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Labels: %u",
|
|
|
|
tvb_get_guint8(tvb, cur_offset));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Original TTL: %s",
|
|
|
|
time_secs_to_str(tvb_get_ntohl(tvb, cur_offset)));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime.secs = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
nstime.nsecs = 0;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Signature expiration: %s",
|
2001-09-14 07:10:13 +00:00
|
|
|
abs_time_to_str(&nstime));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime.secs = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
nstime.nsecs = 0;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Time signed: %s",
|
2001-09-14 07:10:13 +00:00
|
|
|
abs_time_to_str(&nstime));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2003-12-10 19:35:03 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Id of signing key(footprint): %u",
|
2001-07-02 07:11:40 +00:00
|
|
|
tvb_get_ntohs(tvb, cur_offset));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
signer_name_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &signer_name);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, signer_name_len,
|
2005-06-27 07:50:11 +00:00
|
|
|
"Signer's name: %s",
|
2007-03-28 21:55:11 +00:00
|
|
|
format_text(signer_name, strlen(signer_name)));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += signer_name_len;
|
|
|
|
rr_len -= signer_name_len;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len != 0)
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rr_len, "Signature");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-11-27 08:59:28 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-03-30 19:39:01 +00:00
|
|
|
case T_DNSKEY:
|
2008-09-29 21:40:53 +00:00
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
guint16 flags;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *flags_tree;
|
|
|
|
guint8 algo;
|
|
|
|
guint16 key_id;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2008-09-29 21:40:53 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
|
|
|
flags = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
tf = proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Flags: 0x%04X", flags);
|
|
|
|
flags_tree = proto_item_add_subtree(tf, ett_t_key_flags);
|
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
|
|
|
decode_boolean_bitfield(flags, 0x0100,
|
|
|
|
2*8, "This is the zone key for the specified zone",
|
|
|
|
"This is not a zone key"));
|
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
2009-03-30 19:39:01 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x0080,
|
2008-09-29 21:40:53 +00:00
|
|
|
2*8, "Key is revoked",
|
|
|
|
"Key is not revoked"));
|
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
2009-03-30 19:39:01 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x0001,
|
2008-09-29 21:40:53 +00:00
|
|
|
2*8, "Key is a Key Signing Key",
|
|
|
|
"Key is a Zone Signing Key"));
|
2009-03-30 19:39:01 +00:00
|
|
|
|
2008-09-29 21:40:53 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Protocol: %u",
|
|
|
|
tvb_get_guint8(tvb, cur_offset));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
algo = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s",
|
|
|
|
val_to_str(algo, algo_vals, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
key_id = compute_key_id(tvb, cur_offset-4, rr_len+4, algo);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, 0, 0, "Key id: %u", key_id);
|
|
|
|
|
|
|
|
if (rr_len != 0)
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rr_len, "Public key");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2008-09-29 21:40:53 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-11-27 08:59:28 +00:00
|
|
|
case T_KEY:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
guint16 flags;
|
|
|
|
proto_item *tf;
|
|
|
|
proto_tree *flags_tree;
|
2003-12-10 19:35:03 +00:00
|
|
|
guint8 algo;
|
2004-01-20 00:11:59 +00:00
|
|
|
guint16 key_id;
|
1999-11-27 08:59:28 +00:00
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
flags = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
tf = proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Flags: 0x%04X", flags);
|
1999-11-27 08:59:28 +00:00
|
|
|
flags_tree = proto_item_add_subtree(tf, ett_t_key_flags);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x8000,
|
|
|
|
2*8, "Key prohibited for authentication",
|
|
|
|
"Key allowed for authentication"));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x4000,
|
|
|
|
2*8, "Key prohibited for confidentiality",
|
|
|
|
"Key allowed for confidentiality"));
|
|
|
|
if ((flags & 0xC000) != 0xC000) {
|
|
|
|
/* We have a key */
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x2000,
|
|
|
|
2*8, "Key is experimental or optional",
|
|
|
|
"Key is required"));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x0400,
|
|
|
|
2*8, "Key is associated with a user",
|
|
|
|
"Key is not associated with a user"));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x0200,
|
|
|
|
2*8, "Key is associated with the named entity",
|
|
|
|
"Key is not associated with the named entity"));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x0080,
|
|
|
|
2*8, "Key is valid for use with IPSEC",
|
|
|
|
"Key is not valid for use with IPSEC"));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
1999-11-27 08:59:28 +00:00
|
|
|
decode_boolean_bitfield(flags, 0x0040,
|
|
|
|
2*8, "Key is valid for use with MIME security multiparts",
|
|
|
|
"Key is not valid for use with MIME security multiparts"));
|
2008-09-29 21:40:53 +00:00
|
|
|
proto_tree_add_text(flags_tree, tvb, cur_offset, 2, "%s",
|
|
|
|
decode_numeric_bitfield(flags, 0x000F,
|
|
|
|
2*8, "Signatory = %u"));
|
1999-11-27 08:59:28 +00:00
|
|
|
}
|
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Protocol: %u",
|
|
|
|
tvb_get_guint8(tvb, cur_offset));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2003-12-10 19:35:03 +00:00
|
|
|
algo = tvb_get_guint8(tvb, cur_offset);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s",
|
2003-12-10 19:35:03 +00:00
|
|
|
val_to_str(algo, algo_vals, "Unknown (0x%02X)"));
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += 1;
|
2003-12-11 18:38:57 +00:00
|
|
|
rr_len -= 1;
|
1999-11-27 08:59:28 +00:00
|
|
|
|
2003-12-10 19:35:03 +00:00
|
|
|
key_id = compute_key_id(tvb, cur_offset-4, rr_len+4, algo);
|
2004-01-20 00:11:59 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, 0, 0, "Key id: %u", key_id);
|
2003-12-12 23:23:57 +00:00
|
|
|
|
|
|
|
if (rr_len != 0)
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rr_len, "Public key");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-11-27 08:59:28 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-09-28 10:28:01 +00:00
|
|
|
case T_IPSECKEY:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
guint8 gw_type, algo;
|
|
|
|
const guint8 *addr;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *gw;
|
2004-09-28 10:28:01 +00:00
|
|
|
int gw_name_len;
|
|
|
|
static const value_string gw_algo[] = {
|
|
|
|
{ 1, "DSA" },
|
|
|
|
{ 2, "RSA" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2009-03-30 19:39:01 +00:00
|
|
|
|
2004-09-28 10:28:01 +00:00
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-03-30 19:39:01 +00:00
|
|
|
if(rr_len < 3)
|
2004-09-28 10:28:01 +00:00
|
|
|
goto bad_rr;
|
|
|
|
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Gateway precedence: %u",
|
|
|
|
tvb_get_guint8(tvb, cur_offset));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
gw_type = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
algo = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s",
|
|
|
|
val_to_str(algo, gw_algo, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
switch( gw_type ) {
|
|
|
|
case 0:
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 0, "Gateway: no gateway");
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
addr = tvb_get_ptr(tvb, cur_offset, 4);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Gateway: %s",
|
|
|
|
ip_to_str(addr) );
|
|
|
|
|
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
addr = tvb_get_ptr(tvb, cur_offset, 16);
|
2009-03-30 19:39:01 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 16, "Gateway: %s",
|
2004-09-28 10:28:01 +00:00
|
|
|
ip6_to_str((const struct e_in6_addr *)addr));
|
|
|
|
|
|
|
|
cur_offset += 16;
|
|
|
|
rr_len -= 16;
|
|
|
|
break;
|
|
|
|
case 3:
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
gw_name_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &gw);
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, gw_name_len,
|
2007-03-28 21:55:11 +00:00
|
|
|
"Gateway: %s", format_text(gw, strlen(gw)));
|
2004-09-28 10:28:01 +00:00
|
|
|
|
|
|
|
cur_offset += gw_name_len;
|
2009-03-30 19:39:01 +00:00
|
|
|
rr_len -= gw_name_len;
|
2004-09-28 10:28:01 +00:00
|
|
|
break;
|
|
|
|
default:
|
2008-12-18 19:08:49 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 0, "Gateway: Unknown gateway type(%u)", gw_type);
|
2004-09-28 10:28:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (rr_len != 0)
|
2009-03-30 19:39:01 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rr_len, "Public key");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2004-09-28 10:28:01 +00:00
|
|
|
}
|
|
|
|
break;
|
1999-11-27 08:59:28 +00:00
|
|
|
|
1999-11-27 07:46:44 +00:00
|
|
|
case T_AAAA:
|
2001-07-02 07:11:40 +00:00
|
|
|
{
|
|
|
|
const guint8 *addr6;
|
2004-11-17 10:03:14 +00:00
|
|
|
struct e_in6_addr addr_in6;
|
2001-07-02 07:11:40 +00:00
|
|
|
|
|
|
|
addr6 = tvb_get_ptr(tvb, cur_offset, 16);
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL) {
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s",
|
2002-12-02 20:03:10 +00:00
|
|
|
ip6_to_str((const struct e_in6_addr *)addr6));
|
2000-03-21 06:21:37 +00:00
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", addr %s",
|
2002-12-02 20:03:10 +00:00
|
|
|
ip6_to_str((const struct e_in6_addr *)addr6));
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 16, "Addr: %s",
|
2002-12-02 20:03:10 +00:00
|
|
|
ip6_to_str((const struct e_in6_addr *)addr6));
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2004-11-17 10:03:14 +00:00
|
|
|
if ((class & 0x7f) == C_IN) {
|
|
|
|
memcpy(&addr_in6, addr6, sizeof(addr_in6));
|
|
|
|
add_ipv6_name(&addr_in6, name);
|
|
|
|
}
|
1999-11-27 07:46:44 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-10-02 17:42:38 +00:00
|
|
|
case T_A6:
|
|
|
|
{
|
|
|
|
unsigned short pre_len;
|
|
|
|
unsigned short suf_len;
|
|
|
|
unsigned short suf_octet_count;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *pname;
|
2001-07-02 07:11:40 +00:00
|
|
|
int pname_len;
|
2000-10-02 17:42:38 +00:00
|
|
|
int a6_offset;
|
|
|
|
int suf_offset;
|
2003-10-05 21:57:36 +00:00
|
|
|
struct e_in6_addr suffix;
|
2000-10-02 17:42:38 +00:00
|
|
|
|
|
|
|
a6_offset = cur_offset;
|
2001-07-02 07:11:40 +00:00
|
|
|
pre_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
cur_offset++;
|
2000-10-02 17:42:38 +00:00
|
|
|
suf_len = 128 - pre_len;
|
2000-10-18 00:37:54 +00:00
|
|
|
suf_octet_count = suf_len ? (suf_len - 1) / 8 + 1 : 0;
|
2000-10-02 17:42:38 +00:00
|
|
|
/* Pad prefix */
|
|
|
|
for (suf_offset = 0; suf_offset < 16 - suf_octet_count; suf_offset++) {
|
2005-09-12 06:21:35 +00:00
|
|
|
suffix.bytes[suf_offset] = 0;
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
|
|
|
for (; suf_offset < 16; suf_offset++) {
|
2005-09-12 06:21:35 +00:00
|
|
|
suffix.bytes[suf_offset] = tvb_get_guint8(tvb, cur_offset);
|
2001-07-02 07:11:40 +00:00
|
|
|
cur_offset++;
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
|
|
|
|
2000-10-18 00:37:54 +00:00
|
|
|
if (pre_len > 0) {
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
pname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
|
2005-10-08 12:31:06 +00:00
|
|
|
&pname);
|
2000-10-18 00:37:54 +00:00
|
|
|
} else {
|
2005-10-08 12:31:06 +00:00
|
|
|
pname="";
|
2001-07-02 07:11:40 +00:00
|
|
|
pname_len = 0;
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(pname, strlen(pname));
|
2000-10-02 17:42:38 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL) {
|
2002-08-28 21:04:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %d %s %s",
|
|
|
|
pre_len,
|
2003-10-05 21:57:36 +00:00
|
|
|
ip6_to_str(&suffix),
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, a6_offset, 1,
|
2000-10-02 17:42:38 +00:00
|
|
|
"Prefix len: %u", pre_len);
|
|
|
|
a6_offset++;
|
2000-10-18 00:37:54 +00:00
|
|
|
if (suf_len) {
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, a6_offset, suf_octet_count,
|
2002-08-28 21:04:11 +00:00
|
|
|
"Address suffix: %s",
|
2003-10-05 21:57:36 +00:00
|
|
|
ip6_to_str(&suffix));
|
2000-10-18 00:37:54 +00:00
|
|
|
a6_offset += suf_octet_count;
|
|
|
|
}
|
|
|
|
if (pre_len > 0) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, a6_offset, pname_len,
|
2005-06-27 07:50:11 +00:00
|
|
|
"Prefix name: %s", name_out);
|
2000-10-18 00:37:54 +00:00
|
|
|
}
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", addr %d %s %s",
|
2002-08-28 21:04:11 +00:00
|
|
|
pre_len,
|
2003-10-05 21:57:36 +00:00
|
|
|
ip6_to_str(&suffix),
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_DNAME:
|
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *dname;
|
2000-10-02 17:42:38 +00:00
|
|
|
int dname_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
dname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
|
2005-10-08 12:31:06 +00:00
|
|
|
&dname);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(dname, strlen(dname));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", dname %s", name_out);
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset,
|
2005-06-27 07:50:11 +00:00
|
|
|
dname_len, "Target name: %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-10-02 17:42:38 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-09-21 07:15:38 +00:00
|
|
|
case T_LOC:
|
|
|
|
{
|
2001-07-02 07:11:40 +00:00
|
|
|
guint8 version;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
version = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Version: %u", version);
|
|
|
|
if (version == 0) {
|
1999-11-07 21:00:40 +00:00
|
|
|
/* Version 0, the only version RFC 1876 discusses. */
|
|
|
|
cur_offset++;
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Size: %g m",
|
|
|
|
rfc1867_size(tvb, cur_offset));
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset++;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Horizontal precision: %g m",
|
|
|
|
rfc1867_size(tvb, cur_offset));
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset++;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Vertical precision: %g m",
|
|
|
|
rfc1867_size(tvb, cur_offset));
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset++;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Latitude: %s",
|
|
|
|
rfc1867_angle(tvb, cur_offset, "NS"));
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Longitude: %s",
|
|
|
|
rfc1867_angle(tvb, cur_offset, "EW"));
|
1999-11-07 21:00:40 +00:00
|
|
|
cur_offset += 4;
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Altitude: %g m",
|
2006-02-21 08:14:11 +00:00
|
|
|
((gint32)tvb_get_ntohl(tvb, cur_offset) - 10000000)/100.0);
|
1999-11-07 21:00:40 +00:00
|
|
|
} else
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, data_len, "Data");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-09-21 07:15:38 +00:00
|
|
|
}
|
|
|
|
break;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2004-01-23 00:51:47 +00:00
|
|
|
case T_NSEC:
|
2004-01-23 19:16:52 +00:00
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *next_domain_name;
|
2004-01-23 19:16:52 +00:00
|
|
|
int next_domain_name_len;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
next_domain_name_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
|
2005-10-08 12:31:06 +00:00
|
|
|
&next_domain_name);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(next_domain_name, strlen(next_domain_name));
|
2004-01-23 19:16:52 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", next domain name %s", name_out);
|
2004-01-23 19:16:52 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, next_domain_name_len,
|
2005-06-27 07:50:11 +00:00
|
|
|
"Next domain name: %s", name_out);
|
2004-01-23 19:16:52 +00:00
|
|
|
cur_offset += next_domain_name_len;
|
|
|
|
rr_len -= next_domain_name_len;
|
2008-12-18 19:01:08 +00:00
|
|
|
cur_offset += dissect_type_bitmap(rr_tree, tvb, cur_offset, rr_len);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2008-12-18 19:01:08 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_NSEC3:
|
|
|
|
{
|
|
|
|
int rr_len, initial_offset = cur_offset;
|
|
|
|
guint8 salt_len, hash_len;
|
|
|
|
proto_item *flags_item;
|
|
|
|
proto_tree *flags_tree;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2008-12-18 19:01:08 +00:00
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_algo, tvb, cur_offset++, 1, FALSE);
|
|
|
|
flags_item = proto_tree_add_item(rr_tree, hf_dns_nsec3_flags, tvb, cur_offset, 1, FALSE);
|
|
|
|
flags_tree = proto_item_add_subtree(flags_item, ett_nsec3_flags);
|
|
|
|
proto_tree_add_item(flags_tree, hf_dns_nsec3_flag_optout, tvb, cur_offset, 1, FALSE);
|
|
|
|
cur_offset++;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_iterations, tvb, cur_offset, 2, FALSE);
|
|
|
|
cur_offset += 2;
|
|
|
|
salt_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_salt_length, tvb, cur_offset++, 1, FALSE);
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_salt_value, tvb, cur_offset, salt_len, FALSE);
|
|
|
|
cur_offset += salt_len;
|
|
|
|
hash_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_hash_length, tvb, cur_offset++, 1, FALSE);
|
2009-03-30 19:39:01 +00:00
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_hash_value, tvb, cur_offset, hash_len, FALSE);
|
2008-12-18 19:01:08 +00:00
|
|
|
cur_offset += hash_len;
|
|
|
|
rr_len = data_len - (cur_offset - initial_offset);
|
|
|
|
cur_offset += dissect_type_bitmap(rr_tree, tvb, cur_offset, rr_len);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_NSEC3PARAM:
|
|
|
|
{
|
|
|
|
int salt_len;
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
|
|
|
|
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_algo, tvb, cur_offset, 1, FALSE);
|
|
|
|
cur_offset ++;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_flags, tvb, cur_offset, 1, FALSE);
|
|
|
|
cur_offset ++;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_iterations, tvb, cur_offset, 2, FALSE);
|
|
|
|
cur_offset += 2;
|
|
|
|
salt_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_salt_length, tvb, cur_offset, 1, FALSE);
|
|
|
|
cur_offset ++;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsec3_salt_value, tvb, cur_offset, salt_len, FALSE);
|
|
|
|
|
2004-01-23 19:16:52 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-11-27 08:59:28 +00:00
|
|
|
case T_NXT:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *next_domain_name;
|
1999-11-27 08:59:28 +00:00
|
|
|
int next_domain_name_len;
|
|
|
|
int rr_type;
|
|
|
|
guint8 bits;
|
|
|
|
int mask;
|
|
|
|
int i;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
next_domain_name_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset,
|
2005-10-08 12:31:06 +00:00
|
|
|
&next_domain_name);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(next_domain_name, strlen(next_domain_name));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2005-06-27 07:50:11 +00:00
|
|
|
proto_item_append_text(trr, ", next domain name %s", name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, next_domain_name_len,
|
2005-06-27 07:50:11 +00:00
|
|
|
"Next domain name: %s", name_out);
|
1999-11-27 08:59:28 +00:00
|
|
|
cur_offset += next_domain_name_len;
|
|
|
|
rr_len -= next_domain_name_len;
|
|
|
|
rr_type = 0;
|
|
|
|
while (rr_len != 0) {
|
2001-07-02 07:11:40 +00:00
|
|
|
bits = tvb_get_guint8(tvb, cur_offset);
|
2000-03-21 06:21:37 +00:00
|
|
|
mask = 1<<7;
|
1999-11-27 08:59:28 +00:00
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
if (bits & mask) {
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1,
|
2004-12-26 00:22:16 +00:00
|
|
|
"RR type in bit map: %s",
|
|
|
|
dns_type_description(rr_type));
|
1999-11-27 08:59:28 +00:00
|
|
|
}
|
|
|
|
mask >>= 1;
|
|
|
|
rr_type++;
|
|
|
|
}
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
1999-11-27 08:59:28 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
case T_KX:
|
|
|
|
{
|
|
|
|
guint16 preference = 0;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *kx_name;
|
2000-10-11 04:12:06 +00:00
|
|
|
int kx_name_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
kx_name_len = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &kx_name);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(kx_name, strlen(kx_name));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %u %s", preference, name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr, ", preference %u, kx %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
preference, name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Preference: %u", preference);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 2, kx_name_len, "Key exchange: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_CERT:
|
|
|
|
{
|
|
|
|
guint16 cert_type, cert_keytag;
|
|
|
|
guint8 cert_keyalg;
|
|
|
|
int rr_len = data_len;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
|
|
|
cert_type = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Type: %s",
|
|
|
|
val_to_str(cert_type, cert_vals,
|
2000-10-11 04:12:06 +00:00
|
|
|
"Unknown (0x%02X)"));
|
2003-12-12 23:23:57 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
|
|
|
cert_keytag = tvb_get_ntohs(tvb, cur_offset);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Key footprint: 0x%04x",
|
2000-10-11 04:12:06 +00:00
|
|
|
cert_keytag);
|
2003-12-12 23:23:57 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
cert_keyalg = tvb_get_guint8(tvb, cur_offset);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s",
|
2000-10-11 04:12:06 +00:00
|
|
|
val_to_str(cert_keyalg, algo_vals,
|
|
|
|
"Unknown (0x%02X)"));
|
2003-12-12 23:23:57 +00:00
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len != 0)
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rr_len, "Public key");
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
break;
|
|
|
|
|
2000-03-30 01:33:10 +00:00
|
|
|
case T_OPT:
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, data_len, "Data");
|
2000-03-30 01:33:10 +00:00
|
|
|
break;
|
|
|
|
|
2003-11-26 23:23:37 +00:00
|
|
|
case T_DS:
|
2009-07-29 07:10:02 +00:00
|
|
|
case T_DLV:
|
2003-11-26 23:23:37 +00:00
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
guint16 keytag, digest_data_size;
|
2003-11-26 23:23:37 +00:00
|
|
|
guint8 ds_algorithm, ds_digest;
|
|
|
|
int rr_len = data_len;
|
|
|
|
|
|
|
|
static const value_string tds_digests[] = {
|
|
|
|
{ TDSDIGEST_RESERVED, "Reserved digest" },
|
|
|
|
{ TDSDIGEST_SHA1, "SHA-1" },
|
2009-07-29 07:10:02 +00:00
|
|
|
{ TDSDIGEST_SHA256, "SHA-256" },
|
2003-11-26 23:23:37 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2003-11-26 23:23:37 +00:00
|
|
|
keytag = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Key id: %04u", keytag);
|
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2003-11-26 23:23:37 +00:00
|
|
|
ds_algorithm = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s", val_to_str(ds_algorithm, algo_vals,"Unknown (0x%02X)") );
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
2003-11-26 23:23:37 +00:00
|
|
|
ds_digest = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Digest type: %s", val_to_str(ds_digest, tds_digests, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
2003-12-12 23:23:57 +00:00
|
|
|
|
2009-03-23 12:41:56 +00:00
|
|
|
if (ds_digest == TDSDIGEST_SHA1) {
|
2003-12-12 23:23:57 +00:00
|
|
|
digest_data_size = 20; /* SHA1 key is always 20 bytes long */
|
|
|
|
if (rr_len < digest_data_size)
|
|
|
|
goto bad_rr;
|
2009-03-30 19:39:01 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, digest_data_size, "Public key");
|
2003-12-12 23:23:57 +00:00
|
|
|
}
|
2009-07-29 07:10:02 +00:00
|
|
|
|
|
|
|
if (ds_digest == TDSDIGEST_SHA256) {
|
|
|
|
digest_data_size = 32; /* SHA256 key is always 32 bytes long */
|
|
|
|
if (rr_len < digest_data_size)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, digest_data_size, "Public key");
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-11-26 23:23:37 +00:00
|
|
|
}
|
|
|
|
break;
|
2003-12-12 23:23:57 +00:00
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
case T_TKEY:
|
|
|
|
{
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *tkey_algname;
|
2000-10-11 04:12:06 +00:00
|
|
|
int tkey_algname_len;
|
|
|
|
guint16 tkey_mode, tkey_error, tkey_keylen, tkey_otherlen;
|
|
|
|
int rr_len = data_len;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime_t nstime;
|
2000-10-11 04:12:06 +00:00
|
|
|
static const value_string tkey_modes[] = {
|
|
|
|
{ TKEYMODE_SERVERASSIGNED, "Server assigned" },
|
|
|
|
{ TKEYMODE_DIFFIEHELLMAN, "Diffie Hellman" },
|
2001-08-29 00:51:10 +00:00
|
|
|
{ TKEYMODE_GSSAPI, "GSSAPI" },
|
2000-10-11 04:12:06 +00:00
|
|
|
{ TKEYMODE_RESOLVERASSIGNED, "Resolver assigned" },
|
|
|
|
{ TKEYMODE_DELETE, "Delete" },
|
|
|
|
{ 0, NULL } };
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-01-26 01:00:05 +00:00
|
|
|
proto_tree *key_tree;
|
|
|
|
proto_item *key_item;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
tkey_algname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &tkey_algname);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, tkey_algname_len,
|
2005-06-27 07:50:11 +00:00
|
|
|
"Algorithm name: %s",
|
2007-03-28 21:55:11 +00:00
|
|
|
format_text(tkey_algname, strlen(tkey_algname)));
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += tkey_algname_len;
|
|
|
|
rr_len -= tkey_algname_len;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime.secs = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
nstime.nsecs = 0;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Signature inception: %s",
|
2001-09-14 07:10:13 +00:00
|
|
|
abs_time_to_str(&nstime));
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime.secs = tvb_get_ntohl(tvb, cur_offset);
|
|
|
|
nstime.nsecs = 0;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Signature expiration: %s",
|
2001-09-14 07:10:13 +00:00
|
|
|
abs_time_to_str(&nstime));
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tkey_mode = tvb_get_ntohs(tvb, cur_offset);
|
2003-01-31 06:58:31 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Mode: %s",
|
2000-10-11 04:12:06 +00:00
|
|
|
val_to_str(tkey_mode, tkey_modes,
|
2003-01-31 06:58:31 +00:00
|
|
|
"Unknown (0x%04X)"));
|
2004-11-22 08:23:00 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tkey_error = tvb_get_ntohs(tvb, cur_offset);
|
2003-01-31 06:58:31 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Error: %s",
|
2000-10-11 04:12:06 +00:00
|
|
|
val_to_str(tkey_error, rcode_vals,
|
|
|
|
val_to_str(tkey_error, tsigerror_vals, "Unknown error (%x)")));
|
2004-11-22 08:23:00 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
tkey_keylen = tvb_get_ntohs(tvb, cur_offset);
|
2003-12-17 08:40:56 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Key Size: %u",
|
2003-12-17 08:34:07 +00:00
|
|
|
tkey_keylen);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-17 22:30:42 +00:00
|
|
|
if (tkey_keylen != 0) {
|
|
|
|
key_item = proto_tree_add_text(
|
|
|
|
rr_tree, tvb, cur_offset, tkey_keylen, "Key Data");
|
|
|
|
|
|
|
|
key_tree = proto_item_add_subtree(key_item, ett_t_key);
|
|
|
|
|
|
|
|
switch(tkey_mode) {
|
|
|
|
case TKEYMODE_GSSAPI: {
|
|
|
|
tvbuff_t *gssapi_tvb;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX - in at least one capture, this appears to
|
|
|
|
* be an NTLMSSP blob, with no ASN.1 in it, in
|
|
|
|
* a query.
|
|
|
|
*
|
|
|
|
* See RFC 3645 which might indicate what's going
|
|
|
|
* on here. (The key is an output_token from
|
|
|
|
* GSS_Init_sec_context.)
|
|
|
|
*
|
|
|
|
* How the heck do we know what method is being
|
|
|
|
* used, so we know how to decode the key? Do we
|
|
|
|
* have to look at the algorithm name, e.g.
|
2004-11-22 08:23:00 +00:00
|
|
|
* "gss.microsoft.com"? We currently do as the
|
|
|
|
* the SMB dissector does in some cases, and check
|
|
|
|
* whether the security blob begins with "NTLMSSP".
|
2003-12-17 22:30:42 +00:00
|
|
|
*/
|
|
|
|
gssapi_tvb = tvb_new_subset(
|
|
|
|
tvb, cur_offset, tkey_keylen, tkey_keylen);
|
2004-11-21 21:23:30 +00:00
|
|
|
if(tvb_strneql(gssapi_tvb, 0, "NTLMSSP", 7) == 0)
|
|
|
|
call_dissector(ntlmssp_handle, gssapi_tvb, pinfo, key_tree);
|
|
|
|
else
|
|
|
|
call_dissector(gssapi_handle, gssapi_tvb, pinfo,
|
2003-12-17 22:30:42 +00:00
|
|
|
key_tree);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2003-01-26 01:00:05 +00:00
|
|
|
|
2003-12-17 22:30:42 +00:00
|
|
|
/* No dissector for this key mode */
|
2003-01-26 01:00:05 +00:00
|
|
|
|
2003-12-17 22:30:42 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-01-26 01:00:05 +00:00
|
|
|
|
2003-12-17 22:30:42 +00:00
|
|
|
cur_offset += tkey_keylen;
|
|
|
|
rr_len -= tkey_keylen;
|
|
|
|
}
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tkey_otherlen = tvb_get_ntohs(tvb, cur_offset);
|
2003-12-17 08:40:56 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Other Size: %u",
|
2003-12-17 08:34:07 +00:00
|
|
|
tkey_otherlen);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (tkey_otherlen != 0) {
|
|
|
|
if (rr_len < tkey_otherlen)
|
|
|
|
goto bad_rr;
|
2003-12-17 08:40:56 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, tkey_otherlen, "Other Data");
|
2003-12-12 23:23:57 +00:00
|
|
|
cur_offset += tkey_otherlen;
|
|
|
|
rr_len -= tkey_otherlen;
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_TSIG:
|
|
|
|
{
|
2005-12-25 12:03:18 +00:00
|
|
|
guint16 tsig_error, tsig_timehi, tsig_siglen, tsig_otherlen;
|
2000-10-11 04:12:06 +00:00
|
|
|
guint32 tsig_timelo;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *tsig_raw_algname;
|
2007-04-23 10:59:26 +00:00
|
|
|
char *tsig_algname;
|
2000-10-11 04:12:06 +00:00
|
|
|
int tsig_algname_len;
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime_t nstime;
|
2000-10-11 04:12:06 +00:00
|
|
|
int rr_len = data_len;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
tsig_algname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &tsig_raw_algname);
|
2007-03-28 21:55:11 +00:00
|
|
|
tsig_algname=format_text(tsig_raw_algname, strlen(tsig_raw_algname));
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_tree_add_string(rr_tree, hf_dns_tsig_algorithm_name, tvb, cur_offset, tsig_algname_len, tsig_algname);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += tsig_algname_len;
|
|
|
|
rr_len -= tsig_algname_len;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 6)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tsig_timehi = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
tsig_timelo = tvb_get_ntohl(tvb, cur_offset + 2);
|
2001-09-14 07:10:13 +00:00
|
|
|
nstime.secs = tsig_timelo;
|
|
|
|
nstime.nsecs = 0;
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 6, "Time signed: %s%s",
|
2001-09-14 07:10:13 +00:00
|
|
|
abs_time_to_str(&nstime), tsig_timehi == 0 ? "" : "(high bits set)");
|
2001-02-20 07:17:20 +00:00
|
|
|
cur_offset += 6;
|
|
|
|
rr_len -= 6;
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2005-12-25 12:03:18 +00:00
|
|
|
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_tsig_fudge, tvb, cur_offset, 2, FALSE);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tsig_siglen = tvb_get_ntohs(tvb, cur_offset);
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_tree_add_item(rr_tree, hf_dns_tsig_mac_size, tvb, cur_offset, 2, FALSE);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (tsig_siglen != 0) {
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_item *mac_item;
|
|
|
|
proto_tree *mac_tree;
|
|
|
|
tvbuff_t *sub_tvb;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < tsig_siglen)
|
|
|
|
goto bad_rr;
|
2005-12-25 12:03:18 +00:00
|
|
|
|
|
|
|
mac_item = proto_tree_add_item(rr_tree, hf_dns_tsig_mac, tvb, cur_offset, tsig_siglen, FALSE);
|
|
|
|
mac_tree = proto_item_add_subtree(mac_item, ett_dns_mac);
|
|
|
|
|
|
|
|
sub_tvb=tvb_new_subset(tvb, cur_offset, tsig_siglen, tsig_siglen);
|
|
|
|
|
|
|
|
if(!dissector_try_string(dns_tsig_dissector_table, tsig_algname, sub_tvb, pinfo, mac_tree)){
|
|
|
|
proto_tree_add_text(mac_tree, sub_tvb, 0, tvb_length(sub_tvb), "No dissector for algorithm:%s", tsig_algname);
|
|
|
|
}
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
cur_offset += tsig_siglen;
|
|
|
|
rr_len -= tsig_siglen;
|
|
|
|
}
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_tree_add_item(rr_tree, hf_dns_tsig_original_id, tvb, cur_offset, 2, FALSE);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tsig_error = tvb_get_ntohs(tvb, cur_offset);
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_tree_add_uint_format(rr_tree, hf_dns_tsig_error, tvb, cur_offset, 2, tsig_error, "Error: %s (%d)",
|
|
|
|
val_to_str(tsig_error, rcode_vals,val_to_str(tsig_error, tsigerror_vals, "Unknown error")),
|
|
|
|
tsig_error);
|
2001-02-20 07:17:20 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
2000-10-11 04:12:06 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 2)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
tsig_otherlen = tvb_get_ntohs(tvb, cur_offset);
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_tree_add_item(rr_tree, hf_dns_tsig_other_len, tvb, cur_offset, 2, FALSE);
|
2000-10-11 04:12:06 +00:00
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (tsig_otherlen != 0) {
|
|
|
|
if (rr_len < tsig_otherlen)
|
|
|
|
goto bad_rr;
|
2005-12-25 12:03:18 +00:00
|
|
|
proto_tree_add_item(rr_tree, hf_dns_tsig_other_data, tvb, cur_offset, tsig_otherlen, FALSE);
|
2003-12-12 23:23:57 +00:00
|
|
|
cur_offset += tsig_otherlen;
|
|
|
|
rr_len -= tsig_otherlen;
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
case T_WINS:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
guint32 local_flag;
|
|
|
|
guint32 lookup_timeout;
|
|
|
|
guint32 cache_timeout;
|
|
|
|
guint32 nservers;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
local_flag = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Local flag: %s",
|
2000-07-21 01:29:04 +00:00
|
|
|
local_flag ? "true" : "false");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
lookup_timeout = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Lookup timeout: %u seconds",
|
2000-07-21 01:29:04 +00:00
|
|
|
lookup_timeout);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
cache_timeout = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Cache timeout: %u seconds",
|
2000-07-21 01:29:04 +00:00
|
|
|
cache_timeout);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
nservers = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Number of WINS servers: %u",
|
2000-07-21 01:29:04 +00:00
|
|
|
nservers);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
|
|
|
while (rr_len != 0 && nservers != 0) {
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "WINS server address: %s",
|
|
|
|
ip_to_str(tvb_get_ptr(tvb, cur_offset, 4)));
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
nservers--;
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_WINS_R:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
guint32 local_flag;
|
|
|
|
guint32 lookup_timeout;
|
|
|
|
guint32 cache_timeout;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *dname;
|
2000-07-21 01:29:04 +00:00
|
|
|
int dname_len;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
local_flag = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Local flag: %s",
|
2000-07-21 01:29:04 +00:00
|
|
|
local_flag ? "true" : "false");
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
lookup_timeout = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Lookup timeout: %u seconds",
|
2000-07-21 01:29:04 +00:00
|
|
|
lookup_timeout);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
if (rr_len < 4)
|
|
|
|
goto bad_rr;
|
2001-07-02 07:11:40 +00:00
|
|
|
cache_timeout = tvb_get_ntohl(tvb, cur_offset);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 4, "Cache timeout: %u seconds",
|
2000-07-21 01:29:04 +00:00
|
|
|
cache_timeout);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2000-07-21 01:29:04 +00:00
|
|
|
cur_offset += 4;
|
|
|
|
rr_len -= 4;
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
dname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &dname);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(dname, strlen(dname));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name_out);
|
|
|
|
proto_item_append_text(trr, ", name result domain %s", name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, dname_len, "Name result domain: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
2000-07-21 01:29:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2001-02-20 16:25:52 +00:00
|
|
|
case T_SRV:
|
|
|
|
{
|
|
|
|
guint16 priority = 0;
|
|
|
|
guint16 weight = 0;
|
|
|
|
guint16 port = 0;
|
2009-03-23 12:41:56 +00:00
|
|
|
const guchar *target;
|
2001-02-20 16:25:52 +00:00
|
|
|
int target_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
priority = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
weight = tvb_get_ntohs(tvb, cur_offset+2);
|
|
|
|
port = tvb_get_ntohs(tvb, cur_offset+4);
|
|
|
|
|
2008-08-11 12:00:27 +00:00
|
|
|
/* XXX Fix data length */
|
|
|
|
target_len = get_dns_name(tvb, cur_offset + 6, 0, dns_data_offset, &target);
|
2007-03-28 21:55:11 +00:00
|
|
|
name_out = format_text(target, strlen(target));
|
2001-12-10 00:26:21 +00:00
|
|
|
if (cinfo != NULL)
|
2005-06-27 07:50:11 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %u %u %u %s", priority, weight, port, name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-08-29 00:51:10 +00:00
|
|
|
proto_item_append_text(trr,
|
|
|
|
", priority %u, weight %u, port %u, target %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
priority, weight, port, name_out);
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Priority: %u", priority);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 2, 2, "Weight: %u", weight);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 4, 2, "Port: %u", port);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 6, target_len, "Target: %s",
|
2005-06-27 07:50:11 +00:00
|
|
|
name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-02-20 16:25:52 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2006-12-31 00:00:06 +00:00
|
|
|
case T_NAPTR:
|
|
|
|
{
|
|
|
|
int offset = cur_offset;
|
|
|
|
guint16 order;
|
|
|
|
guint16 preference;
|
|
|
|
gchar *flags;
|
|
|
|
guint8 flags_len;
|
|
|
|
guchar *service;
|
|
|
|
guint8 service_len;
|
|
|
|
guchar *regex;
|
|
|
|
guint8 regex_len;
|
2009-07-31 06:51:27 +00:00
|
|
|
const guchar *replacement;
|
|
|
|
int replacement_len;
|
2006-12-31 00:00:06 +00:00
|
|
|
|
|
|
|
order = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
preference = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
|
|
|
flags_len = tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
2007-03-28 21:55:11 +00:00
|
|
|
flags = tvb_get_ephemeral_string(tvb, offset, flags_len);
|
2006-12-31 00:00:06 +00:00
|
|
|
offset += flags_len;
|
|
|
|
service_len = tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
|
|
|
service = tvb_get_ephemeral_string(tvb, offset, service_len);
|
|
|
|
offset += service_len;
|
|
|
|
regex_len = tvb_get_guint8(tvb, offset);
|
|
|
|
offset++;
|
|
|
|
regex = tvb_get_ephemeral_string(tvb, offset, regex_len);
|
|
|
|
offset += regex_len;
|
2009-07-31 06:51:27 +00:00
|
|
|
replacement_len = get_dns_name(tvb, offset, 0, dns_data_offset, &replacement);
|
2006-12-31 00:00:06 +00:00
|
|
|
offset++;
|
2009-07-31 06:51:27 +00:00
|
|
|
name_out = format_text(replacement, strlen(replacement));
|
2006-12-31 00:00:06 +00:00
|
|
|
|
2009-03-30 19:39:01 +00:00
|
|
|
if (cinfo != NULL)
|
2006-12-31 00:00:06 +00:00
|
|
|
col_append_fstr(cinfo, COL_INFO, " %u %u %s", order, preference, flags);
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2006-12-31 00:00:06 +00:00
|
|
|
proto_item_append_text(trr, ", order %u, preference %u, flags %s",
|
|
|
|
order, preference, flags);
|
|
|
|
offset = cur_offset;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 2, "Order: %u", order);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 2, "Preference: %u", preference);
|
|
|
|
offset += 2;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 1, "Flags length: %u", flags_len);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, flags_len, "Flags: \"%s\"", flags);
|
|
|
|
offset += flags_len;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 1, "Service length: %u", service_len);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, service_len, "Service: \"%s\"", service);
|
|
|
|
offset += service_len;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 1, "Regex length: %u", regex_len);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, regex_len, "Regex: \"%s\"", regex);
|
|
|
|
offset += regex_len;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, 1, "Replacement length: %u", replacement_len);
|
|
|
|
offset++;
|
2009-07-31 06:51:27 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, offset, replacement_len, "Replacement: %s", name_out);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2006-12-31 00:00:06 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-07-31 07:05:43 +00:00
|
|
|
case T_SSHFP:
|
|
|
|
{
|
|
|
|
guint8 sshfp_algorithm, sshfp_type;
|
|
|
|
int rr_len = data_len;
|
|
|
|
|
|
|
|
static const value_string sshfp_algo[] = {
|
|
|
|
{ TSSHFP_ALGO_RESERVED, "Reserved" },
|
|
|
|
{ TSSHFP_ALGO_RSA, "RSA" },
|
|
|
|
{ TSSHFP_ALGO_DSA, "DSA" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string sshfp_fingertype[] = {
|
|
|
|
{ TSSHFP_FTYPE_RESERVED, "Reserved" },
|
|
|
|
{ TSSHFP_FTYPE_SHA1, "SHA1" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-07-31 07:05:43 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
sshfp_algorithm = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Algorithm: %s", val_to_str(sshfp_algorithm, sshfp_algo, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
sshfp_type = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "Fingerprint type: %s", val_to_str(sshfp_type, sshfp_fingertype, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
if (rr_len != 0)
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_sshfp_fingerprint, tvb, cur_offset, rr_len, FALSE);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-07-31 07:05:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-08-03 18:23:04 +00:00
|
|
|
case T_HIP:
|
|
|
|
{
|
|
|
|
guint8 hit_len, algo;
|
|
|
|
guint16 pk_len;
|
|
|
|
int rr_len = data_len;
|
|
|
|
int rendezvous_len;
|
|
|
|
const guchar *rend_server_dns_name;
|
|
|
|
|
|
|
|
static const value_string hip_algo_vals[] = {
|
|
|
|
{ THIP_ALGO_DSA, "DSA" },
|
|
|
|
{ THIP_ALGO_RSA, "RSA" },
|
2009-08-03 21:07:08 +00:00
|
|
|
{ THIP_ALGO_RESERVED, "Reserved" },
|
|
|
|
{ 0, NULL }
|
2009-08-03 18:23:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-08-03 18:23:04 +00:00
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
hit_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "HIT length: %u", hit_len);
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
algo = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 1, "PK algorithm: %s", val_to_str(algo, hip_algo_vals, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
pk_len = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "PK length: %u", pk_len);
|
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_hip_hit, tvb, cur_offset, hit_len, FALSE);
|
|
|
|
cur_offset += hit_len;
|
|
|
|
rr_len -= hit_len;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_hip_pk, tvb, cur_offset, pk_len, FALSE);
|
|
|
|
cur_offset += pk_len;
|
|
|
|
rr_len -= pk_len;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
|
|
|
|
while (rr_len > 1) {
|
|
|
|
rendezvous_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &rend_server_dns_name);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rendezvous_len, "Rendezvous Server: %s",
|
|
|
|
format_text(rend_server_dns_name, strlen(rend_server_dns_name)));
|
|
|
|
cur_offset += rendezvous_len;
|
|
|
|
rr_len -= rendezvous_len;
|
|
|
|
}
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-08-03 18:23:04 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-08-05 18:17:18 +00:00
|
|
|
case T_DHCID:
|
|
|
|
{
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-08-05 18:17:18 +00:00
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_dhcid_rdata, tvb, cur_offset, data_len, FALSE);
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2009-08-05 18:17:18 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
case T_APL:
|
|
|
|
{
|
|
|
|
int rr_len = data_len;
|
|
|
|
guint16 afamily;
|
|
|
|
guint8 afdpart_len;
|
|
|
|
guint8 *addr_copy;
|
|
|
|
|
|
|
|
static const value_string apl_afamily_vals[] = {
|
|
|
|
{ TAPL_ADDR_FAMILY_IPV4, "IPv4" },
|
|
|
|
{ TAPL_ADDR_FAMILY_IPV6, "IPv6" },
|
|
|
|
{ 0, NULL }};
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
|
|
|
|
while (rr_len > 1) {
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
afamily = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Address Family: %s", val_to_str(afamily, apl_afamily_vals, "Unknown (0x%02X)"));
|
|
|
|
cur_offset += 2;
|
|
|
|
rr_len -= 2;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_apl_coded_prefix, tvb, cur_offset, 1, FALSE);
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
afdpart_len = tvb_get_guint8(tvb, cur_offset) & DNS_APL_AFDLENGTH;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_apl_negation, tvb, cur_offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_apl_afdlength, tvb, cur_offset, 1, FALSE);
|
|
|
|
cur_offset += 1;
|
|
|
|
rr_len -= 1;
|
|
|
|
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
if (afamily == 1 && afdpart_len <= 4) {
|
|
|
|
addr_copy = se_alloc0(4);
|
|
|
|
} else if (afamily == 2 && afdpart_len <= 16) {
|
|
|
|
addr_copy = se_alloc0(16);
|
|
|
|
} else {
|
|
|
|
goto bad_rr;
|
|
|
|
}
|
|
|
|
tvb_memcpy(tvb, (guint8 *)addr_copy, cur_offset, afdpart_len);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, afdpart_len, "%s address: %s", val_to_str(afamily, apl_afamily_vals, "Unknown"),
|
|
|
|
(afamily == 0x02) ? ip6_to_str((const struct e_in6_addr *)addr_copy)
|
|
|
|
: ip_to_str(addr_copy) );
|
|
|
|
cur_offset += afdpart_len;
|
|
|
|
rr_len -= afdpart_len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_GPOS:
|
|
|
|
{
|
|
|
|
guint8 long_len, lat_len, alt_len;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
long_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 1, long_len, "Longitude: %.*s", long_len, tvb_get_ptr(tvb, cur_offset +1 , long_len));
|
|
|
|
cur_offset += 1 + long_len;
|
|
|
|
|
|
|
|
lat_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 1, lat_len, "Latitude: %.*s", lat_len, tvb_get_ptr(tvb, cur_offset + 1, lat_len));
|
|
|
|
cur_offset += 1 + lat_len;
|
|
|
|
|
|
|
|
alt_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 1, alt_len, "Altitude: %.*s", alt_len, tvb_get_ptr(tvb, cur_offset + 1, alt_len));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_RP:
|
|
|
|
{
|
|
|
|
int mbox_dname_len, txt_dname_len;
|
|
|
|
const guchar *mbox_dname, *txt_dname;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
mbox_dname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &mbox_dname);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, mbox_dname_len, "Mailbox: %s", format_text(mbox_dname, strlen(mbox_dname)));
|
|
|
|
cur_offset += mbox_dname_len;
|
|
|
|
txt_dname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &txt_dname);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, txt_dname_len, "TXT RR: %s", format_text(txt_dname, strlen(txt_dname)));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_AFSDB:
|
|
|
|
case T_RT:
|
|
|
|
{
|
|
|
|
guint16 subtype = 0;
|
|
|
|
const guchar *host_name;
|
|
|
|
int host_name_len;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
subtype = tvb_get_ntohs(tvb, cur_offset);
|
|
|
|
host_name_len = get_dns_name(tvb, cur_offset + 2, 0, dns_data_offset, &host_name);
|
|
|
|
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, (type == T_AFSDB) ? "Subtype: %u" : "Preference: %u", subtype);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset + 2, host_name_len, (type == T_AFSDB) ? "Hostname: %s" : "Intermediate-Host: %s",format_text(host_name, strlen(host_name)));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_X25:
|
|
|
|
{
|
|
|
|
guint8 x25_len;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
x25_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, x25_len + 1, "PSDN-Address: %.*s", x25_len, tvb_get_ptr(tvb, cur_offset +1, x25_len));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_ISDN:
|
|
|
|
{
|
|
|
|
guint8 isdn_address_len, isdn_sa_len;
|
|
|
|
int rr_len = data_len;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (rr_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
isdn_address_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, isdn_address_len + 1, "ISDN Address: %.*s", isdn_address_len, tvb_get_ptr(tvb, cur_offset +1, isdn_address_len));
|
|
|
|
cur_offset += 1 + isdn_address_len;
|
|
|
|
rr_len -= 1 + isdn_address_len;
|
|
|
|
|
|
|
|
if (rr_len > 1) /* ISDN SA is optional */ {
|
|
|
|
isdn_sa_len = tvb_get_guint8(tvb, cur_offset);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, isdn_sa_len + 1, "Subaddress: %.*s", isdn_sa_len, tvb_get_ptr(tvb, cur_offset +1, isdn_sa_len));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_PX:
|
|
|
|
{
|
|
|
|
int px_map822_len, px_mapx400_len;
|
|
|
|
const guchar *px_map822_dnsname, *px_mapx400_dnsname;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Preference: %u", tvb_get_ntohs(tvb, cur_offset));
|
|
|
|
cur_offset += 2;
|
|
|
|
px_map822_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &px_map822_dnsname);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, px_map822_len, "MAP822: %s", format_text(px_map822_dnsname, strlen(px_map822_dnsname)));
|
|
|
|
cur_offset += px_map822_len;
|
|
|
|
px_mapx400_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &px_mapx400_dnsname);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, px_mapx400_len, "MAPX400: %s", format_text(px_mapx400_dnsname, strlen(px_mapx400_dnsname)) );
|
|
|
|
cur_offset += px_mapx400_len;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_NSAP:
|
|
|
|
{
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
proto_tree_add_item(rr_tree, hf_dns_nsap_rdata, tvb, cur_offset, data_len, FALSE);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_NSAP_PTR:
|
|
|
|
{
|
|
|
|
int nsap_ptr_owner_len;
|
|
|
|
const guchar *nsap_ptr_owner;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
nsap_ptr_owner_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &nsap_ptr_owner);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, nsap_ptr_owner_len, "Owner: %s", format_text(nsap_ptr_owner, strlen(nsap_ptr_owner)) );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_MB:
|
|
|
|
case T_MF:
|
|
|
|
case T_MD:
|
|
|
|
case T_MG:
|
|
|
|
case T_MR:
|
|
|
|
{
|
|
|
|
int hostname_len;
|
|
|
|
const guchar *hostname_str;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
hostname_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &hostname_str);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, hostname_len, "Host: %s", format_text(hostname_str, strlen(hostname_str)));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_MINFO:
|
|
|
|
{
|
|
|
|
int rmailbx_len, emailbx_len;
|
|
|
|
const guchar *rmailbx_str, *emailbx_str;
|
|
|
|
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
if (data_len < 1)
|
|
|
|
goto bad_rr;
|
|
|
|
rmailbx_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &rmailbx_str);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, rmailbx_len, "Responsible Mailbox: %s", format_text(rmailbx_str, strlen(rmailbx_str)));
|
|
|
|
cur_offset += rmailbx_len;
|
|
|
|
emailbx_len = get_dns_name(tvb, cur_offset, 0, dns_data_offset, &emailbx_str);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, emailbx_len, "Error Mailbox: %s", format_text(emailbx_str, strlen(emailbx_str)));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case T_NULL:
|
|
|
|
{
|
|
|
|
if (cinfo != NULL)
|
|
|
|
col_append_fstr(cinfo, COL_INFO, " %s", name);
|
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, data_len, "Data");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-03-22 23:31:05 +00:00
|
|
|
/* TODO: parse more record types */
|
|
|
|
|
1998-10-14 19:35:00 +00:00
|
|
|
default:
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
proto_tree_add_text(rr_tree, tvb, cur_offset, data_len, "Data");
|
1999-11-27 08:59:28 +00:00
|
|
|
break;
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
data_offset += data_len;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
return data_offset - data_start;
|
|
|
|
|
|
|
|
bad_rr:
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
proto_item_append_text(trr, ", bad RR length %d, too short",
|
|
|
|
data_len);
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
|
2003-12-12 23:23:57 +00:00
|
|
|
|
|
|
|
data_offset += data_len;
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
return data_offset - data_start;
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-07-02 07:11:40 +00:00
|
|
|
dissect_query_records(tvbuff_t *tvb, int cur_off, int dns_data_offset,
|
2006-11-12 22:12:39 +00:00
|
|
|
int count, column_info *cinfo, proto_tree *dns_tree, gboolean isupdate,
|
|
|
|
gboolean is_mdns)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
1999-10-07 02:26:45 +00:00
|
|
|
int start_off, add_off;
|
1999-11-07 21:00:40 +00:00
|
|
|
proto_tree *qatree = NULL;
|
|
|
|
proto_item *ti = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
start_off = cur_off;
|
1999-11-07 21:00:40 +00:00
|
|
|
if (dns_tree) {
|
2005-07-30 01:01:02 +00:00
|
|
|
const char *s = (isupdate ? "Zone" : "Queries");
|
2008-10-31 14:07:23 +00:00
|
|
|
ti = proto_tree_add_text(dns_tree, tvb, start_off, -1, "%s", s);
|
1999-11-16 11:44:20 +00:00
|
|
|
qatree = proto_item_add_subtree(ti, ett_dns_qry);
|
1999-11-07 21:00:40 +00:00
|
|
|
}
|
1999-10-07 02:26:45 +00:00
|
|
|
while (count-- > 0) {
|
2006-11-12 22:12:39 +00:00
|
|
|
add_off = dissect_dns_query(tvb, cur_off, dns_data_offset, cinfo, qatree,
|
|
|
|
is_mdns);
|
1999-10-07 02:26:45 +00:00
|
|
|
cur_off += add_off;
|
|
|
|
}
|
1999-11-07 21:00:40 +00:00
|
|
|
if (ti)
|
|
|
|
proto_item_set_len(ti, cur_off - start_off);
|
1998-09-16 02:39:15 +00:00
|
|
|
|
|
|
|
return cur_off - start_off;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2001-07-02 07:11:40 +00:00
|
|
|
dissect_answer_records(tvbuff_t *tvb, int cur_off, int dns_data_offset,
|
2005-07-30 01:01:02 +00:00
|
|
|
int count, column_info *cinfo, proto_tree *dns_tree, const char *name,
|
2006-11-12 22:12:39 +00:00
|
|
|
packet_info *pinfo, gboolean is_mdns)
|
1998-09-16 02:39:15 +00:00
|
|
|
{
|
1999-10-07 02:26:45 +00:00
|
|
|
int start_off, add_off;
|
1999-11-07 21:00:40 +00:00
|
|
|
proto_tree *qatree = NULL;
|
|
|
|
proto_item *ti = NULL;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
start_off = cur_off;
|
1999-11-07 21:00:40 +00:00
|
|
|
if (dns_tree) {
|
2008-10-31 14:07:23 +00:00
|
|
|
ti = proto_tree_add_text(dns_tree, tvb, start_off, -1, "%s", name);
|
1999-11-16 11:44:20 +00:00
|
|
|
qatree = proto_item_add_subtree(ti, ett_dns_ans);
|
1999-11-07 21:00:40 +00:00
|
|
|
}
|
1999-10-07 02:26:45 +00:00
|
|
|
while (count-- > 0) {
|
2003-01-26 01:00:05 +00:00
|
|
|
add_off = dissect_dns_answer(
|
2006-11-12 22:12:39 +00:00
|
|
|
tvb, cur_off, dns_data_offset, cinfo, qatree, pinfo, is_mdns);
|
1999-10-07 02:26:45 +00:00
|
|
|
cur_off += add_off;
|
|
|
|
}
|
1999-11-07 21:00:40 +00:00
|
|
|
if (ti)
|
|
|
|
proto_item_set_len(ti, cur_off - start_off);
|
1998-09-16 02:39:15 +00:00
|
|
|
|
|
|
|
return cur_off - start_off;
|
|
|
|
}
|
|
|
|
|
2002-02-22 08:45:02 +00:00
|
|
|
static void
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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-05-05 00:16:38 +00:00
|
|
|
dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
2009-02-11 13:25:00 +00:00
|
|
|
gboolean is_tcp, gboolean is_mdns, gboolean is_llmnr)
|
1999-10-07 07:44:29 +00:00
|
|
|
{
|
2002-02-22 08:45:02 +00:00
|
|
|
int offset = is_tcp ? 2 : 0;
|
1999-10-07 07:44:29 +00:00
|
|
|
int dns_data_offset;
|
2001-12-10 00:26:21 +00:00
|
|
|
column_info *cinfo;
|
1999-11-07 21:00:40 +00:00
|
|
|
proto_tree *dns_tree = NULL, *field_tree;
|
1999-03-23 03:14:46 +00:00
|
|
|
proto_item *ti, *tf;
|
2002-05-15 07:24:20 +00:00
|
|
|
guint16 id, flags, opcode, rcode, quest, ans, auth, add;
|
2005-10-16 00:27:50 +00:00
|
|
|
char *buf;
|
|
|
|
int bufpos;
|
1998-09-16 02:39:15 +00:00
|
|
|
int cur_off;
|
2004-11-12 09:46:31 +00:00
|
|
|
gboolean isupdate;
|
2006-08-23 09:48:16 +00:00
|
|
|
conversation_t *conversation;
|
|
|
|
dns_conv_info_t *dns_info;
|
|
|
|
dns_transaction_t *dns_trans;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-10-07 07:44:29 +00:00
|
|
|
dns_data_offset = offset;
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2009-08-09 07:36:13 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
1999-10-07 07:44:29 +00:00
|
|
|
|
2005-10-16 00:27:50 +00:00
|
|
|
#define MAX_BUF_SIZE (128+1)
|
|
|
|
buf=ep_alloc(MAX_BUF_SIZE);
|
|
|
|
buf[0]=0;
|
|
|
|
bufpos=0;
|
|
|
|
|
1999-10-07 07:44:29 +00:00
|
|
|
/* To do: check for errs, etc. */
|
2001-07-02 07:11:40 +00:00
|
|
|
id = tvb_get_ntohs(tvb, offset + DNS_ID);
|
|
|
|
flags = tvb_get_ntohs(tvb, offset + DNS_FLAGS);
|
2004-01-05 19:31:44 +00:00
|
|
|
opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
|
|
|
|
rcode = (guint16) (flags & F_RCODE);
|
2001-07-02 07:11:40 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
2005-10-16 00:27:50 +00:00
|
|
|
bufpos=0;
|
2006-01-20 21:18:18 +00:00
|
|
|
bufpos+=MIN(MAX_BUF_SIZE-bufpos,
|
|
|
|
g_snprintf(buf+bufpos, MAX_BUF_SIZE-bufpos, "%s%s",
|
2005-10-16 00:27:50 +00:00
|
|
|
val_to_str(opcode, opcode_vals, "Unknown operation (%u)"),
|
2006-01-20 21:18:18 +00:00
|
|
|
(flags&F_RESPONSE)?" response":""));
|
2009-03-30 19:39:01 +00:00
|
|
|
|
1999-12-29 10:36:13 +00:00
|
|
|
if (flags & F_RESPONSE) {
|
|
|
|
if ((flags & F_RCODE) != RCODE_NOERROR) {
|
2006-01-20 21:18:18 +00:00
|
|
|
bufpos+=MIN(MAX_BUF_SIZE-bufpos,
|
|
|
|
g_snprintf(buf+bufpos, MAX_BUF_SIZE-bufpos, ", %s",
|
|
|
|
val_to_str(flags & F_RCODE, rcode_vals, "Unknown error (%u)")));
|
1999-12-29 10:36:13 +00:00
|
|
|
}
|
|
|
|
}
|
2001-12-10 00:26:21 +00:00
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, buf);
|
|
|
|
cinfo = pinfo->cinfo;
|
1999-11-07 21:00:40 +00:00
|
|
|
} else {
|
2001-12-10 00:26:21 +00:00
|
|
|
/* Set "cinfo" to NULL; we pass a NULL "cinfo" to the query and answer
|
1999-11-07 21:00:40 +00:00
|
|
|
dissectors, as a way of saying that they shouldn't add stuff
|
2001-12-10 00:26:21 +00:00
|
|
|
to the COL_INFO column (a call to "check_col(cinfo, COL_INFO)"
|
1999-11-07 21:00:40 +00:00
|
|
|
is more expensive than a check that a pointer isn't NULL). */
|
2001-12-10 00:26:21 +00:00
|
|
|
cinfo = NULL;
|
1999-01-04 09:13:46 +00:00
|
|
|
}
|
2002-05-15 07:24:20 +00:00
|
|
|
if (opcode == OPCODE_UPDATE)
|
2004-11-12 09:46:31 +00:00
|
|
|
isupdate = TRUE;
|
2000-10-11 04:12:06 +00:00
|
|
|
else
|
2004-11-12 09:46:31 +00:00
|
|
|
isupdate = FALSE;
|
2001-07-02 07:11:40 +00:00
|
|
|
|
1998-09-16 02:39:15 +00:00
|
|
|
if (tree) {
|
2009-02-11 13:25:00 +00:00
|
|
|
if (is_llmnr) {
|
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_dns, tvb, 0, -1,
|
|
|
|
"Link-local Multicast Name Resolution (%s)", (flags & F_RESPONSE) ? "response" : "query");
|
|
|
|
} else {
|
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_dns, tvb, 0, -1,
|
|
|
|
"Domain Name System (%s)", (flags & F_RESPONSE) ? "response" : "query");
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
dns_tree = proto_item_add_subtree(ti, ett_dns);
|
2007-06-22 13:23:50 +00:00
|
|
|
}
|
1999-10-16 15:08:11 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
/*
|
|
|
|
* Do we have a conversation for this connection?
|
|
|
|
*/
|
2009-03-30 19:39:01 +00:00
|
|
|
conversation = find_conversation(pinfo->fd->num,
|
2006-08-23 09:48:16 +00:00
|
|
|
&pinfo->src, &pinfo->dst,
|
2009-03-30 19:39:01 +00:00
|
|
|
pinfo->ptype,
|
2006-08-23 09:48:16 +00:00
|
|
|
pinfo->srcport, pinfo->destport, 0);
|
2007-06-22 13:23:50 +00:00
|
|
|
if (conversation == NULL) {
|
|
|
|
/* We don't yet have a conversation, so create one. */
|
2009-03-30 19:39:01 +00:00
|
|
|
conversation = conversation_new(pinfo->fd->num,
|
2006-08-23 09:48:16 +00:00
|
|
|
&pinfo->src, &pinfo->dst,
|
|
|
|
pinfo->ptype,
|
|
|
|
pinfo->srcport, pinfo->destport, 0);
|
2007-06-22 13:23:50 +00:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Do we already have a state structure for this conv
|
|
|
|
*/
|
|
|
|
dns_info = conversation_get_proto_data(conversation, proto_dns);
|
|
|
|
if (!dns_info) {
|
|
|
|
/* No. Attach that information to the conversation, and add
|
|
|
|
* it to the list of information structures.
|
2006-08-23 09:48:16 +00:00
|
|
|
*/
|
2007-06-22 13:23:50 +00:00
|
|
|
dns_info = se_alloc(sizeof(dns_conv_info_t));
|
|
|
|
dns_info->pdus=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "dns_pdus");
|
|
|
|
conversation_add_proto_data(conversation, proto_dns, dns_info);
|
|
|
|
}
|
|
|
|
if(!pinfo->fd->flags.visited){
|
|
|
|
if(!(flags&F_RESPONSE)){
|
|
|
|
/* This is a request */
|
|
|
|
dns_trans=se_alloc(sizeof(dns_transaction_t));
|
|
|
|
dns_trans->req_frame=pinfo->fd->num;
|
2006-08-23 09:48:16 +00:00
|
|
|
dns_trans->rep_frame=0;
|
|
|
|
dns_trans->req_time=pinfo->fd->abs_ts;
|
2007-06-22 13:23:50 +00:00
|
|
|
se_tree_insert32(dns_info->pdus, id, (void *)dns_trans);
|
|
|
|
} else {
|
|
|
|
dns_trans=se_tree_lookup32(dns_info->pdus, id);
|
|
|
|
if(dns_trans){
|
|
|
|
dns_trans->rep_frame=pinfo->fd->num;
|
|
|
|
}
|
2006-08-23 09:48:16 +00:00
|
|
|
}
|
2007-06-22 13:23:50 +00:00
|
|
|
} else {
|
|
|
|
dns_trans=se_tree_lookup32(dns_info->pdus, id);
|
|
|
|
}
|
|
|
|
if(!dns_trans){
|
|
|
|
/* create a "fake" pana_trans structure */
|
|
|
|
dns_trans=ep_alloc(sizeof(dns_transaction_t));
|
|
|
|
dns_trans->req_frame=0;
|
|
|
|
dns_trans->rep_frame=0;
|
|
|
|
dns_trans->req_time=pinfo->fd->abs_ts;
|
|
|
|
}
|
2006-08-23 09:48:16 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
/* print state tracking in the tree */
|
|
|
|
if(!(flags&F_RESPONSE)){
|
|
|
|
/* This is a request */
|
|
|
|
if(dns_trans->rep_frame){
|
|
|
|
proto_item *it;
|
2006-08-23 09:48:16 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
it=proto_tree_add_uint(dns_tree, hf_dns_response_in, tvb, 0, 0, dns_trans->rep_frame);
|
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* This is a reply */
|
|
|
|
if(dns_trans->req_frame){
|
|
|
|
proto_item *it;
|
|
|
|
nstime_t ns;
|
2006-08-23 09:48:16 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
it=proto_tree_add_uint(dns_tree, hf_dns_response_to, tvb, 0, 0, dns_trans->req_frame);
|
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
2006-08-23 09:48:16 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
nstime_delta(&ns, &pinfo->fd->abs_ts, &dns_trans->req_time);
|
|
|
|
it=proto_tree_add_time(dns_tree, hf_dns_time, tvb, 0, 0, &ns);
|
|
|
|
PROTO_ITEM_SET_GENERATED(it);
|
2001-07-02 07:29:03 +00:00
|
|
|
}
|
2009-03-30 19:39:01 +00:00
|
|
|
}
|
2001-07-02 07:29:03 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
if (is_tcp) {
|
|
|
|
/* Put the length indication into the tree. */
|
|
|
|
proto_tree_add_item(dns_tree, hf_dns_length, tvb, offset - 2, 2, FALSE);
|
|
|
|
}
|
1999-01-04 09:13:46 +00:00
|
|
|
|
2007-06-22 13:23:50 +00:00
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_transaction_id, tvb,
|
|
|
|
offset + DNS_ID, 2, id);
|
|
|
|
|
|
|
|
bufpos=0;
|
|
|
|
bufpos+=MIN(MAX_BUF_SIZE-bufpos,
|
2006-01-20 21:18:18 +00:00
|
|
|
g_snprintf(buf+bufpos, MAX_BUF_SIZE-bufpos, "%s",
|
2007-06-22 13:23:50 +00:00
|
|
|
val_to_str(opcode, opcode_vals, "Unknown operation")));
|
|
|
|
if (flags & F_RESPONSE) {
|
|
|
|
bufpos+=MIN(MAX_BUF_SIZE-bufpos,
|
|
|
|
g_snprintf(buf+bufpos, MAX_BUF_SIZE-bufpos, " response, %s",
|
|
|
|
val_to_str(flags & F_RCODE, rcode_vals, "Unknown error")));
|
|
|
|
}
|
|
|
|
tf = proto_tree_add_uint_format(dns_tree, hf_dns_flags, tvb,
|
|
|
|
offset + DNS_FLAGS, 2,
|
|
|
|
flags,
|
|
|
|
"Flags: 0x%04x (%s)",
|
|
|
|
flags, buf);
|
|
|
|
field_tree = proto_item_add_subtree(tf, ett_dns_flags);
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_response,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_opcode,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
if (is_llmnr) {
|
|
|
|
if (flags & F_RESPONSE) {
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_conflict_response,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
} else {
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_conflict_query,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
}
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_truncated,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_tentative,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
|
|
|
if (flags & F_RESPONSE) {
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_rcode,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (flags & F_RESPONSE) {
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_authoritative,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
|
|
|
}
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_truncated,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_recdesired,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
if (flags & F_RESPONSE) {
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_recavail,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_z,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_authenticated,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_rcode,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
} else {
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_z,
|
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
|
|
|
proto_tree_add_item(field_tree, hf_dns_flags_checkdisable,
|
2007-06-22 13:23:50 +00:00
|
|
|
tvb, offset + DNS_FLAGS, 2, FALSE);
|
2009-02-11 13:25:00 +00:00
|
|
|
}
|
2007-06-22 13:23:50 +00:00
|
|
|
}
|
|
|
|
|
2001-07-02 07:11:40 +00:00
|
|
|
quest = tvb_get_ntohs(tvb, offset + DNS_QUEST);
|
|
|
|
if (tree) {
|
2004-11-12 09:46:31 +00:00
|
|
|
if (isupdate) {
|
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_zones, tvb,
|
|
|
|
offset + DNS_QUEST, 2, quest);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_questions, tvb,
|
|
|
|
offset + DNS_QUEST, 2, quest);
|
|
|
|
}
|
2001-07-02 07:11:40 +00:00
|
|
|
}
|
|
|
|
ans = tvb_get_ntohs(tvb, offset + DNS_ANS);
|
|
|
|
if (tree) {
|
2004-11-12 09:46:31 +00:00
|
|
|
if (isupdate) {
|
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_prerequisites, tvb,
|
|
|
|
offset + DNS_ANS, 2, ans);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_answers, tvb,
|
|
|
|
offset + DNS_ANS, 2, ans);
|
|
|
|
}
|
2001-07-02 07:11:40 +00:00
|
|
|
}
|
|
|
|
auth = tvb_get_ntohs(tvb, offset + DNS_AUTH);
|
|
|
|
if (tree) {
|
2004-11-12 09:46:31 +00:00
|
|
|
if (isupdate) {
|
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_updates, tvb,
|
|
|
|
offset + DNS_AUTH, 2, auth);
|
|
|
|
} else {
|
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_auth_rr, tvb,
|
|
|
|
offset + DNS_AUTH, 2, auth);
|
|
|
|
}
|
2001-07-02 07:11:40 +00:00
|
|
|
}
|
|
|
|
add = tvb_get_ntohs(tvb, offset + DNS_ADD);
|
|
|
|
if (tree) {
|
2002-08-28 21:04:11 +00:00
|
|
|
proto_tree_add_uint(dns_tree, hf_dns_count_add_rr, tvb,
|
1999-10-16 15:08:11 +00:00
|
|
|
offset + DNS_ADD, 2, add);
|
1998-09-16 02:39:15 +00:00
|
|
|
|
1999-11-07 21:00:40 +00:00
|
|
|
}
|
|
|
|
cur_off = offset + DNS_HDRLEN;
|
|
|
|
|
|
|
|
if (quest > 0) {
|
|
|
|
/* If this is a response, don't add information about the queries
|
|
|
|
to the summary, just add information about the answers. */
|
2001-07-02 07:11:40 +00:00
|
|
|
cur_off += dissect_query_records(tvb, cur_off, dns_data_offset, quest,
|
2001-12-10 00:26:21 +00:00
|
|
|
(!(flags & F_RESPONSE) ? cinfo : NULL),
|
2006-11-12 22:12:39 +00:00
|
|
|
dns_tree, isupdate, is_mdns);
|
1999-11-07 21:00:40 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-11-07 21:00:40 +00:00
|
|
|
if (ans > 0) {
|
|
|
|
/* If this is a request, don't add information about the answers
|
|
|
|
to the summary, just add information about the queries. */
|
2001-07-02 07:11:40 +00:00
|
|
|
cur_off += dissect_answer_records(tvb, cur_off, dns_data_offset, ans,
|
2001-12-10 00:26:21 +00:00
|
|
|
((flags & F_RESPONSE) ? cinfo : NULL),
|
2003-01-26 01:00:05 +00:00
|
|
|
dns_tree, (isupdate ?
|
|
|
|
"Prerequisites" : "Answers"),
|
2006-11-12 22:12:39 +00:00
|
|
|
pinfo, is_mdns);
|
1999-11-07 21:00:40 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-09-17 00:36:04 +00:00
|
|
|
/* Don't add information about the authoritative name servers, or the
|
|
|
|
additional records, to the summary. */
|
|
|
|
if (auth > 0) {
|
|
|
|
cur_off += dissect_answer_records(tvb, cur_off, dns_data_offset, auth,
|
|
|
|
NULL, dns_tree,
|
2009-03-30 19:39:01 +00:00
|
|
|
(isupdate ? "Updates" :
|
2003-01-26 01:00:05 +00:00
|
|
|
"Authoritative nameservers"),
|
2006-11-12 22:12:39 +00:00
|
|
|
pinfo, is_mdns);
|
2001-09-17 00:36:04 +00:00
|
|
|
}
|
1998-09-16 02:39:15 +00:00
|
|
|
|
2001-09-17 00:36:04 +00:00
|
|
|
if (add > 0) {
|
|
|
|
cur_off += dissect_answer_records(tvb, cur_off, dns_data_offset, add,
|
2003-01-26 01:00:05 +00:00
|
|
|
NULL, dns_tree, "Additional records",
|
2006-11-12 22:12:39 +00:00
|
|
|
pinfo, is_mdns);
|
1998-09-16 02:39:15 +00:00
|
|
|
}
|
|
|
|
}
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2000-10-11 04:12:06 +00:00
|
|
|
static void
|
2001-07-02 07:11:40 +00:00
|
|
|
dissect_dns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DNS");
|
2002-12-01 20:50:52 +00:00
|
|
|
|
2009-02-11 13:25:00 +00:00
|
|
|
dissect_dns_common(tvb, pinfo, tree, FALSE, FALSE, FALSE);
|
2002-12-01 20:50:52 +00:00
|
|
|
}
|
|
|
|
|
2009-09-21 12:00:03 +00:00
|
|
|
static void
|
|
|
|
dissect_dns_sctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DNS");
|
|
|
|
|
|
|
|
dissect_dns_common(tvb, pinfo, tree, FALSE, FALSE, FALSE);
|
|
|
|
}
|
|
|
|
|
2002-12-01 20:50:52 +00:00
|
|
|
static void
|
|
|
|
dissect_mdns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MDNS");
|
2002-12-01 20:50:52 +00:00
|
|
|
|
2009-02-11 13:25:00 +00:00
|
|
|
dissect_dns_common(tvb, pinfo, tree, FALSE, TRUE, FALSE);
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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-05-05 00:16:38 +00:00
|
|
|
}
|
|
|
|
|
2009-02-11 13:25:00 +00:00
|
|
|
static void
|
|
|
|
dissect_llmnr_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LLMNR");
|
2009-02-11 13:25:00 +00:00
|
|
|
|
|
|
|
dissect_dns_common(tvb, pinfo, tree, FALSE, FALSE, TRUE);
|
|
|
|
}
|
2002-12-01 20:50:52 +00:00
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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-05-05 00:16:38 +00:00
|
|
|
static guint
|
2006-10-31 09:29:07 +00:00
|
|
|
get_dns_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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-05-05 00:16:38 +00:00
|
|
|
{
|
|
|
|
guint16 plen;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the length of the DNS packet.
|
|
|
|
*/
|
|
|
|
plen = tvb_get_ntohs(tvb, offset);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* That length doesn't include the length field itself; add that in.
|
|
|
|
*/
|
|
|
|
return plen + 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_dns_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DNS");
|
2002-12-01 20:50:52 +00:00
|
|
|
|
2009-02-11 13:25:00 +00:00
|
|
|
dissect_dns_common(tvb, pinfo, tree, TRUE, FALSE, FALSE);
|
2001-07-02 07:11:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_dns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2000-10-11 04:12:06 +00:00
|
|
|
{
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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-05-05 00:16:38 +00:00
|
|
|
tcp_dissect_pdus(tvb, pinfo, tree, dns_desegment, 2, get_dns_pdu_len,
|
|
|
|
dissect_dns_tcp_pdu);
|
2000-10-11 04:12:06 +00:00
|
|
|
}
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
void
|
|
|
|
proto_register_dns(void)
|
|
|
|
{
|
1999-10-16 15:08:11 +00:00
|
|
|
static hf_register_info hf[] = {
|
2001-07-02 07:29:03 +00:00
|
|
|
{ &hf_dns_length,
|
2002-05-15 07:24:20 +00:00
|
|
|
{ "Length", "dns.length",
|
2001-07-02 07:29:03 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Length of DNS-over-TCP request or response", HFILL }},
|
1999-10-16 15:08:11 +00:00
|
|
|
{ &hf_dns_flags,
|
2002-05-15 07:24:20 +00:00
|
|
|
{ "Flags", "dns.flags",
|
1999-10-16 15:08:11 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2002-05-15 07:24:20 +00:00
|
|
|
{ &hf_dns_flags_response,
|
|
|
|
{ "Response", "dns.flags.response",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_response), F_RESPONSE,
|
|
|
|
"Is the message a response?", HFILL }},
|
|
|
|
{ &hf_dns_flags_opcode,
|
|
|
|
{ "Opcode", "dns.flags.opcode",
|
|
|
|
FT_UINT16, BASE_DEC, VALS(opcode_vals), F_OPCODE,
|
|
|
|
"Operation code", HFILL }},
|
|
|
|
{ &hf_dns_flags_authoritative,
|
|
|
|
{ "Authoritative", "dns.flags.authoritative",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_authoritative), F_AUTHORITATIVE,
|
|
|
|
"Is the server is an authority for the domain?", HFILL }},
|
2009-02-11 13:25:00 +00:00
|
|
|
{ &hf_dns_flags_conflict_query,
|
|
|
|
{ "Conflict", "dns.flags.conflict",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_conflict_query), F_CONFLICT,
|
|
|
|
"Did we receive multiple responses to a query?", HFILL }},
|
|
|
|
{ &hf_dns_flags_conflict_response,
|
|
|
|
{ "Conflict", "dns.flags.conflict",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_conflict_response), F_CONFLICT,
|
|
|
|
"Is the name considered unique?", HFILL }},
|
2002-05-15 07:24:20 +00:00
|
|
|
{ &hf_dns_flags_truncated,
|
|
|
|
{ "Truncated", "dns.flags.truncated",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_truncated), F_TRUNCATED,
|
|
|
|
"Is the message truncated?", HFILL }},
|
|
|
|
{ &hf_dns_flags_recdesired,
|
|
|
|
{ "Recursion desired", "dns.flags.recdesired",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_recdesired), F_RECDESIRED,
|
|
|
|
"Do query recursively?", HFILL }},
|
2009-02-11 13:25:00 +00:00
|
|
|
{ &hf_dns_flags_tentative,
|
|
|
|
{ "Tentative", "dns.flags.tentative",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_tentative), F_TENTATIVE,
|
|
|
|
"Is the responder authoritative for the name, but not yet verified the uniqueness?", HFILL }},
|
2002-05-15 07:24:20 +00:00
|
|
|
{ &hf_dns_flags_recavail,
|
|
|
|
{ "Recursion available", "dns.flags.recavail",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_recavail), F_RECAVAIL,
|
|
|
|
"Can the server do recursive queries?", HFILL }},
|
2003-05-07 03:00:32 +00:00
|
|
|
{ &hf_dns_flags_z,
|
|
|
|
{ "Z", "dns.flags.z",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_z), F_Z,
|
|
|
|
"Z flag", HFILL }},
|
2002-05-15 07:24:20 +00:00
|
|
|
{ &hf_dns_flags_authenticated,
|
|
|
|
{ "Answer authenticated", "dns.flags.authenticated",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_authenticated), F_AUTHENTIC,
|
|
|
|
"Was the reply data authenticated by the server?", HFILL }},
|
|
|
|
{ &hf_dns_flags_checkdisable,
|
|
|
|
{ "Non-authenticated data OK", "dns.flags.checkdisable",
|
|
|
|
FT_BOOLEAN, 16, TFS(&tfs_flags_checkdisable), F_CHECKDISABLE,
|
|
|
|
"Is non-authenticated data acceptable?", HFILL }},
|
|
|
|
{ &hf_dns_flags_rcode,
|
|
|
|
{ "Reply code", "dns.flags.rcode",
|
|
|
|
FT_UINT16, BASE_DEC, VALS(rcode_vals), F_RCODE,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
1999-10-16 15:08:11 +00:00
|
|
|
{ &hf_dns_transaction_id,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Transaction ID", "dns.id",
|
1999-10-16 15:08:11 +00:00
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Identification of transaction", HFILL }},
|
2004-12-26 00:22:16 +00:00
|
|
|
{ &hf_dns_qry_type,
|
|
|
|
{ "Type", "dns.qry.type",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dns_types), 0x0,
|
|
|
|
"Query Type", HFILL }},
|
|
|
|
{ &hf_dns_qry_class,
|
|
|
|
{ "Class", "dns.qry.class",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dns_classes), 0x0,
|
|
|
|
"Query Class", HFILL }},
|
2006-11-12 22:12:39 +00:00
|
|
|
{ &hf_dns_qry_class_mdns,
|
|
|
|
{ "Class", "dns.qry.class",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dns_classes), 0x7FFF,
|
|
|
|
"Query Class", HFILL }},
|
|
|
|
{ &hf_dns_qry_qu,
|
|
|
|
{ "\"QU\" question", "dns.qry.qu",
|
|
|
|
FT_BOOLEAN, 16, NULL, C_QU,
|
|
|
|
"QU flag", HFILL }},
|
2004-12-26 00:22:16 +00:00
|
|
|
{ &hf_dns_qry_name,
|
|
|
|
{ "Name", "dns.qry.name",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Query Name", HFILL }},
|
|
|
|
{ &hf_dns_rr_type,
|
|
|
|
{ "Type", "dns.resp.type",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dns_types), 0x0,
|
|
|
|
"Response Type", HFILL }},
|
|
|
|
{ &hf_dns_rr_class,
|
|
|
|
{ "Class", "dns.resp.class",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dns_classes), 0x0,
|
|
|
|
"Response Class", HFILL }},
|
2006-11-12 22:12:39 +00:00
|
|
|
{ &hf_dns_rr_class_mdns,
|
|
|
|
{ "Class", "dns.resp.class",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(dns_classes), 0x7FFF,
|
|
|
|
"Response Class", HFILL }},
|
|
|
|
{ &hf_dns_rr_cache_flush,
|
|
|
|
{ "Cache flush", "dns.resp.cache_flush",
|
|
|
|
FT_BOOLEAN, 16, NULL, C_FLUSH,
|
|
|
|
"Cache flush flag", HFILL }},
|
2004-12-26 00:22:16 +00:00
|
|
|
{ &hf_dns_rr_name,
|
|
|
|
{ "Name", "dns.resp.name",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
2009-03-30 19:39:01 +00:00
|
|
|
"Response Name", HFILL }},
|
2004-12-26 00:22:16 +00:00
|
|
|
{ &hf_dns_rr_ttl,
|
|
|
|
{ "Time to live", "dns.resp.ttl",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Response TTL", HFILL }},
|
|
|
|
{ &hf_dns_rr_len,
|
|
|
|
{ "Data length", "dns.resp.len",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"Response Length", HFILL }},
|
1999-10-16 15:08:11 +00:00
|
|
|
{ &hf_dns_count_questions,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Questions", "dns.count.queries",
|
1999-10-16 15:08:11 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Number of queries in packet", HFILL }},
|
2004-11-12 09:46:31 +00:00
|
|
|
{ &hf_dns_count_zones,
|
|
|
|
{ "Zones", "dns.count.zones",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of zones in packet", HFILL }},
|
1999-10-16 15:08:11 +00:00
|
|
|
{ &hf_dns_count_answers,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Answer RRs", "dns.count.answers",
|
1999-10-16 15:08:11 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Number of answers in packet", HFILL }},
|
2004-11-12 09:46:31 +00:00
|
|
|
{ &hf_dns_count_prerequisites,
|
|
|
|
{ "Prerequisites", "dns.count.prerequisites",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of prerequisites in packet", HFILL }},
|
1999-10-16 15:08:11 +00:00
|
|
|
{ &hf_dns_count_auth_rr,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Authority RRs", "dns.count.auth_rr",
|
1999-10-16 15:08:11 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Number of authoritative records in packet", HFILL }},
|
2004-11-12 09:46:31 +00:00
|
|
|
{ &hf_dns_count_updates,
|
|
|
|
{ "Updates", "dns.count.updates",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of updates records in packet", HFILL }},
|
2008-12-18 19:01:08 +00:00
|
|
|
{ &hf_dns_nsec3_algo,
|
|
|
|
{ "Hash algorithm", "dns.nsec3.algo",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(hash_algorithms), 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2008-12-18 19:01:08 +00:00
|
|
|
{ &hf_dns_nsec3_flags,
|
|
|
|
{ "NSEC3 flags", "dns.nsec3.flags",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2008-12-18 19:01:08 +00:00
|
|
|
{ &hf_dns_nsec3_flag_optout,
|
|
|
|
{ "NSEC3 Opt-out flag", "dns.nsec3.flags.opt_out",
|
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_flags_nsec3_optout), NSEC3_FLAG_OPTOUT,
|
|
|
|
"NSEC3 opt-out flag", HFILL }},
|
|
|
|
{ &hf_dns_nsec3_iterations,
|
|
|
|
{ "NSEC3 iterations", "dns.nsec3.iterations",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
"Number of hashing iterations", HFILL }},
|
|
|
|
{ &hf_dns_nsec3_salt_length,
|
|
|
|
{ "Salt length", "dns.nsec3.salt_length",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0,
|
|
|
|
"Length of salt in bytes", HFILL }},
|
|
|
|
{ &hf_dns_nsec3_salt_value,
|
|
|
|
{ "Salt value", "dns.nsec3.salt_value",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2008-12-18 19:01:08 +00:00
|
|
|
{ &hf_dns_nsec3_hash_length,
|
|
|
|
{ "Hash length", "dns.nsec3.hash_length",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0,
|
|
|
|
"Length in bytes of next hashed owner", HFILL }},
|
|
|
|
{ &hf_dns_nsec3_hash_value,
|
|
|
|
{ "Next hashed owner", "dns.nsec3.hash_value",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2005-12-25 12:03:18 +00:00
|
|
|
{ &hf_dns_tsig_original_id,
|
|
|
|
{ "Original Id", "dns.tsig.original_id",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2005-12-25 12:03:18 +00:00
|
|
|
{ &hf_dns_tsig_error,
|
|
|
|
{ "Error", "dns.tsig.error",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Expanded RCODE for TSIG", HFILL }},
|
|
|
|
{ &hf_dns_tsig_fudge,
|
|
|
|
{ "Fudge", "dns.tsig.fudge",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of bytes for the MAC", HFILL }},
|
|
|
|
{ &hf_dns_tsig_mac_size,
|
|
|
|
{ "MAC Size", "dns.tsig.mac_size",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of bytes for the MAC", HFILL }},
|
|
|
|
{ &hf_dns_tsig_other_len,
|
|
|
|
{ "Other Len", "dns.tsig.other_len",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of bytes for Other Data", HFILL }},
|
|
|
|
{ &hf_dns_tsig_mac,
|
|
|
|
{ "MAC", "dns.tsig.mac",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2005-12-25 12:03:18 +00:00
|
|
|
{ &hf_dns_tsig_other_data,
|
|
|
|
{ "Other Data", "dns.tsig.other_data",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2005-12-25 12:03:18 +00:00
|
|
|
{ &hf_dns_tsig_algorithm_name,
|
|
|
|
{ "Algorithm Name", "dns.tsig.algorithm_name",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Name of algorithm used for the MAC", HFILL }},
|
2006-08-23 09:48:16 +00:00
|
|
|
{ &hf_dns_response_in,
|
|
|
|
{ "Response In", "dns.response_in",
|
2009-07-07 09:02:59 +00:00
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
2006-08-23 09:48:16 +00:00
|
|
|
"The response to this DNS query is in this frame", HFILL }},
|
|
|
|
{ &hf_dns_response_to,
|
|
|
|
{ "Request In", "dns.response_to",
|
2009-07-07 09:02:59 +00:00
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
2006-08-23 09:48:16 +00:00
|
|
|
"This is a response to the DNS query in this frame", HFILL }},
|
|
|
|
{ &hf_dns_time,
|
|
|
|
{ "Time", "dns.time",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
|
|
|
"The time between the Query and the Response", HFILL }},
|
1999-10-16 15:08:11 +00:00
|
|
|
{ &hf_dns_count_add_rr,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Additional RRs", "dns.count.add_rr",
|
2009-08-03 18:23:04 +00:00
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Number of additional records in packet", HFILL }},
|
2009-07-31 07:05:43 +00:00
|
|
|
{ &hf_dns_sshfp_fingerprint,
|
|
|
|
{ "Fingerprint", "dns.sshfp.fingerprint",
|
2009-08-03 18:23:04 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_dns_hip_hit,
|
|
|
|
{ "Host Identity Tag", "dns.hip.hit",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_dns_hip_pk,
|
|
|
|
{ "HIP Public Key", "dns.hip.pk",
|
2009-08-05 18:17:18 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_dns_dhcid_rdata,
|
|
|
|
{ "DHCID Data", "dns.dhcid.rdata",
|
2009-08-03 18:23:04 +00:00
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
From Ivan Sy:
NSEC3PARAM RR (RFC 5155), APL RR (RFC 3123), PX RR (RFC 2163), GPOS RR (RFC 1712),
NSAP RR (RFC 1706), NSAP-PTR RR (RFC 1348), AFSDB, RP, X25, ISDN, RT, RR (RFC 1183).
Also cleanup of protocol tree dependancies.
svn path=/trunk/; revision=29506
2009-08-22 17:28:54 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_dns_apl_coded_prefix,
|
|
|
|
{ "Prefix Length", "hf.dns.apl.coded.prefix",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0,
|
|
|
|
"Prefix Length", HFILL }},
|
|
|
|
{ &hf_dns_apl_negation,
|
|
|
|
{ "Negation Flag", "dns.apl.negation",
|
|
|
|
FT_BOOLEAN, 8, TFS(&tfs_dns_apl_negation), DNS_APL_NEGATION,
|
|
|
|
"Negation Flag", HFILL }},
|
|
|
|
{ &hf_dns_apl_afdlength,
|
|
|
|
{ "Address Length, in octets","dns.apl.afdlength",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, DNS_APL_AFDLENGTH,
|
|
|
|
"Address Length, in octets", HFILL }},
|
|
|
|
{ &hf_dns_nsap_rdata,
|
|
|
|
{ "NSAP Data", "dns.nsap.rdata",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0,
|
|
|
|
"NSAP Data", HFILL }}
|
1999-10-16 15:08:11 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_dns,
|
|
|
|
&ett_dns_qd,
|
|
|
|
&ett_dns_rr,
|
|
|
|
&ett_dns_qry,
|
|
|
|
&ett_dns_ans,
|
|
|
|
&ett_dns_flags,
|
2008-12-18 19:01:08 +00:00
|
|
|
&ett_nsec3_flags,
|
1999-11-27 08:59:28 +00:00
|
|
|
&ett_t_key_flags,
|
2003-01-26 01:00:05 +00:00
|
|
|
&ett_t_key,
|
2005-12-25 12:03:18 +00:00
|
|
|
&ett_dns_mac,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
2001-09-17 02:07:00 +00:00
|
|
|
module_t *dns_module;
|
1999-10-16 15:08:11 +00:00
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_dns = proto_register_protocol("Domain Name Service", "DNS", "dns");
|
1999-10-16 15:08:11 +00:00
|
|
|
proto_register_field_array(proto_dns, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2001-09-17 02:07:00 +00:00
|
|
|
|
|
|
|
dns_module = prefs_register_protocol(proto_dns, NULL);
|
|
|
|
prefs_register_bool_preference(dns_module, "desegment_dns_messages",
|
2004-08-21 09:02:52 +00:00
|
|
|
"Reassemble DNS messages spanning multiple TCP segments",
|
|
|
|
"Whether the DNS dissector should reassemble messages spanning multiple TCP segments."
|
|
|
|
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
|
2001-09-17 02:07:00 +00:00
|
|
|
&dns_desegment);
|
2005-12-25 12:03:18 +00:00
|
|
|
|
|
|
|
dns_tsig_dissector_table = register_dissector_table("dns.tsig.mac", "DNS TSIG MAC Dissectors", FT_STRING, BASE_NONE);
|
1999-07-29 05:47:07 +00:00
|
|
|
}
|
2000-04-04 06:17:30 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_dns(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t dns_udp_handle;
|
|
|
|
dissector_handle_t dns_tcp_handle;
|
2009-09-21 12:00:03 +00:00
|
|
|
dissector_handle_t dns_sctp_handle;
|
2002-12-01 20:50:52 +00:00
|
|
|
dissector_handle_t mdns_udp_handle;
|
2009-02-11 13:25:00 +00:00
|
|
|
dissector_handle_t llmnr_udp_handle;
|
2001-12-03 04:00:26 +00:00
|
|
|
|
|
|
|
dns_udp_handle = create_dissector_handle(dissect_dns_udp, proto_dns);
|
|
|
|
dns_tcp_handle = create_dissector_handle(dissect_dns_tcp, proto_dns);
|
2009-09-21 12:00:03 +00:00
|
|
|
dns_sctp_handle = create_dissector_handle(dissect_dns_sctp, proto_dns);
|
2002-12-01 20:50:52 +00:00
|
|
|
mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, proto_dns);
|
2009-02-11 13:25:00 +00:00
|
|
|
llmnr_udp_handle = create_dissector_handle(dissect_llmnr_udp, proto_dns);
|
2002-12-01 20:50:52 +00:00
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_add("udp.port", UDP_PORT_DNS, dns_udp_handle);
|
|
|
|
dissector_add("tcp.port", TCP_PORT_DNS, dns_tcp_handle);
|
2002-12-01 20:50:52 +00:00
|
|
|
dissector_add("udp.port", UDP_PORT_MDNS, mdns_udp_handle);
|
2002-08-19 16:02:45 +00:00
|
|
|
dissector_add("tcp.port", TCP_PORT_MDNS, dns_tcp_handle);
|
2009-02-11 13:25:00 +00:00
|
|
|
dissector_add("udp.port", UDP_PORT_LLMNR, llmnr_udp_handle);
|
2009-09-21 12:00:03 +00:00
|
|
|
dissector_add("sctp.port", SCTP_PORT_DNS, dns_sctp_handle);
|
|
|
|
#if 0
|
|
|
|
dissector_add("sctp.ppi", DNS_PAYLOAD_PROTOCOL_ID, dns_sctp_handle);
|
|
|
|
#endif
|
2003-01-26 01:00:05 +00:00
|
|
|
|
|
|
|
gssapi_handle = find_dissector("gssapi");
|
2004-11-21 21:23:30 +00:00
|
|
|
ntlmssp_handle = find_dissector("ntlmssp");
|
2005-12-25 12:03:18 +00:00
|
|
|
|
2000-04-04 06:17:30 +00:00
|
|
|
}
|