Coverage Report

Created: 2019-06-19 13:33

/work/build/src/udev/link-config-gperf.c
Line
Count
Source
1
/* ANSI-C code produced by gperf version 3.0.4 */
2
/* Command-line: /usr/bin/gperf --output-file src/udev/link-config-gperf.c ../../src/systemd/src/udev/net/link-config-gperf.gperf  */
3
/* Computed positions: -k'6-7' */
4
5
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
6
      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
7
      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
8
      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
9
      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
10
      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
11
      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
12
      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
13
      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
14
      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
15
      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
16
      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
17
      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
18
      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
19
      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
20
      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
21
      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
22
      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
23
      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
24
      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
25
      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
26
      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
27
      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
28
/* The character set is not based on ISO-646.  */
29
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
30
#endif
31
32
#line 1 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
33
34
#if __GNUC__ >= 7
35
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
36
#endif
37
#include <stddef.h>
38
#include "conf-parser.h"
39
#include "ethtool-util.h"
40
#include "link-config.h"
41
#include "network-internal.h"
42
#include <string.h>
43
44
#define TOTAL_KEYWORDS 33
45
42.0k
#define MIN_WORD_LENGTH 9
46
84.8k
#define MAX_WORD_LENGTH 31
47
#define MIN_HASH_VALUE 10
48
59.8k
#define MAX_HASH_VALUE 55
49
/* maximum key range = 46, duplicates = 0 */
50
51
#ifdef __GNUC__
52
__inline
53
#else
54
#ifdef __cplusplus
55
inline
56
#endif
57
#endif
58
static unsigned int
59
link_config_gperf_hash (register const char *str, register unsigned int len)
60
29.9k
{
61
29.9k
  static const unsigned char asso_values[] =
62
29.9k
    {
63
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
64
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
65
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
66
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
67
29.9k
      56, 56, 56, 56, 56, 56,  0, 56, 56, 56,
68
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
69
29.9k
      56, 56, 56, 56, 56,  0, 15,  0, 10, 56,
70
29.9k
      56,  5, 45, 56, 56, 10, 10,  0,  5,  5,
71
29.9k
      10, 56, 15, 56,  0,  0, 25, 15, 56, 56,
72
29.9k
      56, 56, 56, 56, 56, 56, 56,  5, 56, 56,
73
29.9k
       0, 10, 56, 56, 56, 10, 56, 56, 30, 56,
74
29.9k
      56,  5, 56, 56, 56, 56, 15, 10, 56, 56,
75
29.9k
      20, 56, 56, 56, 56, 56, 56, 56, 56, 56,
76
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
77
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
78
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
79
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
80
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
81
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
82
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
83
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
84
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
85
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
86
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
87
29.9k
      56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
88
29.9k
      56, 56, 56, 56, 56, 56
89
29.9k
    };
90
29.9k
  return len + asso_values[(unsigned char)str[6]] + asso_values[(unsigned char)str[5]];
91
29.9k
}
92
93
#ifdef __GNUC__
94
__inline
95
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
96
__attribute__ ((__gnu_inline__))
97
#endif
98
#endif
99
const struct ConfigPerfItem *
100
link_config_gperf_lookup (register const char *str, register unsigned int len)
101
42.4k
{
102
42.4k
  static const struct ConfigPerfItem wordlist[] =
103
42.4k
    {
104
42.4k
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
105
42.4k
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
106
42.4k
      {(char*)0}, {(char*)0},
107
42.4k
#line 26 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
108
42.4k
      {"Match.Type",                      config_parse_strv,               0,                             offsetof(link_config, match_type)},
109
42.4k
      {(char*)0}, {(char*)0},
110
42.4k
#line 38 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
111
42.4k
      {"Link.MTUBytes",                   config_parse_mtu,                AF_UNSPEC,                     offsetof(link_config, mtu)},
112
42.4k
#line 54 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
113
42.4k
      {"Link.Advertise",                  config_parse_advertise,          0,                             0},
114
42.4k
#line 34 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
115
42.4k
      {"Link.MACAddress",                 config_parse_hwaddr,             0,                             offsetof(link_config, mac)},
116
42.4k
#line 22 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
117
42.4k
      {"Match.MACAddress",                config_parse_hwaddrs,            0,                             offsetof(link_config, match_mac)},
118
42.4k
      {(char*)0},
119
42.4k
#line 31 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
120
42.4k
      {"Match.Architecture",              config_parse_net_condition,      CONDITION_ARCHITECTURE,        offsetof(link_config, conditions)},
121
42.4k
#line 36 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
122
42.4k
      {"Link.Name",                       config_parse_ifname,             0,                             offsetof(link_config, name)},
123
42.4k
#line 24 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
124
42.4k
      {"Match.Path",                      config_parse_strv,               0,                             offsetof(link_config, match_path)},
125
42.4k
#line 33 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
126
42.4k
      {"Link.MACAddressPolicy",           config_parse_mac_address_policy, 0,                             offsetof(link_config, mac_address_policy)},
127
42.4k
#line 25 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
128
42.4k
      {"Match.Driver",                    config_parse_strv,               0,                             offsetof(link_config, match_driver)},
129
42.4k
#line 23 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
130
42.4k
      {"Match.OriginalName",              config_parse_ifnames,            0,                             offsetof(link_config, match_name)},
131
42.4k
#line 43 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
132
42.4k
      {"Link.Port",                       config_parse_port,               0,                             offsetof(link_config, port)},
133
42.4k
#line 35 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
134
42.4k
      {"Link.NamePolicy",                 config_parse_name_policy,        0,                             offsetof(link_config, name_policy)},
135
42.4k
#line 53 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
136
42.4k
      {"Link.CombinedChannels",           config_parse_channel,            0,                             0},
137
42.4k
#line 45 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
138
42.4k
      {"Link.TCPSegmentationOffload",     config_parse_tristate,           0,                             offsetof(link_config, features[NET_DEV_FEAT_TSO])},
139
42.4k
#line 46 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
140
42.4k
      {"Link.TCP6SegmentationOffload",    config_parse_tristate,           0,                             offsetof(link_config, features[NET_DEV_FEAT_TSO6])},
141
42.4k
#line 30 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
142
42.4k
      {"Match.KernelVersion",             config_parse_net_condition,      CONDITION_KERNEL_VERSION,      offsetof(link_config, conditions)},
143
42.4k
#line 41 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
144
42.4k
      {"Link.AutoNegotiation",            config_parse_tristate,           0,                             offsetof(link_config, autonegotiation)},
145
42.4k
#line 40 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
146
42.4k
      {"Link.Duplex",                     config_parse_duplex,             0,                             offsetof(link_config, duplex)},
147
42.4k
      {(char*)0},
148
42.4k
#line 29 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
149
42.4k
      {"Match.KernelCommandLine",         config_parse_net_condition,      CONDITION_KERNEL_COMMAND_LINE, offsetof(link_config, conditions)},
150
42.4k
#line 42 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
151
42.4k
      {"Link.WakeOnLan",                  config_parse_wol,                0,                             offsetof(link_config, wol)},
152
42.4k
#line 51 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
153
42.4k
      {"Link.TxChannels",                 config_parse_channel,            0,                             0},
154
42.4k
#line 32 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
155
42.4k
      {"Link.Description",                config_parse_string,             0,                             offsetof(link_config, description)},
156
42.4k
#line 47 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
157
42.4k
      {"Link.UDPSegmentationOffload",     config_parse_warn_compat,        DISABLED_LEGACY,               0},
158
42.4k
#line 52 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
159
42.4k
      {"Link.OtherChannels",              config_parse_channel,            0,                             0},
160
42.4k
#line 49 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
161
42.4k
      {"Link.LargeReceiveOffload",        config_parse_tristate,           0,                             offsetof(link_config, features[NET_DEV_FEAT_LRO])},
162
42.4k
#line 37 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
163
42.4k
      {"Link.Alias",                      config_parse_ifalias,            0,                             offsetof(link_config, alias)},
164
42.4k
#line 48 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
165
42.4k
      {"Link.GenericReceiveOffload",      config_parse_tristate,           0,                             offsetof(link_config, features[NET_DEV_FEAT_GRO])},
166
42.4k
      {(char*)0},
167
42.4k
#line 39 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
168
42.4k
      {"Link.BitsPerSecond",              config_parse_si_size,            0,                             offsetof(link_config, speed)},
169
42.4k
      {(char*)0},
170
42.4k
#line 28 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
171
42.4k
      {"Match.Virtualization",            config_parse_net_condition,      CONDITION_VIRTUALIZATION,      offsetof(link_config, conditions)},
172
42.4k
#line 44 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
173
42.4k
      {"Link.GenericSegmentationOffload", config_parse_tristate,           0,                             offsetof(link_config, features[NET_DEV_FEAT_GSO])},
174
42.4k
      {(char*)0}, {(char*)0}, {(char*)0},
175
42.4k
#line 50 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
176
42.4k
      {"Link.RxChannels",                 config_parse_channel,            0,                             0},
177
42.4k
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
178
42.4k
#line 27 "../../src/systemd/src/udev/net/link-config-gperf.gperf"
179
42.4k
      {"Match.Host",                      config_parse_net_condition,      CONDITION_HOST,                offsetof(link_config, conditions)}
180
42.4k
    };
181
42.4k
182
42.4k
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
183
42.4k
    {
184
29.9k
      register int key = link_config_gperf_hash (str, len);
185
29.9k
186
29.9k
      if (key <= MAX_HASH_VALUE && key >= 0)
187
29.5k
        {
188
29.5k
          register const char *s = wordlist[key].section_and_lvalue;
189
29.5k
190
29.5k
          if (s && *str == *s && !strcmp (str + 1, s + 1))
191
29.5k
            return &wordlist[key];
192
14.4k
        }
193
29.9k
    }
194
14.4k
  return 0;
195
14.4k
}