diff options
author | Jörg Mayer <jmayer@loplof.de> | 2007-03-22 15:19:49 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2007-03-22 15:19:49 +0000 |
commit | a8f4da5eadbc5f909f8f80a8aa8cd1b3a61b247d (patch) | |
tree | f0f28e505db78b085e34bab50e41b0db48ed240e | |
parent | 2202f3fb0cc46e2322c634b10dedbf08fad344d8 (diff) |
Sebastien Tandel:
some warning fixes
packet-http.c
set headers.content_length = 0 before the first potential use of it.
packet-kink.c
"ifdef kerberos" around one function declaration
packet-nbns.c
set headers.{dgm_length|pkt_offset|error_code} = 0
packet-pflog.c
delete capture_pflog and
capture_old_pflog which aren't used anymore in the code.
svn path=/trunk/; revision=21120
-rw-r--r-- | epan/dissectors/packet-http.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-kink.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-nbns.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-pflog.c | 77 |
4 files changed, 9 insertions, 77 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index bc10bc2990..a97af073dd 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -629,6 +629,7 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo, headers.content_type = NULL; /* content type not known yet */ headers.content_type_parameters = NULL; /* content type parameters too */ headers.have_content_length = FALSE; /* content length not known yet */ + headers.content_length = 0; /* content length set to 0 (avoid a gcc warning) */ headers.content_encoding = NULL; /* content encoding not known yet */ headers.transfer_encoding = NULL; /* transfer encoding not known yet */ saw_req_resp_or_header = FALSE; /* haven't seen anything yet */ diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c index ff309c27ef..0a58ebe8c2 100644 --- a/epan/dissectors/packet-kink.c +++ b/epan/dissectors/packet-kink.c @@ -174,7 +174,9 @@ static void dissect_payload_kink_isakmp(packet_info *pinfo, tvbuff_t *tvb, int o static void dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree); static void dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree); static void dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree); +#ifdef HAVE_KERBEROS static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length); +#endif /* This function is dissecting the kink header. */ static void @@ -777,6 +779,7 @@ dissect_payload_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, int offset, prot } } +#ifdef HAVE_KERBEROS static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree, int payload_length){ @@ -800,6 +803,7 @@ dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree control_payload(pinfo, tvb, offset, next_payload, decrypt_kink_encrypt_tree); } +#endif static void dissect_payload_kink_error(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree){ diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c index f236d6c1a5..1932011854 100644 --- a/epan/dissectors/packet-nbns.c +++ b/epan/dissectors/packet-nbns.c @@ -1225,6 +1225,10 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) header.src_ip = tvb_get_ipv4(tvb, offset+4); header.src_port = tvb_get_ntohs(tvb, offset+8); + /* avoid gcc warnings */ + header.dgm_length = 0; + header.pkt_offset = 0; + header.error_code = 0; switch (header.msg_type) { case NBDS_DIRECT_UNIQUE: diff --git a/epan/dissectors/packet-pflog.c b/epan/dissectors/packet-pflog.c index 122eeb8e27..bce720a354 100644 --- a/epan/dissectors/packet-pflog.c +++ b/epan/dissectors/packet-pflog.c @@ -78,48 +78,6 @@ static int hf_old_pflog_dir = -1; static gint ett_old_pflog = -1; -static void -capture_pflog(const guchar *pd, int offset, int len, packet_counts *ld) -{ - const struct pfloghdr *pflogh; - unsigned int hdrlen; - - pflogh = (const struct pfloghdr *)pd; - - if (!BYTES_ARE_IN_FRAME(offset, len, sizeof(guint8))) { - ld->other++; - return; - } - - if (pflogh->length < MIN_PFLOG_HDRLEN) { - ld->other++; - return; - } - hdrlen = BPF_WORDALIGN(pflogh->length); - if (!BYTES_ARE_IN_FRAME(offset, hdrlen, sizeof(guint8))) { - ld->other++; - return; - } - offset += hdrlen; - - switch (pflogh->af) { - - case BSD_PF_INET: - capture_ip(pd, offset, len, ld); - break; - -#ifdef notyet - case BSD_PF_INET6: - capture_ipv6(pd, offset, len, ld); - break; -#endif - - default: - ld->other++; - break; - } -} - static const value_string af_vals[] = { { BSD_PF_INET, "IPv4" }, { BSD_PF_INET6, "IPv6" }, @@ -316,41 +274,6 @@ proto_reg_handoff_pflog(void) dissector_add("wtap_encap", WTAP_ENCAP_PFLOG, pflog_handle); } - -static void -capture_old_pflog(const guchar *pd, int offset, int len, packet_counts *ld) -{ - struct old_pfloghdr pflogh; - - if (!BYTES_ARE_IN_FRAME(offset, len, (int)OLD_PFLOG_HDRLEN)) { - ld->other++; - return; - } - - offset += OLD_PFLOG_HDRLEN; - - /* Copy out the pflog header to insure alignment */ - memcpy(&pflogh, pd, sizeof(pflogh)); - pflogh.af = g_ntohl(pflogh.af); - - switch (pflogh.af) { - - case BSD_PF_INET: - capture_ip(pd, offset, len, ld); - break; - -#ifdef notyet - case BSD_PF_INET6: - capture_ipv6(pd, offset, len, ld); - break; -#endif - - default: - ld->other++; - break; - } -} - static void dissect_old_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { |