From 815415cda7589010e94143b7a637218363323eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Wed, 19 Oct 2022 16:13:50 +0100 Subject: [PATCH] DNS: Add documentation for get_dns_name() --- epan/dissectors/packet-dns.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-dns.h b/epan/dissectors/packet-dns.h index d53ff2763c..f68ec780f0 100644 --- a/epan/dissectors/packet-dns.h +++ b/epan/dissectors/packet-dns.h @@ -15,8 +15,17 @@ extern const value_string dns_classes[]; -/* Just like expand_dns_name, but pretty-prints empty names. */ -int get_dns_name(tvbuff_t *, int, int, int, const gchar **, gint*); +/* + * Expands DNS name from TVB into a byte string. + * + * Returns int: byte size of DNS data. + * Returns char *name: a dot (.) separated raw string of DNS domain name labels. + * This string is null terminated. Labels are copied directly from raw packet + * data without any validation for a string encoding. This is the callers responsibility. + * Return int name_len: byte length of "name". + */ +int get_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset, + const gchar **name, gint* name_len); #define MAX_DNAME_LEN 255 /* maximum domain name length */