• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Generated by ./xlat/gen.sh from ./xlat/inet_protocols.in; do not edit. */
2 
3 #include "gcc_compat.h"
4 #include "static_assert.h"
5 
6 #if defined(IPPROTO_IP) || (defined(HAVE_DECL_IPPROTO_IP) && HAVE_DECL_IPPROTO_IP)
7 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
8 static_assert((IPPROTO_IP) == (0), "IPPROTO_IP != 0");
9 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
10 #else
11 # define IPPROTO_IP 0
12 #endif
13 #if defined(IPPROTO_ICMP) || (defined(HAVE_DECL_IPPROTO_ICMP) && HAVE_DECL_IPPROTO_ICMP)
14 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
15 static_assert((IPPROTO_ICMP) == (1), "IPPROTO_ICMP != 1");
16 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
17 #else
18 # define IPPROTO_ICMP 1
19 #endif
20 #if defined(IPPROTO_IGMP) || (defined(HAVE_DECL_IPPROTO_IGMP) && HAVE_DECL_IPPROTO_IGMP)
21 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
22 static_assert((IPPROTO_IGMP) == (2), "IPPROTO_IGMP != 2");
23 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
24 #else
25 # define IPPROTO_IGMP 2
26 #endif
27 #if defined(IPPROTO_IPIP) || (defined(HAVE_DECL_IPPROTO_IPIP) && HAVE_DECL_IPPROTO_IPIP)
28 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
29 static_assert((IPPROTO_IPIP) == (4), "IPPROTO_IPIP != 4");
30 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
31 #else
32 # define IPPROTO_IPIP 4
33 #endif
34 #if defined(IPPROTO_TCP) || (defined(HAVE_DECL_IPPROTO_TCP) && HAVE_DECL_IPPROTO_TCP)
35 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
36 static_assert((IPPROTO_TCP) == (6), "IPPROTO_TCP != 6");
37 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
38 #else
39 # define IPPROTO_TCP 6
40 #endif
41 #if defined(IPPROTO_EGP) || (defined(HAVE_DECL_IPPROTO_EGP) && HAVE_DECL_IPPROTO_EGP)
42 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
43 static_assert((IPPROTO_EGP) == (8), "IPPROTO_EGP != 8");
44 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
45 #else
46 # define IPPROTO_EGP 8
47 #endif
48 #if defined(IPPROTO_PUP) || (defined(HAVE_DECL_IPPROTO_PUP) && HAVE_DECL_IPPROTO_PUP)
49 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
50 static_assert((IPPROTO_PUP) == (12), "IPPROTO_PUP != 12");
51 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
52 #else
53 # define IPPROTO_PUP 12
54 #endif
55 #if defined(IPPROTO_UDP) || (defined(HAVE_DECL_IPPROTO_UDP) && HAVE_DECL_IPPROTO_UDP)
56 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
57 static_assert((IPPROTO_UDP) == (17), "IPPROTO_UDP != 17");
58 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
59 #else
60 # define IPPROTO_UDP 17
61 #endif
62 #if defined(IPPROTO_IDP) || (defined(HAVE_DECL_IPPROTO_IDP) && HAVE_DECL_IPPROTO_IDP)
63 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
64 static_assert((IPPROTO_IDP) == (22), "IPPROTO_IDP != 22");
65 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
66 #else
67 # define IPPROTO_IDP 22
68 #endif
69 #if defined(IPPROTO_TP) || (defined(HAVE_DECL_IPPROTO_TP) && HAVE_DECL_IPPROTO_TP)
70 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
71 static_assert((IPPROTO_TP) == (29), "IPPROTO_TP != 29");
72 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
73 #else
74 # define IPPROTO_TP 29
75 #endif
76 #if defined(IPPROTO_DCCP) || (defined(HAVE_DECL_IPPROTO_DCCP) && HAVE_DECL_IPPROTO_DCCP)
77 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
78 static_assert((IPPROTO_DCCP) == (33), "IPPROTO_DCCP != 33");
79 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
80 #else
81 # define IPPROTO_DCCP 33
82 #endif
83 #if defined(IPPROTO_IPV6) || (defined(HAVE_DECL_IPPROTO_IPV6) && HAVE_DECL_IPPROTO_IPV6)
84 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
85 static_assert((IPPROTO_IPV6) == (41), "IPPROTO_IPV6 != 41");
86 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
87 #else
88 # define IPPROTO_IPV6 41
89 #endif
90 #if defined(IPPROTO_ROUTING) || (defined(HAVE_DECL_IPPROTO_ROUTING) && HAVE_DECL_IPPROTO_ROUTING)
91 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
92 static_assert((IPPROTO_ROUTING) == (43), "IPPROTO_ROUTING != 43");
93 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
94 #else
95 # define IPPROTO_ROUTING 43
96 #endif
97 #if defined(IPPROTO_FRAGMENT) || (defined(HAVE_DECL_IPPROTO_FRAGMENT) && HAVE_DECL_IPPROTO_FRAGMENT)
98 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
99 static_assert((IPPROTO_FRAGMENT) == (44), "IPPROTO_FRAGMENT != 44");
100 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
101 #else
102 # define IPPROTO_FRAGMENT 44
103 #endif
104 #if defined(IPPROTO_RSVP) || (defined(HAVE_DECL_IPPROTO_RSVP) && HAVE_DECL_IPPROTO_RSVP)
105 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
106 static_assert((IPPROTO_RSVP) == (46), "IPPROTO_RSVP != 46");
107 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
108 #else
109 # define IPPROTO_RSVP 46
110 #endif
111 #if defined(IPPROTO_GRE) || (defined(HAVE_DECL_IPPROTO_GRE) && HAVE_DECL_IPPROTO_GRE)
112 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
113 static_assert((IPPROTO_GRE) == (47), "IPPROTO_GRE != 47");
114 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
115 #else
116 # define IPPROTO_GRE 47
117 #endif
118 #if defined(IPPROTO_ESP) || (defined(HAVE_DECL_IPPROTO_ESP) && HAVE_DECL_IPPROTO_ESP)
119 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
120 static_assert((IPPROTO_ESP) == (50), "IPPROTO_ESP != 50");
121 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
122 #else
123 # define IPPROTO_ESP 50
124 #endif
125 #if defined(IPPROTO_AH) || (defined(HAVE_DECL_IPPROTO_AH) && HAVE_DECL_IPPROTO_AH)
126 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
127 static_assert((IPPROTO_AH) == (51), "IPPROTO_AH != 51");
128 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
129 #else
130 # define IPPROTO_AH 51
131 #endif
132 #if defined(IPPROTO_ICMPV6) || (defined(HAVE_DECL_IPPROTO_ICMPV6) && HAVE_DECL_IPPROTO_ICMPV6)
133 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
134 static_assert((IPPROTO_ICMPV6) == (58), "IPPROTO_ICMPV6 != 58");
135 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
136 #else
137 # define IPPROTO_ICMPV6 58
138 #endif
139 #if defined(IPPROTO_NONE) || (defined(HAVE_DECL_IPPROTO_NONE) && HAVE_DECL_IPPROTO_NONE)
140 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
141 static_assert((IPPROTO_NONE) == (59), "IPPROTO_NONE != 59");
142 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
143 #else
144 # define IPPROTO_NONE 59
145 #endif
146 #if defined(IPPROTO_DSTOPTS) || (defined(HAVE_DECL_IPPROTO_DSTOPTS) && HAVE_DECL_IPPROTO_DSTOPTS)
147 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
148 static_assert((IPPROTO_DSTOPTS) == (60), "IPPROTO_DSTOPTS != 60");
149 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
150 #else
151 # define IPPROTO_DSTOPTS 60
152 #endif
153 #if defined(IPPROTO_MTP) || (defined(HAVE_DECL_IPPROTO_MTP) && HAVE_DECL_IPPROTO_MTP)
154 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
155 static_assert((IPPROTO_MTP) == (92), "IPPROTO_MTP != 92");
156 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
157 #else
158 # define IPPROTO_MTP 92
159 #endif
160 #if defined(IPPROTO_BEETPH) || (defined(HAVE_DECL_IPPROTO_BEETPH) && HAVE_DECL_IPPROTO_BEETPH)
161 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
162 static_assert((IPPROTO_BEETPH) == (94), "IPPROTO_BEETPH != 94");
163 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
164 #else
165 # define IPPROTO_BEETPH 94
166 #endif
167 #if defined(IPPROTO_ENCAP) || (defined(HAVE_DECL_IPPROTO_ENCAP) && HAVE_DECL_IPPROTO_ENCAP)
168 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
169 static_assert((IPPROTO_ENCAP) == (98), "IPPROTO_ENCAP != 98");
170 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
171 #else
172 # define IPPROTO_ENCAP 98
173 #endif
174 #if defined(IPPROTO_PIM) || (defined(HAVE_DECL_IPPROTO_PIM) && HAVE_DECL_IPPROTO_PIM)
175 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
176 static_assert((IPPROTO_PIM) == (103), "IPPROTO_PIM != 103");
177 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
178 #else
179 # define IPPROTO_PIM 103
180 #endif
181 #if defined(IPPROTO_COMP) || (defined(HAVE_DECL_IPPROTO_COMP) && HAVE_DECL_IPPROTO_COMP)
182 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
183 static_assert((IPPROTO_COMP) == (108), "IPPROTO_COMP != 108");
184 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
185 #else
186 # define IPPROTO_COMP 108
187 #endif
188 #if defined(IPPROTO_L2TP) || (defined(HAVE_DECL_IPPROTO_L2TP) && HAVE_DECL_IPPROTO_L2TP)
189 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
190 static_assert((IPPROTO_L2TP) == (115), "IPPROTO_L2TP != 115");
191 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
192 #else
193 # define IPPROTO_L2TP 115
194 #endif
195 #if defined(IPPROTO_SCTP) || (defined(HAVE_DECL_IPPROTO_SCTP) && HAVE_DECL_IPPROTO_SCTP)
196 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
197 static_assert((IPPROTO_SCTP) == (132), "IPPROTO_SCTP != 132");
198 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
199 #else
200 # define IPPROTO_SCTP 132
201 #endif
202 #if defined(IPPROTO_MH) || (defined(HAVE_DECL_IPPROTO_MH) && HAVE_DECL_IPPROTO_MH)
203 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
204 static_assert((IPPROTO_MH) == (135), "IPPROTO_MH != 135");
205 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
206 #else
207 # define IPPROTO_MH 135
208 #endif
209 #if defined(IPPROTO_UDPLITE) || (defined(HAVE_DECL_IPPROTO_UDPLITE) && HAVE_DECL_IPPROTO_UDPLITE)
210 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
211 static_assert((IPPROTO_UDPLITE) == (136), "IPPROTO_UDPLITE != 136");
212 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
213 #else
214 # define IPPROTO_UDPLITE 136
215 #endif
216 #if defined(IPPROTO_MPLS) || (defined(HAVE_DECL_IPPROTO_MPLS) && HAVE_DECL_IPPROTO_MPLS)
217 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
218 static_assert((IPPROTO_MPLS) == (137), "IPPROTO_MPLS != 137");
219 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
220 #else
221 # define IPPROTO_MPLS 137
222 #endif
223 #if defined(IPPROTO_RAW) || (defined(HAVE_DECL_IPPROTO_RAW) && HAVE_DECL_IPPROTO_RAW)
224 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
225 static_assert((IPPROTO_RAW) == (255), "IPPROTO_RAW != 255");
226 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
227 #else
228 # define IPPROTO_RAW 255
229 #endif
230 #if defined(IPPROTO_MAX) || (defined(HAVE_DECL_IPPROTO_MAX) && HAVE_DECL_IPPROTO_MAX)
231 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
232 static_assert((IPPROTO_MAX) == (256), "IPPROTO_MAX != 256");
233 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
234 #else
235 # define IPPROTO_MAX 256
236 #endif
237 
238 #ifndef XLAT_MACROS_ONLY
239 
240 # ifndef IN_MPERS
241 
242 const struct xlat inet_protocols[] = {
243 
244  XLAT(IPPROTO_IP),
245  XLAT(IPPROTO_ICMP),
246  XLAT(IPPROTO_IGMP),
247  XLAT(IPPROTO_IPIP),
248  XLAT(IPPROTO_TCP),
249  XLAT(IPPROTO_EGP),
250  XLAT(IPPROTO_PUP),
251  XLAT(IPPROTO_UDP),
252  XLAT(IPPROTO_IDP),
253  XLAT(IPPROTO_TP),
254  XLAT(IPPROTO_DCCP),
255  XLAT(IPPROTO_IPV6),
256  XLAT(IPPROTO_ROUTING),
257  XLAT(IPPROTO_FRAGMENT),
258  XLAT(IPPROTO_RSVP),
259  XLAT(IPPROTO_GRE),
260  XLAT(IPPROTO_ESP),
261  XLAT(IPPROTO_AH),
262  XLAT(IPPROTO_ICMPV6),
263  XLAT(IPPROTO_NONE),
264  XLAT(IPPROTO_DSTOPTS),
265  XLAT(IPPROTO_MTP),
266  XLAT(IPPROTO_BEETPH),
267  XLAT(IPPROTO_ENCAP),
268  XLAT(IPPROTO_PIM),
269  XLAT(IPPROTO_COMP),
270  XLAT(IPPROTO_L2TP),
271  XLAT(IPPROTO_SCTP),
272  XLAT(IPPROTO_MH),
273  XLAT(IPPROTO_UDPLITE),
274  XLAT(IPPROTO_MPLS),
275  XLAT(IPPROTO_RAW),
276  XLAT(IPPROTO_MAX),
277  XLAT_END
278 };
279 
280 # endif /* !IN_MPERS */
281 
282 #endif /* !XLAT_MACROS_ONLY */
283