LATER... ei_kerberos_kdc_session_key ...
[wireshark-sm.git] / ui / cli / tap-sv.c
blobd724c0d4ebe26ffb0b1ff0c3ee200c523eabb9a9
1 /* tap-sv.c
2 * Copyright 2008 Michael Bernhard
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
12 #include "config.h"
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
18 #include <glib.h>
20 #include <epan/packet_info.h>
21 #include <epan/tap.h>
22 #include <epan/stat_tap_ui.h>
23 #include <epan/dissectors/packet-sv.h>
25 #include <wsutil/cmdarg_err.h>
27 void register_tap_listener_sv(void);
29 static tap_packet_status
30 sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri, tap_flags_t flags _U_)
32 int i;
33 const sv_frame_data * sv_data = (const sv_frame_data *)pri;
35 printf("%f %u ", nstime_to_sec(&pinfo->rel_ts), sv_data->smpCnt);
37 for (i = 0; i < sv_data->num_phsMeas; i++) {
38 printf("%d ", sv_data->phsMeas[i].value);
41 printf("\n");
43 return TAP_PACKET_DONT_REDRAW;
46 static void
47 svstat_init(const char *opt_arg _U_, void *userdata _U_)
49 GString *error_string;
51 error_string = register_tap_listener(
52 "sv",
53 NULL,
54 NULL,
56 NULL,
57 sv_packet,
58 NULL,
59 NULL);
60 if (error_string) {
61 /* error, we failed to attach to the tap. clean up */
62 cmdarg_err("Couldn't register sv,stat tap: %s",
63 error_string->str);
64 g_string_free(error_string, TRUE);
65 exit(1);
69 static stat_tap_ui svstat_ui = {
70 REGISTER_STAT_GROUP_GENERIC,
71 NULL,
72 "sv",
73 svstat_init,
75 NULL
78 void
79 register_tap_listener_sv(void)
81 register_stat_tap_ui(&svstat_ui, NULL);
85 * Editor modelines - https://www.wireshark.org/tools/modelines.html
87 * Local variables:
88 * c-basic-offset: 8
89 * tab-width: 8
90 * indent-tabs-mode: t
91 * End:
93 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
94 * :indentSize=8:tabSize=8:noTabs=false: