diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-10-13 15:04:21 -0400 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-10-13 19:09:07 +0000 |
commit | 6a9479ecf90ef64f944526354fb26ee876d3ad25 (patch) | |
tree | ff0542670c21c9323020d89002d3a2c64e93a46c /ui/cli/tap-bootpstat.c | |
parent | 63faad686b49e02b86cd1961dd3bc8283f120da8 (diff) |
Add editor modelines and/or adjust whilespace.
Change-Id: I626b7bd8ac6e4b91c57cc9152e7ce038754e7278
Reviewed-on: https://code.wireshark.org/review/4658
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'ui/cli/tap-bootpstat.c')
-rw-r--r-- | ui/cli/tap-bootpstat.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/ui/cli/tap-bootpstat.c b/ui/cli/tap-bootpstat.c index cf79f2c3ec..6ec66b399d 100644 --- a/ui/cli/tap-bootpstat.c +++ b/ui/cli/tap-bootpstat.c @@ -32,7 +32,7 @@ void register_tap_listener_gtkdhcpstat(void); -typedef const char* bootp_info_value_t; +typedef const char *bootp_info_value_t; /* used to keep track of the statictics for an entire program interface */ typedef struct _dhcp_stats_t { @@ -69,30 +69,30 @@ dhcp_reset_hash(gchar *key _U_ , dhcp_message_type_t *data, gpointer ptr _U_ ) static void dhcp_draw_message_type(gchar *key _U_, dhcp_message_type_t *data, gchar * format ) { - if ((data==NULL) || (data->packets==0)) + if ((data == NULL) || (data->packets == 0)) return; printf( format, data->name, data->packets); } static void dhcpstat_reset(void *psp) { - dhcpstat_t *sp=(dhcpstat_t *)psp; + dhcpstat_t *sp = (dhcpstat_t *)psp; g_hash_table_foreach( sp->hash, (GHFunc)dhcp_reset_hash, NULL); } static int dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { - dhcpstat_t *sp=(dhcpstat_t *)psp; - const bootp_info_value_t value=(const bootp_info_value_t)pri; + dhcpstat_t *sp = (dhcpstat_t *)psp; + const bootp_info_value_t value = (const bootp_info_value_t)pri; dhcp_message_type_t *sc; - if (sp==NULL) + if (sp == NULL) return 0; sc = (dhcp_message_type_t *)g_hash_table_lookup( sp->hash, value); if (!sc) { - sc = g_new(dhcp_message_type_t,1); + sc = g_new(dhcp_message_type_t, 1); sc -> packets = 1; sc -> name = value; sc -> sp = sp; @@ -111,12 +111,12 @@ dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons static void dhcpstat_draw(void *psp) { - dhcpstat_t *sp=(dhcpstat_t *)psp; + dhcpstat_t *sp = (dhcpstat_t *)psp; printf("\n"); printf("===================================================================\n"); - if (sp->filter==NULL) + if (sp->filter == NULL) printf("BOOTP Statistics\n"); else printf("BOOTP Statistics with filter %s\n", sp->filter); @@ -134,24 +134,24 @@ dhcpstat_draw(void *psp) /* When called, this function will create a new instance of tap-boopstat. */ static void -dhcpstat_init(const char *opt_arg, void* userdata _U_) +dhcpstat_init(const char *opt_arg, void *userdata _U_) { dhcpstat_t *sp; - const char *filter=NULL; + const char *filter = NULL; GString *error_string; - if (!strncmp (opt_arg, "bootp,stat,", 11)){ - filter=opt_arg+11; + if (!strncmp (opt_arg, "bootp,stat,", 11)) { + filter = opt_arg+11; } else { - filter=NULL; + filter = NULL; } - sp = g_new(dhcpstat_t,1); + sp = g_new(dhcpstat_t, 1); sp->hash = g_hash_table_new( g_str_hash, g_str_equal); - if(filter){ - sp->filter=g_strdup(filter); + if (filter) { + sp->filter = g_strdup(filter); } else { - sp->filter=NULL; + sp->filter = NULL; } sp->index = 0; /* Nothing to display yet */ @@ -163,7 +163,7 @@ dhcpstat_init(const char *opt_arg, void* userdata _U_) dhcpstat_reset, dhcpstat_packet, dhcpstat_draw); - if (error_string){ + if (error_string) { /* error, we failed to attach to the tap. clean up */ g_free(sp->filter); g_free(sp); @@ -179,6 +179,18 @@ dhcpstat_init(const char *opt_arg, void* userdata _U_) void register_tap_listener_gtkdhcpstat(void) { - register_stat_cmd_arg("bootp,stat,", dhcpstat_init,NULL); + register_stat_cmd_arg("bootp,stat,", dhcpstat_init, NULL); } +/* + * Editor modelines - http://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: + */ |