forked from osmocom/wireshark
Remove editor modelines and .editorconfig exceptions from root files
This commit is contained in:
parent
695ce22b0d
commit
70d432c357
|
@ -71,51 +71,3 @@ indent_size = 8
|
||||||
[*.{c,cpp,h}]
|
[*.{c,cpp,h}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[{capinfos,captype,mergecap,tfshark,tshark}.c]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[{dftest,randpkt,trigcap}.c]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = tab
|
|
||||||
|
|
||||||
[capture_stop_conditions.[ch]]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[cfile.[ch]]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[conditions.[ch]]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[file.[ch]]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[frame_tvbuff.[ch]]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = tab
|
|
||||||
|
|
||||||
[pcapio.[ch]]
|
|
||||||
indent_size = 8
|
|
||||||
|
|
||||||
[ringbuffer.[ch]]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[randpkt_core.[ch]]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = tab
|
|
||||||
|
|
||||||
[sharkd.c]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[sharkd_daemon.c]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = tab
|
|
||||||
|
|
||||||
[sharkd_session.c]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = tab
|
|
||||||
|
|
||||||
[version_info.[ch]]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = tab
|
|
||||||
|
|
20
capinfos.c
20
capinfos.c
|
@ -38,7 +38,6 @@
|
||||||
* (Previously a success status was always
|
* (Previously a success status was always
|
||||||
* returned if the -C option was not used).
|
* returned if the -C option was not used).
|
||||||
*
|
*
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -575,7 +574,8 @@ relative_time_string(nstime_t *timer, int tsprecision, capture_info *cf_info, gb
|
||||||
return time_string_buf;
|
return time_string_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_value(const gchar *text_p1, gint width, const gchar *text_p2, double value) {
|
static void print_value(const gchar *text_p1, gint width, const gchar *text_p2, double value)
|
||||||
|
{
|
||||||
if (value > 0.0)
|
if (value > 0.0)
|
||||||
printf("%s%.*f%s\n", text_p1, width, value, text_p2);
|
printf("%s%.*f%s\n", text_p1, width, value, text_p2);
|
||||||
else
|
else
|
||||||
|
@ -1154,7 +1154,8 @@ count_decryption_secret(guint32 secrets_type _U_, const void *secrets _U_, guint
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
hash_to_str(const unsigned char *hash, size_t length, char *str) {
|
hash_to_str(const unsigned char *hash, size_t length, char *str)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < (int) length; i++) {
|
for (i = 0; i < (int) length; i++) {
|
||||||
|
@ -1873,16 +1874,3 @@ exit:
|
||||||
free_progdirs();
|
free_progdirs();
|
||||||
return overall_error_status;
|
return overall_error_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
captype.c
13
captype.c
|
@ -200,16 +200,3 @@ main(int argc, char *argv[])
|
||||||
free_progdirs();
|
free_progdirs();
|
||||||
return overall_error_status;
|
return overall_error_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
cfile.c
13
cfile.c
|
@ -23,16 +23,3 @@ cap_file_init(capture_file *cf)
|
||||||
/* Initialize the capture file struct */
|
/* Initialize the capture file struct */
|
||||||
memset(cf, 0, sizeof(capture_file));
|
memset(cf, 0, sizeof(capture_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local Variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
cfile.h
13
cfile.h
|
@ -140,16 +140,3 @@ void cap_file_provider_set_modified_block(struct packet_provider_data *prov, fra
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* cfile.h */
|
#endif /* cfile.h */
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local Variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
dftest.c
13
dftest.c
|
@ -174,16 +174,3 @@ dftest_cmdarg_err_cont(const char *fmt, va_list ap)
|
||||||
vfprintf(stderr, fmt, ap);
|
vfprintf(stderr, fmt, ap);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: t
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
||||||
* :indentSize=8:tabSize=8:noTabs=false:
|
|
||||||
*/
|
|
||||||
|
|
49
file.c
49
file.c
|
@ -168,7 +168,6 @@ cf_callback_invoke(int event, gpointer data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
cf_callback_add(cf_callback_t func, gpointer user_data)
|
cf_callback_add(cf_callback_t func, gpointer user_data)
|
||||||
{
|
{
|
||||||
|
@ -225,7 +224,8 @@ cf_get_computed_elapsed(capture_file *cf)
|
||||||
return cf->computed_elapsed;
|
return cf->computed_elapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void compute_elapsed(capture_file *cf, gint64 start_time)
|
static void
|
||||||
|
compute_elapsed(capture_file *cf, gint64 start_time)
|
||||||
{
|
{
|
||||||
gint64 delta_time = g_get_monotonic_time() - start_time;
|
gint64 delta_time = g_get_monotonic_time() - start_time;
|
||||||
|
|
||||||
|
@ -911,7 +911,8 @@ cf_continue_tail(capture_file *cf, volatile int to_read, wtap_rec *rec,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cf_fake_continue_tail(capture_file *cf) {
|
cf_fake_continue_tail(capture_file *cf)
|
||||||
|
{
|
||||||
cf->state = FILE_READ_DONE;
|
cf->state = FILE_READ_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1106,7 +1107,9 @@ cf_get_basename(capture_file *cf)
|
||||||
return displayname;
|
return displayname;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cf_set_tempfile_source(capture_file *cf, gchar *source) {
|
void
|
||||||
|
cf_set_tempfile_source(capture_file *cf, gchar *source)
|
||||||
|
{
|
||||||
if (cf->source) {
|
if (cf->source) {
|
||||||
g_free(cf->source);
|
g_free(cf->source);
|
||||||
}
|
}
|
||||||
|
@ -1118,7 +1121,9 @@ void cf_set_tempfile_source(capture_file *cf, gchar *source) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar *cf_get_tempfile_source(capture_file *cf) {
|
const gchar *
|
||||||
|
cf_get_tempfile_source(capture_file *cf)
|
||||||
|
{
|
||||||
if (!cf->source) {
|
if (!cf->source) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -1140,37 +1145,43 @@ cf_is_tempfile(capture_file *cf)
|
||||||
return cf->is_tempfile;
|
return cf->is_tempfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cf_set_tempfile(capture_file *cf, gboolean is_tempfile)
|
void
|
||||||
|
cf_set_tempfile(capture_file *cf, gboolean is_tempfile)
|
||||||
{
|
{
|
||||||
cf->is_tempfile = is_tempfile;
|
cf->is_tempfile = is_tempfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* XXX - use a macro instead? */
|
/* XXX - use a macro instead? */
|
||||||
void cf_set_drops_known(capture_file *cf, gboolean drops_known)
|
void
|
||||||
|
cf_set_drops_known(capture_file *cf, gboolean drops_known)
|
||||||
{
|
{
|
||||||
cf->drops_known = drops_known;
|
cf->drops_known = drops_known;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX - use a macro instead? */
|
/* XXX - use a macro instead? */
|
||||||
void cf_set_drops(capture_file *cf, guint32 drops)
|
void
|
||||||
|
cf_set_drops(capture_file *cf, guint32 drops)
|
||||||
{
|
{
|
||||||
cf->drops = drops;
|
cf->drops = drops;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX - use a macro instead? */
|
/* XXX - use a macro instead? */
|
||||||
gboolean cf_get_drops_known(capture_file *cf)
|
gboolean
|
||||||
|
cf_get_drops_known(capture_file *cf)
|
||||||
{
|
{
|
||||||
return cf->drops_known;
|
return cf->drops_known;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX - use a macro instead? */
|
/* XXX - use a macro instead? */
|
||||||
guint32 cf_get_drops(capture_file *cf)
|
guint32
|
||||||
|
cf_get_drops(capture_file *cf)
|
||||||
{
|
{
|
||||||
return cf->drops;
|
return cf->drops;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cf_set_rfcode(capture_file *cf, dfilter_t *rfcode)
|
void
|
||||||
|
cf_set_rfcode(capture_file *cf, dfilter_t *rfcode)
|
||||||
{
|
{
|
||||||
cf->rfcode = rfcode;
|
cf->rfcode = rfcode;
|
||||||
}
|
}
|
||||||
|
@ -5221,7 +5232,8 @@ cf_rename_failure_alert_box(const char *filename, int err)
|
||||||
|
|
||||||
/* Reload the current capture file. */
|
/* Reload the current capture file. */
|
||||||
cf_status_t
|
cf_status_t
|
||||||
cf_reload(capture_file *cf) {
|
cf_reload(capture_file *cf)
|
||||||
|
{
|
||||||
gchar *filename;
|
gchar *filename;
|
||||||
gboolean is_tempfile;
|
gboolean is_tempfile;
|
||||||
cf_status_t cf_status = CF_OK;
|
cf_status_t cf_status = CF_OK;
|
||||||
|
@ -5275,16 +5287,3 @@ cf_reload(capture_file *cf) {
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
return cf_status;
|
return cf_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines
|
|
||||||
*
|
|
||||||
* Local Variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
file.h
13
file.h
|
@ -735,16 +735,3 @@ gboolean cf_add_ip_name_from_string(capture_file *cf, const char *addr, const ch
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* file.h */
|
#endif /* file.h */
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://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:
|
|
||||||
*/
|
|
||||||
|
|
|
@ -329,16 +329,3 @@ file_tvbuff_new_buffer(const struct packet_provider_data *prov,
|
||||||
{
|
{
|
||||||
return frame_tvbuff_new(prov, fd, ws_buffer_start_ptr(buf));
|
return frame_tvbuff_new(prov, fd, ws_buffer_start_ptr(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: t
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
||||||
* :indentSize=8:tabSize=8:noTabs=false:
|
|
||||||
*/
|
|
||||||
|
|
|
@ -37,16 +37,3 @@ extern tvbuff_t *file_tvbuff_new_buffer(const struct packet_provider_data *prov,
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif /* __FRAME_TVBUFF_H__ */
|
#endif /* __FRAME_TVBUFF_H__ */
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: t
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
||||||
* :indentSize=8:tabSize=8:noTabs=false:
|
|
||||||
*/
|
|
||||||
|
|
13
mergecap.c
13
mergecap.c
|
@ -424,16 +424,3 @@ clean_exit:
|
||||||
free_progdirs();
|
free_progdirs();
|
||||||
return (status == MERGE_OK) ? 0 : 2;
|
return (status == MERGE_OK) ? 0 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
randpkt.c
13
randpkt.c
|
@ -259,16 +259,3 @@ clean_exit:
|
||||||
wtap_cleanup();
|
wtap_cleanup();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: t
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
||||||
* :indentSize=8:tabSize=8:noTabs=false:
|
|
||||||
*/
|
|
||||||
|
|
34
ringbuffer.c
34
ringbuffer.c
|
@ -91,7 +91,8 @@ static ringbuf_data rb_data;
|
||||||
/*
|
/*
|
||||||
* delete pending uncompressed pcap files.
|
* delete pending uncompressed pcap files.
|
||||||
*/
|
*/
|
||||||
static void CleanupOldCap(gchar* name)
|
static void
|
||||||
|
CleanupOldCap(gchar* name)
|
||||||
{
|
{
|
||||||
ws_statb64 statb;
|
ws_statb64 statb;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -128,7 +129,8 @@ static void CleanupOldCap(gchar* name)
|
||||||
/*
|
/*
|
||||||
* compress capture file
|
* compress capture file
|
||||||
*/
|
*/
|
||||||
static int ringbuf_exec_compress(gchar* name)
|
static int
|
||||||
|
ringbuf_exec_compress(gchar* name)
|
||||||
{
|
{
|
||||||
guint8 *buffer = NULL;
|
guint8 *buffer = NULL;
|
||||||
gchar* outgz = NULL;
|
gchar* outgz = NULL;
|
||||||
|
@ -186,7 +188,8 @@ static int ringbuf_exec_compress(gchar* name)
|
||||||
/*
|
/*
|
||||||
* thread to compress capture file
|
* thread to compress capture file
|
||||||
*/
|
*/
|
||||||
static void* exec_compress_thread(void* arg)
|
static void*
|
||||||
|
exec_compress_thread(void* arg)
|
||||||
{
|
{
|
||||||
ringbuf_exec_compress((gchar*)arg);
|
ringbuf_exec_compress((gchar*)arg);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -195,7 +198,8 @@ static void* exec_compress_thread(void* arg)
|
||||||
/*
|
/*
|
||||||
* start a thread to compress capture file
|
* start a thread to compress capture file
|
||||||
*/
|
*/
|
||||||
static int ringbuf_start_compress_file(rb_file* rfile)
|
static int
|
||||||
|
ringbuf_start_compress_file(rb_file* rfile)
|
||||||
{
|
{
|
||||||
gchar* name = g_strdup(rfile->name);
|
gchar* name = g_strdup(rfile->name);
|
||||||
g_thread_new("exec_compress", &exec_compress_thread, name);
|
g_thread_new("exec_compress", &exec_compress_thread, name);
|
||||||
|
@ -206,7 +210,8 @@ static int ringbuf_start_compress_file(rb_file* rfile)
|
||||||
/*
|
/*
|
||||||
* create the next filename and open a new binary file with that name
|
* create the next filename and open a new binary file with that name
|
||||||
*/
|
*/
|
||||||
static int ringbuf_open_file(rb_file *rfile, int *err)
|
static int
|
||||||
|
ringbuf_open_file(rb_file *rfile, int *err)
|
||||||
{
|
{
|
||||||
char filenum[5+1];
|
char filenum[5+1];
|
||||||
char timestr[14+1];
|
char timestr[14+1];
|
||||||
|
@ -385,12 +390,14 @@ ringbuf_set_print_name(gchar *name, int *err)
|
||||||
* Whether the ringbuf filenames are ready.
|
* Whether the ringbuf filenames are ready.
|
||||||
* (Whether ringbuf_init is called and ringbuf_free is not called.)
|
* (Whether ringbuf_init is called and ringbuf_free is not called.)
|
||||||
*/
|
*/
|
||||||
gboolean ringbuf_is_initialized(void)
|
gboolean
|
||||||
|
ringbuf_is_initialized(void)
|
||||||
{
|
{
|
||||||
return rb_data.files != NULL;
|
return rb_data.files != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gchar *ringbuf_current_filename(void)
|
const gchar *
|
||||||
|
ringbuf_current_filename(void)
|
||||||
{
|
{
|
||||||
return rb_data.files[rb_data.curr_file_num % rb_data.num_files].name;
|
return rb_data.files[rb_data.curr_file_num % rb_data.num_files].name;
|
||||||
}
|
}
|
||||||
|
@ -589,16 +596,3 @@ ringbuf_error_cleanup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_LIBPCAP */
|
#endif /* HAVE_LIBPCAP */
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local Variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
13
ringbuffer.h
13
ringbuffer.h
|
@ -37,16 +37,3 @@ void ringbuf_error_cleanup(void);
|
||||||
gboolean ringbuf_set_print_name(gchar *name, int *err);
|
gboolean ringbuf_set_print_name(gchar *name, int *err);
|
||||||
|
|
||||||
#endif /* ringbuffer.h */
|
#endif /* ringbuffer.h */
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local Variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
16
sharkd.c
16
sharkd.c
|
@ -77,7 +77,8 @@ static void sharkd_cmdarg_err(const char *msg_format, va_list ap);
|
||||||
static void sharkd_cmdarg_err_cont(const char *msg_format, va_list ap);
|
static void sharkd_cmdarg_err_cont(const char *msg_format, va_list ap);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_current_user(void) {
|
print_current_user(void)
|
||||||
|
{
|
||||||
gchar *cur_user, *cur_group;
|
gchar *cur_user, *cur_group;
|
||||||
|
|
||||||
if (started_with_special_privs()) {
|
if (started_with_special_privs()) {
|
||||||
|
@ -758,16 +759,3 @@ sharkd_set_modified_block(frame_data *fd, wtap_block_t new_block)
|
||||||
cap_file_provider_set_modified_block(&cfile.provider, fd, new_block);
|
cap_file_provider_set_modified_block(&cfile.provider, fd, new_block);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
|
@ -464,16 +464,3 @@ sharkd_loop(int argc _U_, char* argv[])
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: t
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
||||||
* :indentSize=8:tabSize=8:noTabs=false:
|
|
||||||
*/
|
|
||||||
|
|
|
@ -298,20 +298,20 @@ is_param_match(const char *param_in, const char *valid_param)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* json_prep does four things:
|
* json_prep does four things:
|
||||||
*
|
*
|
||||||
* 1. check the syntax of the root and parameter members
|
* 1. check the syntax of the root and parameter members
|
||||||
* 2. tokenize the names and values by zero terminating them
|
* 2. tokenize the names and values by zero terminating them
|
||||||
* 3. unescape the names and values
|
* 3. unescape the names and values
|
||||||
* 4. extracts and saves the rpcid
|
* 4. extracts and saves the rpcid
|
||||||
* - we have to do it here as it's needed for the error messages
|
* - we have to do it here as it's needed for the error messages
|
||||||
*
|
*
|
||||||
* The objective is to minimise the validation work in the functions
|
* The objective is to minimise the validation work in the functions
|
||||||
* that process each called method.
|
* that process each called method.
|
||||||
*
|
*
|
||||||
* This gets a little messy as the JSON parser creates a flat list
|
* This gets a little messy as the JSON parser creates a flat list
|
||||||
* of all members rather than create a tree.
|
* of all members rather than create a tree.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
json_prep(char* buf, const jsmntok_t* tokens, int count)
|
json_prep(char* buf, const jsmntok_t* tokens, int count)
|
||||||
{
|
{
|
||||||
|
@ -5086,16 +5086,3 @@ sharkd_session_main(int mode_setting)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 8
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: t
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
||||||
* :indentSize=8:tabSize=8:noTabs=false:
|
|
||||||
*/
|
|
||||||
|
|
63
tfshark.c
63
tfshark.c
|
@ -246,7 +246,8 @@ glossary_option_help(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_current_user(void) {
|
print_current_user(void)
|
||||||
|
{
|
||||||
gchar *cur_user, *cur_group;
|
gchar *cur_user, *cur_group;
|
||||||
|
|
||||||
if (started_with_special_privs()) {
|
if (started_with_special_privs()) {
|
||||||
|
@ -295,7 +296,7 @@ main(int argc, char *argv[])
|
||||||
e_prefs *prefs_p;
|
e_prefs *prefs_p;
|
||||||
gchar *output_only = NULL;
|
gchar *output_only = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The leading + ensures that getopt_long() does not permute the argv[]
|
* The leading + ensures that getopt_long() does not permute the argv[]
|
||||||
* entries.
|
* entries.
|
||||||
*
|
*
|
||||||
|
@ -583,29 +584,30 @@ main(int argc, char *argv[])
|
||||||
goto clean_exit;
|
goto clean_exit;
|
||||||
break;
|
break;
|
||||||
case 'l': /* "Line-buffer" standard output */
|
case 'l': /* "Line-buffer" standard output */
|
||||||
/* The ANSI C standard does not appear to *require* that a line-buffered
|
/* The ANSI C standard does not appear to *require* that a
|
||||||
stream be flushed to the host environment whenever a newline is
|
line-buffered stream be flushed to the host environment
|
||||||
written, it just says that, on such a stream, characters "are
|
whenever a newline is written, it just says that, on such a
|
||||||
intended to be transmitted to or from the host environment as a
|
stream, characters "are intended to be transmitted to or
|
||||||
block when a new-line character is encountered".
|
from the host environment as a block when a new-line
|
||||||
|
character is encountered".
|
||||||
|
|
||||||
The Visual C++ 6.0 C implementation doesn't do what is intended;
|
The Visual C++ 6.0 C implementation doesn't do what is
|
||||||
even if you set a stream to be line-buffered, it still doesn't
|
intended; even if you set a stream to be line-buffered, it
|
||||||
flush the buffer at the end of every line.
|
still doesn't flush the buffer at the end of every line.
|
||||||
|
|
||||||
The whole reason for the "-l" flag in either tcpdump or TShark
|
The whole reason for the "-l" flag in either tcpdump or
|
||||||
is to allow the output of a live capture to be piped to a program
|
TShark is to allow the output of a live capture to be piped
|
||||||
or script and to have that script see the information for the
|
to a program or script and to have that script see the
|
||||||
packet as soon as it's printed, rather than having to wait until
|
information for the packet as soon as it's printed, rather
|
||||||
a standard I/O buffer fills up.
|
than having to wait until a standard I/O buffer fills up.
|
||||||
|
|
||||||
So, if the "-l" flag is specified, we flush the standard output
|
So, if the "-l" flag is specified, we flush the standard
|
||||||
at the end of a packet. This will do the right thing if we're
|
output at the end of a packet. This will do the right thing
|
||||||
printing packet summary lines, and, as we print the entire protocol
|
if we're printing packet summary lines, and, as we print the
|
||||||
tree for a single packet without waiting for anything to happen,
|
entire protocol tree for a single packet without waiting for
|
||||||
it should be as good as line-buffered mode if we're printing
|
anything to happen, it should be as good as line-buffered
|
||||||
protocol trees - arguably even better, as it may do fewer
|
mode if we're printing protocol trees - arguably even
|
||||||
writes. */
|
better, as it may do fewer writes. */
|
||||||
line_buffered = TRUE;
|
line_buffered = TRUE;
|
||||||
break;
|
break;
|
||||||
case 'o': /* Override preference from command line */
|
case 'o': /* Override preference from command line */
|
||||||
|
@ -2050,13 +2052,13 @@ show_print_file_io_error(int err)
|
||||||
|
|
||||||
case ENOSPC:
|
case ENOSPC:
|
||||||
cmdarg_err("Not all the packets could be printed because there is "
|
cmdarg_err("Not all the packets could be printed because there is "
|
||||||
"no space left on the file system.");
|
"no space left on the file system.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef EDQUOT
|
#ifdef EDQUOT
|
||||||
case EDQUOT:
|
case EDQUOT:
|
||||||
cmdarg_err("Not all the packets could be printed because you are "
|
cmdarg_err("Not all the packets could be printed because you are "
|
||||||
"too close to, or over your disk quota.");
|
"too close to, or over your disk quota.");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2211,16 +2213,3 @@ tfshark_cmdarg_err_cont(const char *msg_format, va_list ap)
|
||||||
vfprintf(stderr, msg_format, ap);
|
vfprintf(stderr, msg_format, ap);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
36
tshark.c
36
tshark.c
|
@ -260,7 +260,8 @@ static void tshark_cmdarg_err_cont(const char *msg_format, va_list ap);
|
||||||
static GHashTable *output_only_tables = NULL;
|
static GHashTable *output_only_tables = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
list_capture_types(void) {
|
list_capture_types(void)
|
||||||
|
{
|
||||||
GArray *writable_type_subtypes;
|
GArray *writable_type_subtypes;
|
||||||
|
|
||||||
fprintf(stderr, "tshark: The available capture file types for the \"-F\" flag are:\n");
|
fprintf(stderr, "tshark: The available capture file types for the \"-F\" flag are:\n");
|
||||||
|
@ -294,7 +295,8 @@ string_elem_print(gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
list_read_capture_types(void) {
|
list_read_capture_types(void)
|
||||||
|
{
|
||||||
guint i;
|
guint i;
|
||||||
size_t num_file_types;
|
size_t num_file_types;
|
||||||
struct string_elem *captypes;
|
struct string_elem *captypes;
|
||||||
|
@ -319,7 +321,8 @@ list_read_capture_types(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
list_export_pdu_taps(void) {
|
list_export_pdu_taps(void)
|
||||||
|
{
|
||||||
fprintf(stderr, "tshark: The available export tap names for the \"-U tap_name\" option are:\n");
|
fprintf(stderr, "tshark: The available export tap names for the \"-U tap_name\" option are:\n");
|
||||||
for (GSList *export_pdu_tap_name_list = get_export_pdu_tap_list();
|
for (GSList *export_pdu_tap_name_list = get_export_pdu_tap_list();
|
||||||
export_pdu_tap_name_list != NULL;
|
export_pdu_tap_name_list != NULL;
|
||||||
|
@ -565,7 +568,8 @@ hexdump_option_help(FILE *output)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_current_user(void) {
|
print_current_user(void)
|
||||||
|
{
|
||||||
gchar *cur_user, *cur_group;
|
gchar *cur_user, *cur_group;
|
||||||
|
|
||||||
if (started_with_special_privs()) {
|
if (started_with_special_privs()) {
|
||||||
|
@ -745,7 +749,7 @@ main(int argc, char *argv[])
|
||||||
{"elastic-mapping-filter", ws_required_argument, NULL, LONGOPT_ELASTIC_MAPPING_FILTER},
|
{"elastic-mapping-filter", ws_required_argument, NULL, LONGOPT_ELASTIC_MAPPING_FILTER},
|
||||||
{"capture-comment", ws_required_argument, NULL, LONGOPT_CAPTURE_COMMENT},
|
{"capture-comment", ws_required_argument, NULL, LONGOPT_CAPTURE_COMMENT},
|
||||||
{"hexdump", ws_required_argument, NULL, LONGOPT_HEXDUMP},
|
{"hexdump", ws_required_argument, NULL, LONGOPT_HEXDUMP},
|
||||||
{0, 0, 0, 0 }
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
gboolean arg_error = FALSE;
|
gboolean arg_error = FALSE;
|
||||||
gboolean has_extcap_options = FALSE;
|
gboolean has_extcap_options = FALSE;
|
||||||
|
@ -781,7 +785,7 @@ main(int argc, char *argv[])
|
||||||
exp_pdu_t exp_pdu_tap_data;
|
exp_pdu_t exp_pdu_tap_data;
|
||||||
const gchar* elastic_mapping_filter = NULL;
|
const gchar* elastic_mapping_filter = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The leading + ensures that getopt_long() does not permute the argv[]
|
* The leading + ensures that getopt_long() does not permute the argv[]
|
||||||
* entries.
|
* entries.
|
||||||
*
|
*
|
||||||
|
@ -4553,13 +4557,13 @@ show_print_file_io_error(void)
|
||||||
|
|
||||||
case ENOSPC:
|
case ENOSPC:
|
||||||
cmdarg_err("Not all the packets could be printed because there is "
|
cmdarg_err("Not all the packets could be printed because there is "
|
||||||
"no space left on the file system.");
|
"no space left on the file system.");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef EDQUOT
|
#ifdef EDQUOT
|
||||||
case EDQUOT:
|
case EDQUOT:
|
||||||
cmdarg_err("Not all the packets could be printed because you are "
|
cmdarg_err("Not all the packets could be printed because you are "
|
||||||
"too close to, or over your disk quota.");
|
"too close to, or over your disk quota.");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -4641,7 +4645,8 @@ tshark_cmdarg_err_cont(const char *msg_format, va_list ap)
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reset_epan_mem(capture_file *cf,epan_dissect_t *edt, gboolean tree, gboolean visual)
|
static void
|
||||||
|
reset_epan_mem(capture_file *cf,epan_dissect_t *edt, gboolean tree, gboolean visual)
|
||||||
{
|
{
|
||||||
if (!epan_auto_reset || (cf->count < epan_auto_reset_count))
|
if (!epan_auto_reset || (cf->count < epan_auto_reset_count))
|
||||||
return;
|
return;
|
||||||
|
@ -4655,16 +4660,3 @@ static void reset_epan_mem(capture_file *cf,epan_dissect_t *edt, gboolean tree,
|
||||||
epan_dissect_init(edt, cf->epan, tree, visual);
|
epan_dissect_init(edt, cf->epan, tree, visual);
|
||||||
cf->count = 0;
|
cf->count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
|
||||||
*
|
|
||||||
* Local variables:
|
|
||||||
* c-basic-offset: 2
|
|
||||||
* tab-width: 8
|
|
||||||
* indent-tabs-mode: nil
|
|
||||||
* End:
|
|
||||||
*
|
|
||||||
* vi: set shiftwidth=2 tabstop=8 expandtab:
|
|
||||||
* :indentSize=2:tabSize=8:noTabs=true:
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in New Issue