| Wireshark 4.7.0 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
11#ifndef __UNIT_STRINGS_H__
12#define __UNIT_STRINGS_H__
13
14#include <stdint.h>
15#include "ws_symbol_export.h"
16
17#ifdef __cplusplus
18 extern "C" {
19#endif /* __cplusplus */
20
26 typedef struct unit_name_string {
27 char *singular;
28 char *plural;
29} unit_name_string;
30
38WS_DLL_PUBLIC const char* unit_name_string_get_value(uint32_t value, const unit_name_string* units);
39
47WS_DLL_PUBLIC const char* unit_name_string_get_value64(uint64_t value, const unit_name_string* units);
48
56WS_DLL_PUBLIC const char* unit_name_string_get_double(double value, const unit_name_string* units);
57
58/*
59 * A default set of unit strings that dissectors can use for
60 * header fields.
61 */
62WS_DLL_PUBLIC const unit_name_string units_foot_feet;
63WS_DLL_PUBLIC const unit_name_string units_bit_bits;
64WS_DLL_PUBLIC const unit_name_string units_byte_bytes;
65WS_DLL_PUBLIC const unit_name_string units_byte_bytespsecond;
66WS_DLL_PUBLIC const unit_name_string units_octet_octets;
67WS_DLL_PUBLIC const unit_name_string units_word_words;
68WS_DLL_PUBLIC const unit_name_string units_tick_ticks;
69WS_DLL_PUBLIC const unit_name_string units_meters;
70WS_DLL_PUBLIC const unit_name_string units_meter_meters;
71WS_DLL_PUBLIC const unit_name_string units_centimeters;
72WS_DLL_PUBLIC const unit_name_string units_centimeter_centimeters;
73WS_DLL_PUBLIC const unit_name_string units_millimeters;
74WS_DLL_PUBLIC const unit_name_string units_millimeter_millimeters;
75WS_DLL_PUBLIC const unit_name_string units_week_weeks;
76WS_DLL_PUBLIC const unit_name_string units_day_days;
77WS_DLL_PUBLIC const unit_name_string units_hour_hours;
78WS_DLL_PUBLIC const unit_name_string units_hours;
79WS_DLL_PUBLIC const unit_name_string units_minute_minutes;
80WS_DLL_PUBLIC const unit_name_string units_minutes;
81WS_DLL_PUBLIC const unit_name_string units_second_seconds; // full unit name "second[s?]"
82WS_DLL_PUBLIC const unit_name_string units_seconds; //only seconds abbreviation "s"
83WS_DLL_PUBLIC const unit_name_string units_millisecond_milliseconds; // full unit name "millisecond[s?]"
84WS_DLL_PUBLIC const unit_name_string units_milliseconds; //only seconds abbreviation "ms"
85WS_DLL_PUBLIC const unit_name_string units_microsecond_microseconds; // full unit name "microsecond[s?]"
86WS_DLL_PUBLIC const unit_name_string units_microseconds; //only seconds abbreviation "us"
87WS_DLL_PUBLIC const unit_name_string units_nanosecond_nanoseconds; // full unit name "nanosecond[s?]"
88WS_DLL_PUBLIC const unit_name_string units_nanoseconds; //only seconds abbreviation "ns"
89WS_DLL_PUBLIC const unit_name_string units_nanometers;
90WS_DLL_PUBLIC const unit_name_string units_picoseconds; //only seconds abbreviation "ps"
91WS_DLL_PUBLIC const unit_name_string units_femtoseconds; //only seconds abbreviation "fs"
92WS_DLL_PUBLIC const unit_name_string units_attoseconds; //only seconds abbreviation "as"
93WS_DLL_PUBLIC const unit_name_string units_degree_degrees;
94WS_DLL_PUBLIC const unit_name_string units_degree_celsius;
95WS_DLL_PUBLIC const unit_name_string units_degree_bearing;
96WS_DLL_PUBLIC const unit_name_string units_centibels;
97WS_DLL_PUBLIC const unit_name_string units_decibels;
98WS_DLL_PUBLIC const unit_name_string units_dbm;
99WS_DLL_PUBLIC const unit_name_string units_dbi;
100WS_DLL_PUBLIC const unit_name_string units_dbhz;
101WS_DLL_PUBLIC const unit_name_string units_mbm;
102WS_DLL_PUBLIC const unit_name_string units_percent;
103WS_DLL_PUBLIC const unit_name_string units_khz;
104WS_DLL_PUBLIC const unit_name_string units_ghz;
105WS_DLL_PUBLIC const unit_name_string units_mhz;
106WS_DLL_PUBLIC const unit_name_string units_hz;
107WS_DLL_PUBLIC const unit_name_string units_hz_s;
108WS_DLL_PUBLIC const unit_name_string units_kbit;
109WS_DLL_PUBLIC const unit_name_string units_kbps;
110WS_DLL_PUBLIC const unit_name_string units_kibps;
111WS_DLL_PUBLIC const unit_name_string units_pkts;
112WS_DLL_PUBLIC const unit_name_string units_pkts_per_sec;
113WS_DLL_PUBLIC const unit_name_string units_km;
114WS_DLL_PUBLIC const unit_name_string units_kmh;
115WS_DLL_PUBLIC const unit_name_string units_m_s;
116WS_DLL_PUBLIC const unit_name_string units_cm_s;
117WS_DLL_PUBLIC const unit_name_string units_mm_s;
118WS_DLL_PUBLIC const unit_name_string units_milliamps;
119WS_DLL_PUBLIC const unit_name_string units_watt;
120WS_DLL_PUBLIC const unit_name_string units_milliwatt;
121WS_DLL_PUBLIC const unit_name_string units_microwatt;
122WS_DLL_PUBLIC const unit_name_string units_volt;
123WS_DLL_PUBLIC const unit_name_string units_grams_per_second;
124WS_DLL_PUBLIC const unit_name_string units_meter_sec;
125WS_DLL_PUBLIC const unit_name_string units_meter_sec_squared;
126WS_DLL_PUBLIC const unit_name_string units_bit_sec;
127WS_DLL_PUBLIC const unit_name_string units_segment_remaining;
128WS_DLL_PUBLIC const unit_name_string units_frame_frames;
129WS_DLL_PUBLIC const unit_name_string units_revolutions_per_minute;
130WS_DLL_PUBLIC const unit_name_string units_pascal;
131WS_DLL_PUBLIC const unit_name_string units_kilopascal;
132WS_DLL_PUBLIC const unit_name_string units_newton_metre;
133WS_DLL_PUBLIC const unit_name_string units_liter_per_hour;
134WS_DLL_PUBLIC const unit_name_string units_amp;
135WS_DLL_PUBLIC const unit_name_string units_watthour;
136WS_DLL_PUBLIC const unit_name_string units_bpm;
137WS_DLL_PUBLIC const unit_name_string units_calorie;
138WS_DLL_PUBLIC const unit_name_string units_cycle_cycles;
139WS_DLL_PUBLIC const unit_name_string units_ppm;
140
141#ifdef __cplusplus
142}
143#endif /* __cplusplus */
144
145#endif /* __UNIT_STRINGS_H__ */
146
147/*
148 * Editor modelines
149 *
150 * Local Variables:
151 * c-basic-offset: 4
152 * tab-width: 8
153 * indent-tabs-mode: nil
154 * End:
155 *
156 * ex: set shiftwidth=4 tabstop=8 expandtab:
157 * :indentSize=4:tabSize=8:noTabs=true:
158 */
unit_name_string
Definition unit_strings.h:26
unit_name_string::singular
char * singular
Definition unit_strings.h:27
unit_name_string::plural
char * plural
Definition unit_strings.h:28
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