rtp_stream: fix indent (use 4 spaces)

Add also modelines info

Change-Id: I4c4c6d7e292ba387aacb3f71afcac756b2875847
Reviewed-on: https://code.wireshark.org/review/5345
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2014-11-16 16:42:32 +01:00 committed by Michael Mann
parent b867baf800
commit 7213ad53f8
1 changed files with 83 additions and 70 deletions

View File

@ -53,7 +53,7 @@
/* The one and only global rtpstream_tapinfo_t structure for tshark and wireshark.
*/
static rtpstream_tapinfo_t the_tapinfo_struct =
{0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, 0, FALSE};
{0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, 0, FALSE};
/****************************************************************************/
@ -61,10 +61,10 @@ static rtpstream_tapinfo_t the_tapinfo_struct =
static void rtpstream_draw(void *arg _U_)
{
/* XXX: see rtpstream_on_update in rtp_streams_dlg.c for comments
g_signal_emit_by_name(top_level, "signal_rtpstream_update");
g_signal_emit_by_name(top_level, "signal_rtpstream_update");
*/
rtpstream_dlg_update(the_tapinfo_struct.strinfo_list);
return;
rtpstream_dlg_update(the_tapinfo_struct.strinfo_list);
return;
}
@ -72,15 +72,15 @@ static void rtpstream_draw(void *arg _U_)
/* scan for RTP streams */
void rtpstream_scan(void)
{
gboolean was_registered = the_tapinfo_struct.is_registered;
if (!the_tapinfo_struct.is_registered)
register_tap_listener_rtp_stream();
gboolean was_registered = the_tapinfo_struct.is_registered;
if (!the_tapinfo_struct.is_registered)
register_tap_listener_rtp_stream();
the_tapinfo_struct.mode = TAP_ANALYSE;
cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
cf_retap_packets(&cfile);
if (!was_registered)
remove_tap_listener_rtp_stream();
if (!was_registered)
remove_tap_listener_rtp_stream();
}
@ -88,43 +88,43 @@ void rtpstream_scan(void)
/* save rtp dump of stream_fwd */
gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename)
{
gboolean was_registered = the_tapinfo_struct.is_registered;
/* open file for saving */
the_tapinfo_struct.save_file = ws_fopen(filename, "wb");
if (the_tapinfo_struct.save_file==NULL) {
open_failure_alert_box(filename, errno, TRUE);
return FALSE;
}
gboolean was_registered = the_tapinfo_struct.is_registered;
/* open file for saving */
the_tapinfo_struct.save_file = ws_fopen(filename, "wb");
if (the_tapinfo_struct.save_file==NULL) {
open_failure_alert_box(filename, errno, TRUE);
return FALSE;
}
rtp_write_header(stream, the_tapinfo_struct.save_file);
if (ferror(the_tapinfo_struct.save_file)) {
write_failure_alert_box(filename, errno);
fclose(the_tapinfo_struct.save_file);
return FALSE;
}
rtp_write_header(stream, the_tapinfo_struct.save_file);
if (ferror(the_tapinfo_struct.save_file)) {
write_failure_alert_box(filename, errno);
fclose(the_tapinfo_struct.save_file);
return FALSE;
}
if (!the_tapinfo_struct.is_registered)
register_tap_listener_rtp_stream();
if (!the_tapinfo_struct.is_registered)
register_tap_listener_rtp_stream();
the_tapinfo_struct.mode = TAP_SAVE;
the_tapinfo_struct.filter_stream_fwd = stream;
cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
the_tapinfo_struct.mode = TAP_SAVE;
the_tapinfo_struct.filter_stream_fwd = stream;
cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
if (!was_registered)
remove_tap_listener_rtp_stream();
if (!was_registered)
remove_tap_listener_rtp_stream();
if (ferror(the_tapinfo_struct.save_file)) {
write_failure_alert_box(filename, errno);
fclose(the_tapinfo_struct.save_file);
return FALSE;
}
if (ferror(the_tapinfo_struct.save_file)) {
write_failure_alert_box(filename, errno);
fclose(the_tapinfo_struct.save_file);
return FALSE;
}
if (fclose(the_tapinfo_struct.save_file) == EOF) {
write_failure_alert_box(filename, errno);
return FALSE;
}
return TRUE;
if (fclose(the_tapinfo_struct.save_file) == EOF) {
write_failure_alert_box(filename, errno);
return FALSE;
}
return TRUE;
}
@ -132,25 +132,25 @@ gboolean rtpstream_save(rtp_stream_info_t* stream, const gchar *filename)
/* mark packets in stream_fwd or stream_rev */
void rtpstream_mark(rtp_stream_info_t* stream_fwd, rtp_stream_info_t* stream_rev)
{
gboolean was_registered = the_tapinfo_struct.is_registered;
if (!the_tapinfo_struct.is_registered)
register_tap_listener_rtp_stream();
gboolean was_registered = the_tapinfo_struct.is_registered;
if (!the_tapinfo_struct.is_registered)
register_tap_listener_rtp_stream();
the_tapinfo_struct.mode = TAP_MARK;
the_tapinfo_struct.filter_stream_fwd = stream_fwd;
the_tapinfo_struct.filter_stream_rev = stream_rev;
cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
the_tapinfo_struct.mode = TAP_MARK;
the_tapinfo_struct.filter_stream_fwd = stream_fwd;
the_tapinfo_struct.filter_stream_rev = stream_rev;
cf_retap_packets(&cfile);
the_tapinfo_struct.mode = TAP_ANALYSE;
if (!was_registered)
remove_tap_listener_rtp_stream();
if (!was_registered)
remove_tap_listener_rtp_stream();
}
/****************************************************************************/
const rtpstream_tapinfo_t* rtpstream_get_info(void)
{
return &the_tapinfo_struct;
return &the_tapinfo_struct;
}
@ -162,11 +162,11 @@ const rtpstream_tapinfo_t* rtpstream_get_info(void)
void
remove_tap_listener_rtp_stream(void)
{
if (the_tapinfo_struct.is_registered) {
remove_tap_listener(&the_tapinfo_struct);
if (the_tapinfo_struct.is_registered) {
remove_tap_listener(&the_tapinfo_struct);
the_tapinfo_struct.is_registered = FALSE;
}
the_tapinfo_struct.is_registered = FALSE;
}
}
@ -174,20 +174,33 @@ remove_tap_listener_rtp_stream(void)
void
register_tap_listener_rtp_stream(void)
{
GString *error_string;
GString *error_string;
if (!the_tapinfo_struct.is_registered) {
error_string = register_tap_listener("rtp", &the_tapinfo_struct,
NULL, 0, rtpstream_reset_cb, rtpstream_packet,
rtpstream_draw);
if (!the_tapinfo_struct.is_registered) {
error_string = register_tap_listener("rtp", &the_tapinfo_struct,
NULL, 0, rtpstream_reset_cb, rtpstream_packet,
rtpstream_draw);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"%s", error_string->str);
g_string_free(error_string, TRUE);
exit(1);
}
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"%s", error_string->str);
g_string_free(error_string, TRUE);
exit(1);
}
the_tapinfo_struct.is_registered = TRUE;
}
the_tapinfo_struct.is_registered = TRUE;
}
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/