| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
unit_strings.h
Go to the documentation of this file.
1/* unit_strings.h
2 * Units to append to field values
3 *
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10#pragma once
11#include <stdint.h>
12#include "ws_symbol_export.h"
13
14#ifdef __cplusplus
15 extern "C" {
16#endif /* __cplusplus */
17
21
23 typedef struct unit_name_string {
24 char *singular;
25 char *plural;
26} unit_name_string;
27
35WS_DLL_PUBLIC const char* unit_name_string_get_value(uint32_t value, const unit_name_string* units);
36
44WS_DLL_PUBLIC const char* unit_name_string_get_value64(uint64_t value, const unit_name_string* units);
45
53WS_DLL_PUBLIC const char* unit_name_string_get_double(double value, const unit_name_string* units);
54
55/*
56 * A default set of unit strings that dissectors can use for
57 * header fields.
58 */
59WS_DLL_PUBLIC const unit_name_string units_foot_feet;
60WS_DLL_PUBLIC const unit_name_string units_bit_bits;
61WS_DLL_PUBLIC const unit_name_string units_byte_bytes;
62WS_DLL_PUBLIC const unit_name_string units_byte_bytespsecond;
63WS_DLL_PUBLIC const unit_name_string units_octet_octets;
64WS_DLL_PUBLIC const unit_name_string units_word_words;
65WS_DLL_PUBLIC const unit_name_string units_tick_ticks;
66WS_DLL_PUBLIC const unit_name_string units_meters;
67WS_DLL_PUBLIC const unit_name_string units_meter_meters;
68WS_DLL_PUBLIC const unit_name_string units_centimeters;
69WS_DLL_PUBLIC const unit_name_string units_centimeter_centimeters;
70WS_DLL_PUBLIC const unit_name_string units_millimeters;
71WS_DLL_PUBLIC const unit_name_string units_millimeter_millimeters;
72WS_DLL_PUBLIC const unit_name_string units_week_weeks;
73WS_DLL_PUBLIC const unit_name_string units_day_days;
74WS_DLL_PUBLIC const unit_name_string units_hour_hours;
75WS_DLL_PUBLIC const unit_name_string units_hours;
76WS_DLL_PUBLIC const unit_name_string units_minute_minutes;
77WS_DLL_PUBLIC const unit_name_string units_minutes;
78WS_DLL_PUBLIC const unit_name_string units_second_seconds; // full unit name "second[s?]"
79WS_DLL_PUBLIC const unit_name_string units_seconds; //only seconds abbreviation "s"
80WS_DLL_PUBLIC const unit_name_string units_millisecond_milliseconds; // full unit name "millisecond[s?]"
81WS_DLL_PUBLIC const unit_name_string units_milliseconds; //only seconds abbreviation "ms"
82WS_DLL_PUBLIC const unit_name_string units_microsecond_microseconds; // full unit name "microsecond[s?]"
83WS_DLL_PUBLIC const unit_name_string units_microseconds; //only seconds abbreviation "us"
84WS_DLL_PUBLIC const unit_name_string units_nanosecond_nanoseconds; // full unit name "nanosecond[s?]"
85WS_DLL_PUBLIC const unit_name_string units_nanoseconds; //only seconds abbreviation "ns"
86WS_DLL_PUBLIC const unit_name_string units_nanometers;
87WS_DLL_PUBLIC const unit_name_string units_picoseconds; //only seconds abbreviation "ps"
88WS_DLL_PUBLIC const unit_name_string units_femtoseconds; //only seconds abbreviation "fs"
89WS_DLL_PUBLIC const unit_name_string units_attoseconds; //only seconds abbreviation "as"
90WS_DLL_PUBLIC const unit_name_string units_degree_degrees;
91WS_DLL_PUBLIC const unit_name_string units_degree_celsius;
92WS_DLL_PUBLIC const unit_name_string units_degree_bearing;
93WS_DLL_PUBLIC const unit_name_string units_centibels;
94WS_DLL_PUBLIC const unit_name_string units_decibels;
95WS_DLL_PUBLIC const unit_name_string units_dbm;
96WS_DLL_PUBLIC const unit_name_string units_dbi;
97WS_DLL_PUBLIC const unit_name_string units_dbhz;
98WS_DLL_PUBLIC const unit_name_string units_mbm;
99WS_DLL_PUBLIC const unit_name_string units_percent;
100WS_DLL_PUBLIC const unit_name_string units_khz;
101WS_DLL_PUBLIC const unit_name_string units_ghz;
102WS_DLL_PUBLIC const unit_name_string units_mhz;
103WS_DLL_PUBLIC const unit_name_string units_hz;
104WS_DLL_PUBLIC const unit_name_string units_hz_s;
105WS_DLL_PUBLIC const unit_name_string units_kbit;
106WS_DLL_PUBLIC const unit_name_string units_kbps;
107WS_DLL_PUBLIC const unit_name_string units_kibps;
108WS_DLL_PUBLIC const unit_name_string units_pkts;
109WS_DLL_PUBLIC const unit_name_string units_pkts_per_sec;
110WS_DLL_PUBLIC const unit_name_string units_km;
111WS_DLL_PUBLIC const unit_name_string units_kmh;
112WS_DLL_PUBLIC const unit_name_string units_m_s;
113WS_DLL_PUBLIC const unit_name_string units_cm_s;
114WS_DLL_PUBLIC const unit_name_string units_mm_s;
115WS_DLL_PUBLIC const unit_name_string units_milliamps;
116WS_DLL_PUBLIC const unit_name_string units_watt;
117WS_DLL_PUBLIC const unit_name_string units_milliwatt;
118WS_DLL_PUBLIC const unit_name_string units_microwatt;
119WS_DLL_PUBLIC const unit_name_string units_volt;
120WS_DLL_PUBLIC const unit_name_string units_grams_per_second;
121WS_DLL_PUBLIC const unit_name_string units_meter_sec;
122WS_DLL_PUBLIC const unit_name_string units_meter_sec_squared;
123WS_DLL_PUBLIC const unit_name_string units_bit_sec;
124WS_DLL_PUBLIC const unit_name_string units_segment_remaining;
125WS_DLL_PUBLIC const unit_name_string units_frame_frames;
126WS_DLL_PUBLIC const unit_name_string units_revolutions_per_minute;
127WS_DLL_PUBLIC const unit_name_string units_pascal;
128WS_DLL_PUBLIC const unit_name_string units_kilopascal;
129WS_DLL_PUBLIC const unit_name_string units_newton_metre;
130WS_DLL_PUBLIC const unit_name_string units_liter_per_hour;
131WS_DLL_PUBLIC const unit_name_string units_amp;
132WS_DLL_PUBLIC const unit_name_string units_watthour;
133WS_DLL_PUBLIC const unit_name_string units_bpm;
134WS_DLL_PUBLIC const unit_name_string units_calorie;
135WS_DLL_PUBLIC const unit_name_string units_cycle_cycles;
136WS_DLL_PUBLIC const unit_name_string units_ppm;
137
138#ifdef __cplusplus
139}
140#endif /* __cplusplus */
141
142/*
143 * Editor modelines
144 *
145 * Local Variables:
146 * c-basic-offset: 4
147 * tab-width: 8
148 * indent-tabs-mode: nil
149 * End:
150 *
151 * ex: set shiftwidth=4 tabstop=8 expandtab:
152 * :indentSize=4:tabSize=8:noTabs=true:
153 */
unit_name_string
Definition unit_strings.h:23
unit_name_string::singular
char * singular
Definition unit_strings.h:24
unit_name_string::plural
char * plural
Definition unit_strings.h:25
unit_name_string_get_double
WS_DLL_PUBLIC const char * unit_name_string_get_double(double value, const unit_name_string *units)
Definition unit_strings.c:36
unit_name_string_get_value
WS_DLL_PUBLIC const char * unit_name_string_get_value(uint32_t value, const unit_name_string *units)
Definition unit_strings.c:18
unit_name_string_get_value64
WS_DLL_PUBLIC const char * unit_name_string_get_value64(uint64_t value, const unit_name_string *units)
Definition unit_strings.c:27