Define some vars & fcns as static;

Also: do some minor reformmating and cleanup of whitespace.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34492 f5534014-38df-0310-8fa8-9805f1628bb7
This commit is contained in:
wmeier 2010-10-12 19:26:07 +00:00
parent 417a86a417
commit 3637948f9f
8 changed files with 613 additions and 598 deletions

View File

@ -71,7 +71,7 @@ typedef struct _info_data {
} info_data_t;
info_data_t info_data;
static info_data_t info_data;
/* open the info */
@ -103,99 +103,99 @@ static const char *
cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
int file_type)
{
const char *errmsg;
static char errmsg_errno[1024+1];
const char *errmsg;
static char errmsg_errno[1024+1];
if (err < 0) {
/* Wiretap error. */
switch (err) {
if (err < 0) {
/* Wiretap error. */
switch (err) {
case WTAP_ERR_NOT_REGULAR_FILE:
errmsg = "The file \"%s\" is a \"special file\" or socket or other non-regular file.";
break;
case WTAP_ERR_NOT_REGULAR_FILE:
errmsg = "The file \"%s\" is a \"special file\" or socket or other non-regular file.";
break;
case WTAP_ERR_FILE_UNKNOWN_FORMAT:
/* Seen only when opening a capture file for reading. */
errmsg = "The file \"%s\" isn't a capture file in a format TShark understands.";
break;
case WTAP_ERR_FILE_UNKNOWN_FORMAT:
/* Seen only when opening a capture file for reading. */
errmsg = "The file \"%s\" isn't a capture file in a format TShark understands.";
break;
case WTAP_ERR_UNSUPPORTED:
/* Seen only when opening a capture file for reading. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" isn't a capture file in a format TShark understands.\n"
"(%s)", err_info);
g_free(err_info);
errmsg = errmsg_errno;
break;
case WTAP_ERR_UNSUPPORTED:
/* Seen only when opening a capture file for reading. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" isn't a capture file in a format TShark understands.\n"
"(%s)", err_info);
g_free(err_info);
errmsg = errmsg_errno;
break;
case WTAP_ERR_CANT_WRITE_TO_PIPE:
/* Seen only when opening a capture file for writing. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" is a pipe, and %s capture files can't be "
"written to a pipe.", wtap_file_type_string(file_type));
errmsg = errmsg_errno;
break;
case WTAP_ERR_CANT_WRITE_TO_PIPE:
/* Seen only when opening a capture file for writing. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" is a pipe, and %s capture files can't be "
"written to a pipe.", wtap_file_type_string(file_type));
errmsg = errmsg_errno;
break;
case WTAP_ERR_UNSUPPORTED_FILE_TYPE:
/* Seen only when opening a capture file for writing. */
errmsg = "TShark doesn't support writing capture files in that format.";
break;
case WTAP_ERR_UNSUPPORTED_FILE_TYPE:
/* Seen only when opening a capture file for writing. */
errmsg = "TShark doesn't support writing capture files in that format.";
break;
case WTAP_ERR_UNSUPPORTED_ENCAP:
if (for_writing)
errmsg = "TShark can't save this capture in that format.";
else {
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" is a capture for a network type that TShark doesn't support.\n"
"(%s)", err_info);
g_free(err_info);
errmsg = errmsg_errno;
}
break;
case WTAP_ERR_UNSUPPORTED_ENCAP:
if (for_writing)
errmsg = "TShark can't save this capture in that format.";
else {
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" is a capture for a network type that TShark doesn't support.\n"
"(%s)", err_info);
g_free(err_info);
errmsg = errmsg_errno;
}
break;
case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED:
if (for_writing)
errmsg = "TShark can't save this capture in that format.";
else
errmsg = "The file \"%s\" is a capture for a network type that TShark doesn't support.";
break;
case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED:
if (for_writing)
errmsg = "TShark can't save this capture in that format.";
else
errmsg = "The file \"%s\" is a capture for a network type that TShark doesn't support.";
break;
case WTAP_ERR_BAD_RECORD:
/* Seen only when opening a capture file for reading. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" appears to be damaged or corrupt.\n"
"(%s)", err_info);
g_free(err_info);
errmsg = errmsg_errno;
break;
case WTAP_ERR_BAD_RECORD:
/* Seen only when opening a capture file for reading. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" appears to be damaged or corrupt.\n"
"(%s)", err_info);
g_free(err_info);
errmsg = errmsg_errno;
break;
case WTAP_ERR_CANT_OPEN:
if (for_writing)
errmsg = "The file \"%s\" could not be created for some unknown reason.";
else
errmsg = "The file \"%s\" could not be opened for some unknown reason.";
break;
case WTAP_ERR_CANT_OPEN:
if (for_writing)
errmsg = "The file \"%s\" could not be created for some unknown reason.";
else
errmsg = "The file \"%s\" could not be opened for some unknown reason.";
break;
case WTAP_ERR_SHORT_READ:
errmsg = "The file \"%s\" appears to have been cut short"
" in the middle of a packet or other data.";
break;
case WTAP_ERR_SHORT_READ:
errmsg = "The file \"%s\" appears to have been cut short"
" in the middle of a packet or other data.";
break;
case WTAP_ERR_SHORT_WRITE:
errmsg = "A full header couldn't be written to the file \"%s\".";
break;
case WTAP_ERR_SHORT_WRITE:
errmsg = "A full header couldn't be written to the file \"%s\".";
break;
default:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" could not be %s: %s.",
for_writing ? "created" : "opened",
wtap_strerror(err));
errmsg = errmsg_errno;
break;
}
} else
errmsg = file_open_error_message(err, for_writing);
return errmsg;
default:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" could not be %s: %s.",
for_writing ? "created" : "opened",
wtap_strerror(err));
errmsg = errmsg_errno;
break;
}
} else
errmsg = file_open_error_message(err, for_writing);
return errmsg;
}
/* new file arrived */
@ -266,84 +266,84 @@ void capture_info_close(void)
static void
capture_info_packet(packet_counts *counts, gint wtap_linktype, const guchar *pd, guint32 caplen, union wtap_pseudo_header *pseudo_header)
{
counts->total++;
switch (wtap_linktype) {
counts->total++;
switch (wtap_linktype) {
case WTAP_ENCAP_ETHERNET:
capture_eth(pd, 0, caplen, counts);
break;
capture_eth(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_FDDI:
case WTAP_ENCAP_FDDI_BITSWAPPED:
capture_fddi(pd, caplen, counts);
break;
capture_fddi(pd, caplen, counts);
break;
case WTAP_ENCAP_PRISM_HEADER:
capture_prism(pd, 0, caplen, counts);
break;
capture_prism(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_TOKEN_RING:
capture_tr(pd, 0, caplen, counts);
break;
capture_tr(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_NULL:
capture_null(pd, caplen, counts);
break;
capture_null(pd, caplen, counts);
break;
case WTAP_ENCAP_PPP:
capture_ppp_hdlc(pd, 0, caplen, counts);
break;
capture_ppp_hdlc(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_RAW_IP:
capture_raw(pd, caplen, counts);
break;
capture_raw(pd, caplen, counts);
break;
case WTAP_ENCAP_SLL:
capture_sll(pd, caplen, counts);
break;
capture_sll(pd, caplen, counts);
break;
case WTAP_ENCAP_LINUX_ATM_CLIP:
capture_clip(pd, caplen, counts);
break;
capture_clip(pd, caplen, counts);
break;
case WTAP_ENCAP_IEEE_802_11:
case WTAP_ENCAP_IEEE_802_11_WITH_RADIO:
capture_ieee80211(pd, 0, caplen, counts);
break;
capture_ieee80211(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_IEEE_802_11_WLAN_RADIOTAP:
capture_radiotap(pd, 0, caplen, counts);
break;
capture_radiotap(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_IEEE_802_11_WLAN_AVS:
capture_wlancap(pd, 0, caplen, counts);
break;
capture_wlancap(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_CHDLC:
capture_chdlc(pd, 0, caplen, counts);
break;
capture_chdlc(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_LOCALTALK:
capture_llap(counts);
break;
capture_llap(counts);
break;
case WTAP_ENCAP_ATM_PDUS:
capture_atm(pseudo_header, pd, caplen, counts);
break;
capture_atm(pseudo_header, pd, caplen, counts);
break;
case WTAP_ENCAP_IP_OVER_FC:
capture_ipfc(pd, caplen, counts);
break;
capture_ipfc(pd, caplen, counts);
break;
case WTAP_ENCAP_ARCNET:
capture_arcnet(pd, caplen, counts, FALSE, TRUE);
break;
capture_arcnet(pd, caplen, counts, FALSE, TRUE);
break;
case WTAP_ENCAP_ARCNET_LINUX:
capture_arcnet(pd, caplen, counts, TRUE, FALSE);
break;
capture_arcnet(pd, caplen, counts, TRUE, FALSE);
break;
case WTAP_ENCAP_APPLE_IP_OVER_IEEE1394:
capture_ap1394(pd, 0, caplen, counts);
break;
capture_ap1394(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_FRELAY:
case WTAP_ENCAP_FRELAY_WITH_PHDR:
capture_fr(pd, 0, caplen, counts);
break;
capture_fr(pd, 0, caplen, counts);
break;
case WTAP_ENCAP_ENC:
capture_enc(pd, caplen, counts);
break;
capture_enc(pd, caplen, counts);
break;
case WTAP_ENCAP_PPI:
capture_ppi(pd, caplen, counts);
break;
capture_ppi(pd, caplen, counts);
break;
case WTAP_ENCAP_I2C:
capture_i2c(pseudo_header, counts);
break;
/* XXX - some ATM drivers on FreeBSD might prepend a 4-byte ATM
pseudo-header to DLT_ATM_RFC1483, with LLC header following;
we might have to implement that at some point. */
}
capture_i2c(pseudo_header, counts);
break;
/* XXX - some ATM drivers on FreeBSD might prepend a 4-byte ATM
pseudo-header to DLT_ATM_RFC1483, with LLC header following;
we might have to implement that at some point. */
}
}

View File

@ -62,12 +62,12 @@ static GSList *color_filter_deleted_list = NULL;
static GSList *color_filter_valid_list = NULL;
/* Color Filters can en-/disabled. */
gboolean filters_enabled = TRUE;
static gboolean filters_enabled = TRUE;
/* Remember if there are temporary coloring filters set to
* add sensitivity to the "Reset Coloring 1-10" menu item
*/
gboolean tmp_colors_set = FALSE;
static gboolean tmp_colors_set = FALSE;
/* Create a new filter */
color_filter_t *
@ -266,11 +266,11 @@ color_filter_clone(color_filter_t *colorf)
static void
color_filter_list_clone_cb(gpointer filter_arg, gpointer cfl_arg)
{
GSList **cfl = (GSList **)cfl_arg;
color_filter_t *new_colorf;
GSList **cfl = (GSList **)cfl_arg;
color_filter_t *new_colorf;
new_colorf = color_filter_clone((color_filter_t *)filter_arg);
*cfl = g_slist_append(*cfl, new_colorf);
new_colorf = color_filter_clone((color_filter_t *)filter_arg);
*cfl = g_slist_append(*cfl, new_colorf);
}
/* clone the specified list */
@ -334,7 +334,7 @@ color_filters_clone_cb(gpointer filter_arg, gpointer user_data)
void
color_filters_clone(gpointer user_data)
{
g_slist_foreach(color_filter_list, color_filters_clone_cb, user_data);
g_slist_foreach(color_filter_list, color_filters_clone_cb, user_data);
}
@ -448,30 +448,30 @@ color_filters_colorize_packet(epan_dissect_t *edt)
color_filters_colorize_packet(gint row, epan_dissect_t *edt)
#endif
{
GSList *curr;
color_filter_t *colorf;
GSList *curr;
color_filter_t *colorf;
/* If we have color filters, "search" for the matching one. */
if (color_filters_used()) {
curr = color_filter_list;
/* If we have color filters, "search" for the matching one. */
if (color_filters_used()) {
curr = color_filter_list;
while(curr != NULL) {
colorf = (color_filter_t *)curr->data;
if ( (!colorf->disabled) &&
(colorf->c_colorfilter != NULL) &&
dfilter_apply_edt(colorf->c_colorfilter, edt)) {
/* this is the filter to use, apply it to the packet list */
while(curr != NULL) {
colorf = (color_filter_t *)curr->data;
if ( (!colorf->disabled) &&
(colorf->c_colorfilter != NULL) &&
dfilter_apply_edt(colorf->c_colorfilter, edt)) {
/* this is the filter to use, apply it to the packet list */
#ifndef NEW_PACKET_LIST
/* We'll do this in the column cell function instead. */
packet_list_set_colors(row, &(colorf->fg_color), &(colorf->bg_color));
/* We'll do this in the column cell function instead. */
packet_list_set_colors(row, &(colorf->fg_color), &(colorf->bg_color));
#endif
return colorf;
}
curr = g_slist_next(curr);
}
}
return colorf;
}
curr = g_slist_next(curr);
}
}
return NULL;
return NULL;
}
/* read filters from the given file */
@ -711,8 +711,8 @@ color_filters_import(gchar *path, gpointer user_data)
struct write_filter_data
{
FILE * f;
gboolean only_selected;
FILE * f;
gboolean only_selected;
};
/* save a single filter */

View File

@ -62,12 +62,12 @@
typedef struct _fileset {
GList *entries;
char *dirname;
GList *entries;
char *dirname;
} fileset;
/* this is the fileset's global data */
fileset set = { NULL, NULL};
static fileset set = { NULL, NULL};
/* is this a probable file of a file set (does the naming pattern match)? */
@ -263,8 +263,8 @@ fileset_add_dir(const char *fname)
if(fileset_filename_match_pattern(fname)) {
/* yes, go through the files in the directory and check if the file in question is part of the current file set */
if ((dir = ws_dir_open(dirname->str, 0, NULL)) != NULL) {
while ((file = ws_dir_read_name(dir)) != NULL) {
name = ws_dir_get_name(file);
while ((file = ws_dir_read_name(dir)) != NULL) {
name = ws_dir_get_name(file);
if(fileset_filename_match_pattern(name) && fileset_is_file_in_set(name, get_basename(fname))) {
fileset_add_file(dirname->str, name, strcmp(name, get_basename(fname))== 0 /* current */);
}

View File

@ -811,7 +811,7 @@ create_preference_option_menu(GtkWidget *main_tb, int table_position,
menu_idx = 0;
for (enum_valp = enumvals, idx = 0; enum_valp->name != NULL;
enum_valp++, idx++) {
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), enum_valp->description);
gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), enum_valp->description);
if (enum_valp->value == current_val)
menu_idx = idx;
}
@ -846,9 +846,9 @@ fetch_preference_option_menu_val(GtkWidget *combo_box, const enum_val_t *enumval
*/
int i;
i = gtk_combo_box_get_active (GTK_COMBO_BOX(combo_box));
i = gtk_combo_box_get_active (GTK_COMBO_BOX(combo_box));
return enumvals[i].value;
return enumvals[i].value;
}
GtkWidget *
@ -1712,7 +1712,7 @@ tree_expand_row(GtkTreeModel *model, GtkTreeView *tree_view, GtkTreeIter *iter)
/* select a node in the tree view */
/* XXX - this is almost 100% copied from byte_view_select() in proto_draw.c,
* find a way to combine both to have a generic function for this */
void
static void
tree_select_node(GtkWidget *tree, prefs_tree_iter *iter)
{
GtkTreeIter local_iter = *iter;

View File

@ -100,7 +100,7 @@
static gboolean initialized = FALSE;
voip_calls_tapinfo_t *voip_calls = NULL;
static voip_calls_tapinfo_t *voip_calls = NULL;
/* Hash table with all the RTP streams */
static GHashTable* rtp_streams_hash = NULL;
@ -159,9 +159,9 @@ typedef struct _sample_t {
#define MAX_NUM_COL_CONV 10
#if PORTAUDIO_API_1
PortAudioStream *pa_stream;
static PortAudioStream *pa_stream;
#else /* PORTAUDIO_API_1 */
PaStream *pa_stream;
static PaStream *pa_stream;
#endif /* PORTAUDIO_API_1 */
/* defines a RTP stream */

File diff suppressed because it is too large Load Diff

View File

@ -66,14 +66,14 @@
#define SUB_32(a, b) a-b
#define POINT_SIZE 3
GtkWidget * sack_bt;
static GtkWidget * sack_bt;
/*
/*
* Global variables that help in redrawing graph
* for SACK and NRSACK
*/
guint8 gIsSackChunkPresent = 0;
guint8 gIsNRSackChunkPresent = 0;
static guint8 gIsSackChunkPresent = 0;
static guint8 gIsNRSackChunkPresent = 0;
struct chunk_header {
guint8 type;
@ -140,7 +140,8 @@ static GtkWidget *zoomout_bt;
static int rint (double ); /* compiler template for Windows */
#endif
static void draw_sack_graph(struct sctp_udata *u_data)
static void
draw_sack_graph(struct sctp_udata *u_data)
{
tsn_t *sack;
GList *list=NULL, *tlist;
@ -162,7 +163,7 @@ static void draw_sack_graph(struct sctp_udata *u_data)
green_gc = gdk_gc_new(u_data->io->draw_area->window);
gdk_gc_set_rgb_fg_color(green_gc, &green_color);
cyan_gc = gdk_gc_new(u_data->io->draw_area->window);
gdk_gc_set_rgb_fg_color(cyan_gc, &cyan_color);
@ -253,7 +254,7 @@ static void draw_sack_graph(struct sctp_udata *u_data)
diff=sack->secs*1000000+sack->usecs-u_data->io->min_x;
xvalue = (guint32)(LEFT_BORDER+u_data->io->offset+u_data->io->x_interval*diff);
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-POINT_SIZE &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
@ -278,7 +279,7 @@ static void draw_sack_graph(struct sctp_udata *u_data)
diff=sack->secs*1000000+sack->usecs-u_data->io->min_x;
xvalue = (guint32)(LEFT_BORDER+u_data->io->offset+u_data->io->x_interval*diff);
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(dup,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-POINT_SIZE &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
@ -299,14 +300,15 @@ static void draw_sack_graph(struct sctp_udata *u_data)
g_object_unref(G_OBJECT(green_gc));
}
/*
/*
* This function plots the NR_SACK gap ack and
* nr gap acks.
* Red dot - Cumulative TSN ack
* Green dot - Gap ack
* Red dot - Cumulative TSN ack
* Green dot - Gap ack
* Blue circle - NR Gap ack
*/
static void draw_nr_sack_graph(struct sctp_udata *u_data)
static void
draw_nr_sack_graph(struct sctp_udata *u_data)
{
tsn_t *sack;
GList *list=NULL, *tlist;
@ -322,8 +324,8 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
struct gaps *nr_gap;
guint32 max_num, diff;
/* This holds the sum of gap acks and nr gap acks */
guint16 total_gaps = 0;
guint16 total_gaps = 0;
red_gc = gdk_gc_new(u_data->io->draw_area->window);
gdk_gc_set_rgb_fg_color(red_gc, &red_color);
blue_gc = gdk_gc_new(u_data->io->draw_area->window);
@ -366,8 +368,8 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
tlist = g_list_first(sack->tsns);
while (tlist)
{
type = ((struct chunk_header *)tlist->data)->type;
/*
type = ((struct chunk_header *)tlist->data)->type;
/*
* The tlist->data is memcpy ied to the appropriate structure
* They entire raw tvb bytes are copied on to one of the *_chunk_header
* structures in sctp_stat.c
@ -405,7 +407,7 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
{
/* Check if this is an GAP ACK or NR GAP ACK */
if ( i >= numberOf_gaps)
if ( i >= numberOf_gaps)
{
/* This is a nr gap ack */
gdk_draw_arc(u_data->io->pixmap,blue_gc,FALSE,
@ -440,7 +442,7 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
}
else
max_num=tsnumber;
if (tsnumber>=min_tsn)
{
if (u_data->io->uoff)
@ -449,7 +451,7 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
diff=sack->secs*1000000+sack->usecs-u_data->io->min_x;
xvalue = (guint32)(LEFT_BORDER+u_data->io->offset+u_data->io->x_interval*diff);
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE -u_data->io->offset-((SUB_32(tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-POINT_SIZE &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
@ -469,7 +471,8 @@ static void draw_nr_sack_graph(struct sctp_udata *u_data)
g_object_unref(G_OBJECT(green_gc));
}
static void draw_tsn_graph(struct sctp_udata *u_data)
static void
draw_tsn_graph(struct sctp_udata *u_data)
{
tsn_t *tsn;
GList *list=NULL, *tlist;
@ -524,7 +527,7 @@ static void draw_tsn_graph(struct sctp_udata *u_data)
diff=tsn->secs*1000000+tsn->usecs-u_data->io->min_x;
xvalue = (guint32)(LEFT_BORDER+u_data->io->offset+u_data->io->x_interval*diff);
yvalue = (guint32)(u_data->io->pixmap_height-BOTTOM_BORDER-POINT_SIZE-u_data->io->offset-((SUB_32(tsnumber,min_tsn))*u_data->io->y_interval));
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
if (xvalue >= LEFT_BORDER+u_data->io->offset &&
xvalue <= u_data->io->pixmap_width-RIGHT_BORDER+u_data->io->offset &&
yvalue >= TOP_BORDER-u_data->io->offset-POINT_SIZE &&
yvalue <= u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)
@ -540,7 +543,8 @@ static void draw_tsn_graph(struct sctp_udata *u_data)
}
static void sctp_graph_draw(struct sctp_udata *u_data)
static void
sctp_graph_draw(struct sctp_udata *u_data)
{
int length, lwidth;
guint32 distance=5, i, e, sec, w, start, a, b, j;
@ -669,7 +673,7 @@ static void sctp_graph_draw(struct sctp_udata *u_data)
if (w==0)
w=1;
if (w==4 || w==3 || w==2)
{
w=5;
@ -681,9 +685,9 @@ static void sctp_graph_draw(struct sctp_udata *u_data)
a=distance/5;
b=0;
}
if (!u_data->io->uoff)
if (!u_data->io->uoff)
{
if (a>=1000000)
{
@ -706,7 +710,7 @@ static void sctp_graph_draw(struct sctp_udata *u_data)
if (start%2!=0)
start--;
b = 0;
}
for (i=start, j=b; i<=u_data->io->max_x; i+=a, j++)
@ -769,7 +773,7 @@ static void sctp_graph_draw(struct sctp_udata *u_data)
layout);
write_label = FALSE;
}
}
g_strlcpy(label_string, "sec", sizeof(label_string));
@ -845,7 +849,8 @@ static void sctp_graph_draw(struct sctp_udata *u_data)
* If an association has both SAKC and NR_SACK PDU's
* a warning is popped
*/
void updateLabels(void)
static void
updateLabels(void)
{
if (gIsSackChunkPresent && gIsNRSackChunkPresent)
{
@ -859,7 +864,8 @@ void updateLabels(void)
gtk_button_set_label( (GtkButton*) sack_bt, "Show Only NR Sack");
}
static void sctp_graph_redraw(struct sctp_udata *u_data)
static void
sctp_graph_redraw(struct sctp_udata *u_data)
{
sctp_graph_t *ios;
@ -869,8 +875,8 @@ sctp_graph_t *ios;
switch (u_data->io->graph_type)
{
case 0:
/* Show both TSN and SACK information
* Reset the global sack variable
/* Show both TSN and SACK information
* Reset the global sack variable
* for sack and nr sack cases
*/
gIsSackChunkPresent = 0;
@ -884,8 +890,8 @@ sctp_graph_t *ios;
draw_tsn_graph(u_data);
break;
case 2:
/* Show only SACK information
* Reset the global sack variable
/* Show only SACK information
* Reset the global sack variable
* for sack and nr sack cases
*/
gIsSackChunkPresent = 0;
@ -914,7 +920,8 @@ sctp_graph_t *ios;
}
static void on_sack_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
static void
on_sack_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
{
u_data = (struct sctp_udata *) u_data;
@ -922,14 +929,16 @@ static void on_sack_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
sctp_graph_redraw(u_data);
}
static void on_tsn_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
static void
on_tsn_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
{
u_data->io->graph_type=1;
sctp_graph_redraw(u_data);
}
static void on_both_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
static void
on_both_bt(GtkWidget *widget _U_, struct sctp_udata *u_data)
{
u_data->io->graph_type=0;
@ -1060,7 +1069,7 @@ zoomin_bt_fcn (struct sctp_udata *u_data)
u_data->io->rectangle_present=FALSE;
gtk_widget_set_sensitive(zoomout_bt, TRUE);
sctp_graph_redraw(u_data);
}
@ -1220,14 +1229,14 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
}
if (u_data->io->uoff)
{
if (x2_tmp - x1_tmp <= 1500)
if (x2_tmp - x1_tmp <= 1500)
u_data->io->uoff = FALSE;
u_data->io->x1_tmp_sec=(guint32)x1_tmp;
u_data->io->x1_tmp_usec=0;
u_data->io->x2_tmp_sec=(guint32)x2_tmp;
u_data->io->x2_tmp_usec=0;
}
else
else
{
u_data->io->x1_tmp_sec=(guint32)x1_tmp/1000000;
u_data->io->x1_tmp_usec=x1_tmp%1000000;
@ -1254,7 +1263,7 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
if (u_data->io->rectangle_present==TRUE)
{
u_data->io->rectangle_present=FALSE;
if (event->x >= u_data->io->rect_x_min && event->x <= u_data->io->rect_x_max &&
if (event->x >= u_data->io->rect_x_min && event->x <= u_data->io->rect_x_max &&
event->y >= u_data->io->rect_y_min && event->y <= u_data->io->rect_y_max)
zoomin_bt_fcn(u_data);
else
@ -1371,7 +1380,8 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
}
static void init_sctp_graph_window(struct sctp_udata *u_data)
static void
init_sctp_graph_window(struct sctp_udata *u_data)
{
GtkWidget *vbox;
GtkWidget *hbox;
@ -1439,7 +1449,8 @@ static void init_sctp_graph_window(struct sctp_udata *u_data)
gtk_widget_show(u_data->io->window);
}
static void sctp_graph_set_title(struct sctp_udata *u_data)
static void
sctp_graph_set_title(struct sctp_udata *u_data)
{
char *title;
@ -1515,7 +1526,8 @@ quit(GtkObject *object _U_, gpointer user_data)
}
static void create_draw_area(GtkWidget *box, struct sctp_udata *u_data)
static void
create_draw_area(GtkWidget *box, struct sctp_udata *u_data)
{
u_data->io->draw_area=gtk_drawing_area_new();
@ -1534,7 +1546,8 @@ static void create_draw_area(GtkWidget *box, struct sctp_udata *u_data)
void create_graph(guint16 dir, struct sctp_analyse* userdata)
void
create_graph(guint16 dir, struct sctp_analyse* userdata)
{
struct sctp_udata *u_data;
@ -1556,7 +1569,8 @@ void create_graph(guint16 dir, struct sctp_analyse* userdata)
#if defined(_WIN32) && !defined(__MINGW32__)
/* replacement of Unix rint() for Windows */
static int rint (double x)
static int
rint (double x)
{
char *buf;
int i,dec,sig;

View File

@ -280,7 +280,7 @@ alloc_wlan_details_ep (address *addr)
return d_ep;
}
wlan_details_ep_t *
static wlan_details_ep_t *
get_details_ep (wlan_ep_t *te, address *addr)
{
wlan_details_ep_t *tmp, *d_te = NULL;