* time, so that we only need one Ethereal binary and one Tethereal binary
* for Windows, regardless of whether WinPcap is installed or not.
*
- * $Id: capture-wpcap.c,v 1.7 2003/12/21 12:18:59 ulfl Exp $
+ * $Id: capture-wpcap.c,v 1.8 2004/01/05 19:31:42 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
j = 0;
while (names[i] != 0) {
if (j < MAX_WIN_IF_NAME_LEN)
- ascii_name[j++] = names[i++];
+ ascii_name[j++] = (char) names[i++];
}
ascii_name[j] = '\0';
i++;
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.220 2003/12/21 12:18:59 ulfl Exp $
+ * $Id: capture.c,v 1.221 2004/01/05 19:31:43 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
char sautostop_filesize[24]; /* need a constant for len of numbers */
char sautostop_duration[24]; /* need a constant for len of numbers */
char save_file_fd[24];
+#ifndef _WIN32
char errmsg[1024+1];
+#endif
int error;
int argc;
char **argv;
char errmsg[4096+1];
gboolean write_ok;
gboolean close_ok;
- fd_set set1;
- struct timeval timeout;
capture_info capture_ui;
#ifdef _WIN32
WORD wVersionRequested;
WSADATA wsaData;
#else
+ fd_set set1;
+ struct timeval timeout;
static const char ppamsg[] = "can't find PPA for ";
char *libpcap_warn;
int sel_ret;
* Routines for AppleTalk packet disassembly: LLAP, DDP, NBP, ATP, ASP,
* RTMP.
*
- * $Id: packet-atalk.c,v 1.91 2003/11/16 23:17:16 guy Exp $
+ * $Id: packet-atalk.c,v 1.92 2004/01/05 19:31:43 ulfl Exp $
*
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
*
}
if (utf_ofs) {
ofs = utf_ofs;
- len = tvb_get_ntohs(tvb, ofs);
+ len = (guint8) tvb_get_ntohs(tvb, ofs);
proto_tree_add_item(tree, hf_asp_server_utf8_name_len, tvb, ofs, 2, FALSE);
ofs += 2;
proto_tree_add_item(tree, hf_asp_server_utf8_name, tvb, ofs, len, FALSE);
if (!aspinfo)
return;
- fn = aspinfo->command;
+ fn = (guint8) aspinfo->command;
if (check_col(pinfo->cinfo, COL_INFO)) {
if (aspinfo->reply)
if (!aspinfo)
return;
- fn = aspinfo->command;
+ fn = (guint8) aspinfo->command;
if (check_col(pinfo->cinfo, COL_INFO)) {
if (aspinfo->reply)
* Routines for BGP packet dissection.
* Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org>
*
- * $Id: packet-bgp.c,v 1.82 2003/06/03 23:49:59 guy Exp $
+ * $Id: packet-bgp.c,v 1.83 2004/01/05 19:31:43 ulfl Exp $
*
* Supports:
* RFC1771 A Border Gateway Protocol 4 (BGP-4)
case SAFNUM_LAB_VPNUNICAST:
case SAFNUM_LAB_VPNMULCAST:
case SAFNUM_LAB_VPNUNIMULC:
- plen = tvb_get_ntohs(tvb,offset);
+ plen = (guint8) tvb_get_ntohs(tvb,offset);
rd_type=tvb_get_ntohs(tvb,offset+2);
ce_id=tvb_get_ntohs(tvb,offset+10);
labblk_off=tvb_get_ntohs(tvb,offset+12);
*
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
*
- * $Id: packet-cops.c,v 1.39 2003/12/21 05:51:32 jmayer Exp $
+ * $Id: packet-cops.c,v 1.40 2004/01/05 19:31:43 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
subtree = get_tree(variable_oid,variable_oid_length, subtree);
if (subtree->type == 0)
- variable->type=type_from_packet;
+ variable->type= (guint8)type_from_packet;
buf_len = SPRINT_MAX_LEN; /*defined in NET-SNMP's snmp-impl.h*/
buf = g_malloc(buf_len);
/* packet-dns.c
* Routines for DNS packet disassembly
*
- * $Id: packet-dns.c,v 1.116 2003/12/19 23:13:42 guy Exp $
+ * $Id: packet-dns.c,v 1.117 2004/01/05 19:31:43 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* To do: check for errs, etc. */
id = tvb_get_ntohs(tvb, offset + DNS_ID);
flags = tvb_get_ntohs(tvb, offset + DNS_FLAGS);
- opcode = (flags & F_OPCODE) >> OPCODE_SHIFT;
- rcode = (flags & F_RCODE);
+ opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
+ rcode = (guint16) (flags & F_RCODE);
if (check_col(pinfo->cinfo, COL_INFO)) {
strcpy(buf, val_to_str(opcode, opcode_vals, "Unknown operation (%u)"));
* Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com>
* Nicolas Balkota <balkota@mac.com>
*
- * $Id: packet-gtp.c,v 1.69 2003/11/29 03:55:31 guy Exp $
+ * $Id: packet-gtp.c,v 1.70 2004/01/05 19:31:43 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
retval = length + 1;
break;
case 2:
- length = tvb_get_ntohs (tvb, offset + 1);
+ length = (guint8) tvb_get_ntohs (tvb, offset + 1);
te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", qos_str);
ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos);
proto_tree_add_text (ext_tree_qos, tvb, offset + 1, 2, "Length: %u", length);
* to when it had only NBNS)
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-nbns.c,v 1.80 2002/09/12 00:10:58 tpot Exp $
+ * $Id: packet-nbns.c,v 1.81 2004/01/05 19:31:44 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
proto_tree *field_tree;
proto_item *tf;
- opcode = (flags & F_OPCODE) >> OPCODE_SHIFT;
+ opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
strcpy(buf, val_to_str(opcode, opcode_vals, "Unknown operation"));
if (flags & F_RESPONSE && !is_wack) {
strcat(buf, " response");
/* To do: check for runts, errs, etc. */
id = tvb_get_ntohs(tvb, offset + NBNS_ID);
flags = tvb_get_ntohs(tvb, offset + NBNS_FLAGS);
- opcode = (flags & F_OPCODE) >> OPCODE_SHIFT;
- rcode = (flags & F_RCODE);
+ opcode = (guint16) ((flags & F_OPCODE) >> OPCODE_SHIFT);
+ rcode = (guint16) (flags & F_RCODE);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s",
break;
case NBDS_ERROR:
- header.error_code = tvb_get_ntohs(tvb, offset+10);
+ header.error_code = (guint8) tvb_get_ntohs(tvb, offset+10);
break;
}
* Routines for OSPF packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-ospf.c,v 1.78 2003/12/21 04:31:56 jmayer Exp $
+ * $Id: packet-ospf.c,v 1.79 2004/01/05 19:31:44 ulfl Exp $
*
* At this time, this module is able to analyze OSPF
* packets as specified in RFC2328. MOSPF (RFC1584) and other
tvb, offset, 4, FALSE);
break;
case OSPF_VERSION_3:
- reserved = tvb_get_ntohs(tvb, offset);
+ reserved = (guint8) tvb_get_ntohs(tvb, offset);
proto_tree_add_text(ospf_lsr_tree, tvb, offset, 2,
(reserved == 0 ? "Reserved: %u" : "Reserved: %u (incorrect, should be 0)"), reserved);
ls_type = tvb_get_ntohs(tvb, offset+2);
/* again: flags should be secified in detail */
proto_tree_add_text(ospf_lsa_tree, tvb, offset, 1, "Flags: 0x%02x",
tvb_get_guint8(tvb, offset));
- nr_links = tvb_get_ntohs(tvb, offset + 2);
+ nr_links = (guint8) tvb_get_ntohs(tvb, offset + 2);
proto_tree_add_text(ospf_lsa_tree, tvb, offset + 2, 2, "Number of Links: %u",
nr_links);
offset += 4;
* Common routines for smb packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-common.c,v 1.18 2003/06/12 08:33:30 guy Exp $
+ * $Id: packet-smb-common.c,v 1.19 2004/01/05 19:31:44 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
charoffset = offset;
p = str;
while ((character = tvb_get_letohs(tvb, charoffset)) != '\0') {
- *p++ = character;
+ *p++ = (char) character;
charoffset += 2;
}
*p = '\0';
}
if (len > 0) {
if ((uchar & 0xFF00) == 0)
- *p++ = uchar; /* ISO 8859-1 */
+ *p++ = (gchar) uchar; /* ISO 8859-1 */
else
*p++ = '?'; /* not 8859-1 */
len--;
/* packet-vines.c
* Routines for Banyan VINES protocol packet disassembly
*
- * $Id: packet-vines.c,v 1.61 2004/01/01 21:35:49 guy Exp $
+ * $Id: packet-vines.c,v 1.62 2004/01/05 19:31:44 ulfl Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
/*
* Non-sequenced ARP.
*/
- packet_type = tvb_get_ntohs(tvb, 0);
+ packet_type = (guint8) tvb_get_ntohs(tvb, 0);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(packet_type, vines_arp_packet_type_vals,
/* packet-artnet.c
* Routines for Art-Net packet disassembly
*
- * $Id: packet-artnet.c,v 1.5 2003/11/17 20:57:11 guy Exp $
+ * $Id: packet-artnet.c,v 1.6 2004/01/05 19:28:54 ulfl Exp $
*
* Copyright (c) 2003 by Erwin Rol <erwin@erwinrol.com>
*
offset, 2, FALSE);
offset += 2;
- pos_x = tvb_get_ntohs(tvb, offset);
+ pos_x = (guint8) tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(tree, hf_artnet_video_data_pos_x, tvb,
offset, 1, pos_x);
offset += 1;
- pos_y = tvb_get_ntohs(tvb, offset);
+ pos_y = (guint8) tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(tree, hf_artnet_video_data_pos_y, tvb,
offset, 1, pos_y);
offset += 1;
- len_x = tvb_get_ntohs(tvb, offset);
+ len_x = (guint8) tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(tree, hf_artnet_video_data_len_x, tvb,
offset, 1, len_x);
offset += 1;
- len_y = tvb_get_ntohs(tvb, offset);
+ len_y = (guint8) tvb_get_ntohs(tvb, offset);
proto_tree_add_uint(tree, hf_artnet_video_data_len_y, tvb,
offset, 1, len_y);
offset += 1;
* Routines for Ranging Response Message dissection
* Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
*
- * $Id: packet-rngrsp.c,v 1.6 2003/12/13 03:18:38 guy Exp $
+ * $Id: packet-rngrsp.c,v 1.7 2004/01/05 19:28:34 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
{
val = i;
}
- return (val);
+ return (gint8) (val);
}
gint16
static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_ ) {
- gboolean be _U_; /* big endianess */
+ /*gboolean be _U_;*/ /* big endianess */
static gboolean decode_user_exception(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, int *offset _U_, MessageHeader *header _U_, gchar *operation _U_ ) {
- gboolean be _U_; /* big endianess */
+ /*gboolean be _U_;*/ /* big endianess */
* By Steve Limkemann <stevelim@dgtech.com>
* Copyright 1998 Steve Limkemann
*
- * $Id: packet-gryphon.c,v 1.43 2003/11/04 18:37:32 guy Exp $
+ * $Id: packet-gryphon.c,v 1.44 2004/01/05 19:27:50 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*/
ts.lng[1] = tvb_get_ntohl(tvb, offset);
ts.lng[0] = tvb_get_ntohl(tvb, offset + 4);
- timestamp = ts.lnglng / 100000L;
+ timestamp = (time_t) (ts.lnglng / 100000L);
strncpy (date, ctime(×tamp), sizeof(date));
date[strlen(date)-1] = 0x00;
proto_tree_add_text(pt, tvb, offset, 8, "Date/Time: %s", date);
/* prefs.c
* Routines for handling preferences
*
- * $Id: prefs.c,v 1.119 2003/12/31 09:58:56 guy Exp $
+ * $Id: prefs.c,v 1.120 2004/01/05 19:31:44 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#define PRS_CAP_REAL_TIME "capture.real_time_update"
#define PRS_CAP_AUTO_SCROLL "capture.auto_scroll"
-#define RED_COMPONENT(x) ((((x) >> 16) & 0xff) * 65535 / 255)
-#define GREEN_COMPONENT(x) ((((x) >> 8) & 0xff) * 65535 / 255)
-#define BLUE_COMPONENT(x) (((x) & 0xff) * 65535 / 255)
+#define RED_COMPONENT(x) (guint16) (((((x) >> 16) & 0xff) * 65535 / 255))
+#define GREEN_COMPONENT(x) (guint16) (((((x) >> 8) & 0xff) * 65535 / 255))
+#define BLUE_COMPONENT(x) (guint16) ( (((x) & 0xff) * 65535 / 255))
static gchar *pr_formats[] = { "text", "postscript" };
static gchar *pr_dests[] = { "command", "file" };
/* tethereal.c
*
- * $Id: tethereal.c,v 1.213 2004/01/03 18:40:07 sharpe Exp $
+ * $Id: tethereal.c,v 1.214 2004/01/05 19:31:44 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
bpf_u_int32 netnum, netmask;
struct bpf_program fcode;
const char *set_linktype_err_str;
- void (*oldhandler)(int);
int err = 0;
int volatile volatile_err = 0;
int volatile inpkts = 0;
condition *volatile cnd_stop_capturesize = NULL;
condition *volatile cnd_stop_timeout = NULL;
#ifndef _WIN32
+ void (*oldhandler)(int);
static const char ppamsg[] = "can't find PPA for ";
char *libpcap_warn;
volatile int pipe_fd = -1;
*
* (c) Copyright 2001 Ashok Narayanan <ashokn@cisco.com>
*
- * $Id: text2pcap.c,v 1.27 2003/12/21 04:31:57 jmayer Exp $
+ * $Id: text2pcap.c,v 1.28 2004/01/05 19:31:44 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
unsigned long num;
num = parse_num(str, FALSE);
- packet_buf[curr_offset] = num;
+ packet_buf[curr_offset] = (unsigned char) num;
curr_offset ++;
if (curr_offset >= max_offset) /* packet full */
start_new_packet();
/* Write IP header */
if (hdr_ip) {
HDR_IP.packet_length = g_htons(ip_length);
- HDR_IP.protocol = hdr_ip_proto;
+ HDR_IP.protocol = (guint8) hdr_ip_proto;
HDR_IP.hdr_checksum = 0;
HDR_IP.hdr_checksum = in_checksum(&HDR_IP, sizeof(HDR_IP));
fwrite(&HDR_IP, sizeof(HDR_IP), 1, output_file);
pseudoh.src_addr = HDR_IP.src_addr;
pseudoh.dest_addr = HDR_IP.dest_addr;
pseudoh.zero = 0;
- pseudoh.protocol = hdr_ip_proto;
+ pseudoh.protocol = (guint8) hdr_ip_proto;
pseudoh.length = g_htons(proto_length);
/* Write UDP header */