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
20 #include <epan/packet_info.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_
)
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
);
43 return TAP_PACKET_DONT_REDRAW
;
47 svstat_init(const char *opt_arg _U_
, void *userdata _U_
)
49 GString
*error_string
;
51 error_string
= register_tap_listener(
61 /* error, we failed to attach to the tap. clean up */
62 cmdarg_err("Couldn't register sv,stat tap: %s",
64 g_string_free(error_string
, TRUE
);
69 static stat_tap_ui svstat_ui
= {
70 REGISTER_STAT_GROUP_GENERIC
,
79 register_tap_listener_sv(void)
81 register_stat_tap_ui(&svstat_ui
, NULL
);
85 * Editor modelines - https://www.wireshark.org/tools/modelines.html
93 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
94 * :indentSize=8:tabSize=8:noTabs=false: