summaryrefslogtreecommitdiffstats
path: root/src/vnet/ipfix-export/ipfix_info_elements.h
blob: 171cdfe702eb5167cfbba402fbd3602d5fafa156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
/*
 * Copyright (c) 2015 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef __included_ipfix_info_elements_h__
#define __included_ipfix_info_elements_h__

#define foreach_ipfix_info_element_t                                    \
_(octetDeltaCount, 1, u64)                                              \
_(packetDeltaCount, 2, u64)                                             \
_(deltaFlowCount, 3, u64)                                               \
_(protocolIdentifier, 4, u8)                                            \
_(ipClassOfService, 5, u8)                                              \
_(tcpControlBits, 6, u16)                                               \
_(sourceTransportPort, 7, u16)                                          \
_(sourceIPv4Address, 8, ip4_address_t)                                  \
_(sourceIPv4PrefixLength, 9, u8)                                        \
_(ingressInterface, 10, u32)                                            \
_(destinationTransportPort, 11, u16)                                    \
_(destinationIPv4Address, 12, ip4_address_t)                            \
_(destinationIPv4PrefixLength, 13, u8)                                  \
_(egressInterface, 14, u32)                                             \
_(ipNextHopIPv4Address, 15, ip4_address_t)                              \
_(bgpSourceAsNumber, 16, u32)                                           \
_(bgpDestinationAsNumber, 17, u32)                                      \
_(bgpNextHopIPv4Address, 18, ip4_address_t)                             \
_(postMCastPacketDeltaCount, 19, u64)                                   \
_(postMCastOctetDeltaCount, 20, u64)                                    \
_(flowEndSysUpTime, 21, u32)                                            \
_(flowStartSysUpTime, 22, u32)                                          \
_(postOctetDeltaCount, 23, u64)                                         \
_(postPacketDeltaCount, 24, u64)                                        \
_(minimumIpTotalLength, 25, u64)                                        \
_(maximumIpTotalLength, 26, u64)                                        \
_(sourceIPv6Address, 27, ip6_address_t)                                 \
_(destinationIPv6Address, 28, ip6_address_t)                            \
_(sourceIPv6PrefixLength, 29, u8)                                       \
_(destinationIPv6PrefixLength, 30, u8)                                  \
_(flowLabelIPv6, 31, u32)                                               \
_(icmpTypeCodeIPv4, 32, u16)                                            \
_(igmpType, 33, u8)                                                     \
_(samplingInterval, 34, u32)                                            \
_(samplingAlgorithm, 35, u8)                                            \
_(flowActiveTimeout, 36, u16)                                           \
_(flowIdleTimeout, 37, u16)                                             \
_(engineType, 38, u8)                                                   \
_(engineId, 39, u8)                                                     \
_(exportedOctetTotalCount, 40, u64)                                     \
_(exportedMessageTotalCount, 41, u64)                                   \
_(exportedFlowRecordTotalCount, 42, u64)                                \
_(ipv4RouterSc, 43, ip4_address_t)                                      \
_(sourceIPv4Prefix, 44, ip4_address_t)                                  \
_(destinationIPv4Prefix, 45, ip4_address_t)                             \
_(mplsTopLabelType, 46, u8)                                             \
_(mplsTopLabelIPv4Address, 47, ip4_address_t)                           \
_(samplerId, 48, u8)                                                    \
_(samplerMode, 49, u8)                                                  \
_(samplerRandomInterval, 50, u32)                                       \
_(classId, 51, u8)                                                      \
_(minimumTTL, 52, u8)                                                   \
_(maximumTTL, 53, u8)                                                   \
_(fragmentIdentification, 54, u32)                                      \
_(postIpClassOfService, 55, u8)                                         \
_(sourceMacAddress, 56, macAddress)                                     \
_(postDestinationMacAddress, 57, macAddress)                            \
_(vlanId, 58, u16)                                                      \
_(postVlanId, 59, u16)                                                  \
_(ipVersion, 60, u8)                                                    \
_(flowDirection, 61, u8)                                                \
_(ipNextHopIPv6Address, 62, ip6_address_t)                              \
_(bgpNextHopIPv6Address, 63, ip6_address_t)                             \
_(ipv6ExtensionHeaders, 64, u32)                                        \
_(mplsTopLabelStackSection, 70, octetArray)                             \
_(mplsLabelStackSection2, 71, octetArray)                               \
_(mplsLabelStackSection3, 72, octetArray)                               \
_(mplsLabelStackSection4, 73, octetArray)                               \
_(mplsLabelStackSection5, 74, octetArray)                               \
_(mplsLabelStackSection6, 75, octetArray)                               \
_(mplsLabelStackSection7, 76, octetArray)                               \
_(mplsLabelStackSection8, 77, octetArray)                               \
_(mplsLabelStackSection9, 78, octetArray)                               \
_(mplsLabelStackSection10, 79, octetArray)                              \
_(destinationMacAddress, 80, macAddress)                                \
_(postSourceMacAddress, 81, macAddress)                                 \
_(interfaceName, 82, string)                                            \
_(interfaceDescription, 83, string)                                     \
_(samplerName, 84, string)                                              \
_(octetTotalCount, 85, u64)                                             \
_(packetTotalCount, 86, u64)                                            \
_(flagsAndSamplerId, 87, u32)                                           \
_(fragmentOffset, 88, u16)                                              \
_(forwardingStatus, 89, u32)                                            \
_(mplsVpnRouteDistinguisher, 90, octetArray)                            \
_(mplsTopLabelPrefixLength, 91, u8)                                     \
_(srcTrafficIndex, 92, u32)                                             \
_(dstTrafficIndex, 93, u32)                                             \
_(applicationDescription, 94, string)                                   \
_(applicationId, 95, octetArray)                                        \
_(applicationName, 96, string)                                          \
_(Assigned, 97, for NetFlow v9 compatibility	)                       \
_(postIpDiffServCodePoint, 98, u8)                                      \
_(multicastReplicationFactor, 99, u32)                                  \
_(className, 100, string)                                               \
_(classificationEngineId, 101, u8)                                      \
_(layer2packetSectionOffset, 102, u16)                                  \
_(layer2packetSectionSize, 103, u16)                                    \
_(layer2packetSectionData, 104, octetArray)                             \
_(bgpNextAdjacentAsNumber, 128, u32)                                    \
_(bgpPrevAdjacentAsNumber, 129, u32)                                    \
_(exporterIPv4Address, 130, ip4_address_t)                              \
_(exporterIPv6Address, 131, ip6_address_t)                              \
_(droppedOctetDeltaCount, 132, u64)                                     \
_(droppedPacketDeltaCount, 133, u64)                                    \
_(droppedOctetTotalCount, 134, u64)                                     \
_(droppedPacketTotalCount, 135, u64)                                    \
_(flowEndReason, 136, u8)                                               \
_(commonPropertiesId, 137, u64)                                         \
_(observationPointId, 138, u64)                                         \
_(icmpTypeCodeIPv6, 139, u16)                                           \
_(mplsTopLabelIPv6Address, 140, ip6_address_t)                          \
_(lineCardId, 141, u32)                                                 \
_(portId, 142, u32)                                                     \
_(meteringProcessId, 143, u32)                                          \
_(exportingProcessId, 144, u32)                                         \
_(templateId, 145, u16)                                                 \
_(wlanChannelId, 146, u8)                                               \
_(wlanSSID, 147, string)                                                \
_(flowId, 148, u64)                                                     \
_(observationDomainId, 149, u32)                                        \
_(flowStartSeconds, 150, dateTimeSeconds)                               \
_(flowEndSeconds, 151, dateTimeSeconds)                                 \
_(flowStartMilliseconds, 152, dateTimeMilliseconds)                     \
_(flowEndMilliseconds, 153, dateTimeMilliseconds)                       \
_(flowStartMicroseconds, 154, dateTimeMicroseconds)                     \
_(flowEndMicroseconds, 155, dateTimeMicroseconds)                       \
_(flowStartNanoseconds, 156, dateTimeNanoseconds)                       \
_(flowEndNanoseconds, 157, dateTimeNanoseconds)                         \
_(flowStartDeltaMicroseconds, 158, u32)                                 \
_(flowEndDeltaMicroseconds, 159, u32)                                   \
_(systemInitTimeMilliseconds, 160, dateTimeMilliseconds)                \
_(flowDurationMilliseconds, 161, u32)                                   \
_(flowDurationMicroseconds, 162, u32)                                   \
_(observedFlowTotalCount, 163, u64)                                     \
_(ignoredPacketTotalCount, 164, u64)                                    \
_(ignoredOctetTotalCount, 165, u64)                                     \
_(notSentFlowTotalCount, 166, u64)                                      \
_(notSentPacketTotalCount, 167, u64)                                    \
_(notSentOctetTotalCount, 168, u64)                                     \
_(destinationIPv6Prefix, 169, ip6_address_t)                            \
_(sourceIPv6Prefix, 170, ip6_address_t)                                 \
_(postOctetTotalCount, 171, u64)                                        \
_(postPacketTotalCount, 172, u64)                                       \
_(flowKeyIndicator, 173, u64)                                           \
_(postMCastPacketTotalCount, 174, u64)                                  \
_(postMCastOctetTotalCount, 175, u64)                                   \
_(icmpTypeIPv4, 176, u8)                                                \
_(icmpCodeIPv4, 177, u8)                                                \
_(icmpTypeIPv6, 178, u8)                                                \
_(icmpCodeIPv6, 179, u8)                                                \
_(udpSourcePort, 180, u16)                                              \
_(udpDestinationPort, 181, u16)                                         \
_(tcpSourcePort, 182, u16)                                              \
_(tcpDestinationPort, 183, u16)                                         \
_(tcpSequenceNumber, 184, u32)                                          \
_(tcpAcknowledgementNumber, 185, u32)                                   \
_(tcpWindowSize, 186, u16)                                              \
_(tcpUrgentPointer, 187, u16)                                           \
_(tcpHeaderLength, 188, u8)                                             \
_(ipHeaderLength, 189, u8)                                              \
_(totalLengthIPv4, 190, u16)                                            \
_(payloadLengthIPv6, 191, u16)                                          \
_(ipTTL, 192, u8)                                                       \
_(nextHeaderIPv6, 193, u8)                                              \
_(mplsPayloadLength, 194, u32)                                          \
_(ipDiffServCodePoint, 195, u8)                                         \
_(ipPrecedence, 196, u8)                                                \
_(fragmentFlags, 197, u8)                                               \
_(octetDeltaSumOfSquares, 198, u64)                                     \
_(octetTotalSumOfSquares, 199, u64)                                     \
_(mplsTopLabelTTL, 200, u8)                                             \
_(mplsLabelStackLength, 201, u32)                                       \
_(mplsLabelStackDepth, 202, u32)                                        \
_(mplsTopLabelExp, 203, u8)                                             \
_(ipPayloadLength, 204, u32)                                            \
_(udpMessageLength, 205, u16)                                           \
_(isMulticast, 206, u8)                                                 \
_(ipv4IHL, 207, u8)                                                     \
_(ipv4Options, 208, u32)                                                \
_(tcpOptions, 209, u64)                                                 \
_(paddingOctets, 210, octetArray)                                       \
_(collectorIPv4Address, 211, ip4_address_t)                             \
_(collectorIPv6Address, 212, ip6_address_t)                             \
_(exportInterface, 213, u32)                                            \
_(exportProtocolVersion, 214, u8)                                       \
_(exportTransportProtocol, 215, u8)                                     \
_(collectorTransportPort, 216, u16)                                     \
_(exporterTransportPort, 217, u16)                                      \
_(tcpSynTotalCount, 218, u64)                                           \
_(tcpFinTotalCount, 219, u64)                                           \
_(tcpRstTotalCount, 220, u64)                                           \
_(tcpPshTotalCount, 221, u64)                                           \
_(tcpAckTotalCount, 222, u64)                                           \
_(tcpUrgTotalCount, 223, u64)                                           \
_(ipTotalLength, 224, u64)                                              \
_(postNATSourceIPv4Address, 225, ip4_address_t)                         \
_(postNATDestinationIPv4Address, 226, ip4_address_t)                    \
_(postNAPTSourceTransportPort, 227, u16)                                \
_(postNAPTDestinationTransportPort, 228, u16)                           \
_(natOriginatingAddressRealm, 229, u8)                                  \
_(natEvent, 230, u8)                                                    \
_(initiatorOctets, 231, u64)                                            \
_(responderOctets, 232, u64)                                            \
_(firewallEvent, 233, u8)                                               \
_(ingressVRFID, 234, u32)                                               \
_(egressVRFID, 235, u32)                                                \
_(VRFname, 236, string)                                                 \
_(postMplsTopLabelExp, 237, u8)                                         \
_(tcpWindowScale, 238, u16)                                             \
_(biflowDirection, 239, u8)                                             \
_(ethernetHeaderLength, 240, u8)                                        \
_(ethernetPayloadLength, 241, u16)                                      \
_(ethernetTotalLength, 242, u16)                                        \
_(dot1qVlanId, 243, u16)                                                \
_(dot1qPriority, 244, u8)                                               \
_(dot1qCustomerVlanId, 245, u16)                                        \
_(dot1qCustomerPriority, 246, u8)                                       \
_(metroEvcId, 247, string)                                              \
_(metroEvcType, 248, u8)                                                \
_(pseudoWireId, 249, u32)                                               \
_(pseudoWireType, 250, u16)                                             \
_(pseudoWireControlWord, 251, u32)                                      \
_(ingressPhysicalInterface, 252, u32)                                   \
_(egressPhysicalInterface, 253, u32)                                    \
_(postDot1qVlanId, 254, u16)                                            \
_(postDot1qCustomerVlanId, 255, u16)                                    \
_(ethernetType, 256, u16)                                               \
_(postIpPrecedence, 257, u8)                                            \
_(collectionTimeMilliseconds, 258, dateTimeMilliseconds)                \
_(exportSctpStreamId, 259, u16)                                         \
_(maxExportSeconds, 260, dateTimeSeconds)                               \
_(maxFlowEndSeconds, 261, dateTimeSeconds)                              \
_(messageMD5Checksum, 262, octetArray)                                  \
_(messageScope, 263, u8)                                                \
_(minExportSeconds, 264, dateTimeSeconds)                               \
_(minFlowStartSeconds, 265, dateTimeSeconds)                            \
_(opaqueOctets, 266, octetArray)                                        \
_(sessionScope, 267, u8)                                                \
_(maxFlowEndMicroseconds, 268, dateTimeMicroseconds)                    \
_(maxFlowEndMilliseconds, 269, dateTimeMilliseconds)                    \
_(maxFlowEndNanoseconds, 270, dateTimeNanoseconds)                      \
_(minFlowStartMicroseconds, 271, dateTimeMicroseconds)                  \
_(minFlowStartMilliseconds, 272, dateTimeMilliseconds)                  \
_(minFlowStartNanoseconds, 273, dateTimeNanoseconds)                    \
_(collectorCertificate, 274, octetArray)                                \
_(exporterCertificate, 275, octetArray)                                 \
_(dataRecordsReliability, 276, boolean)                                 \
_(observationPointType, 277, u8)                                        \
_(newConnectionDeltaCount, 278, u32)                                    \
_(connectionSumDurationSeconds, 279, u64)                               \
_(connectionTransactionId, 280, u64)                                    \
_(postNATSourceIPv6Address, 281, ip6_address_t)                         \
_(postNATDestinationIPv6Address, 282, ip6_address_t)                    \
_(natPoolId, 283, u32)                                                  \
_(natPoolName, 284, string)                                             \
_(anonymizationFlags, 285, u16)                                         \
_(anonymizationTechnique, 286, u16)                                     \
_(informationElementIndex, 287, u16)                                    \
_(p2pTechnology, 288, string)                                           \
_(tunnelTechnology, 289, string)                                        \
_(encryptedTechnology, 290, string)                                     \
_(basicList, 291, basicList)                                            \
_(subTemplateList, 292, subTemplateList)                                \
_(subTemplateMultiList, 293, subTemplateMultiList)                      \
_(bgpValidityState, 294, u8)                                            \
_(IPSecSPI, 295, u32)                                                   \
_(greKey, 296, u32)                                                     \
_(natType, 297, u8)                                                     \
_(initiatorPackets, 298, u64)                                           \
_(responderPackets, 299, u64)                                           \
_(observationDomainName, 300, string)                                   \
_(selectionSequenceId, 301, u64)                                        \
_(selectorId, 302, u64)                                                 \
_(informationElementId, 303, u16)                                       \
_(selectorAlgorithm, 304, u16)                                          \
_(samplingPacketInterval, 305, u32)                                     \
_(samplingPacketSpace, 306, u32)                                        \
_(samplingTimeInterval, 307, u32)                                       \
_(samplingTimeSpace, 308, u32)                                          \
_(samplingSize, 309, u32)                                               \
_(samplingPopulation, 310, u32)                                         \
_(samplingProbability, 311, float64)                                    \
_(dataLinkFrameSize, 312, u16)                                          \
_(ipHeaderPacketSection, 313, octetArray)                               \
_(ipPayloadPacketSection, 314, octetArray)                              \
_(dataLinkFrameSection, 315, octetArray)                                \
_(mplsLabelStackSection, 316, octetArray)                               \
_(mplsPayloadPacketSection, 317, octetArray)                            \
_(selectorIdTotalPktsObserved, 318, u64)                                \
_(selectorIdTotalPktsSelected, 319, u64)                                \
_(absoluteError, 320, float64)                                          \
_(relativeError, 321, float64)                                          \
_(observationTimeSeconds, 322, dateTimeSeconds)                         \
_(observationTimeMilliseconds, 323, dateTimeMilliseconds)               \
_(observationTimeMicroseconds, 324, dateTimeMicroseconds)               \
_(observationTimeNanoseconds, 325, dateTimeNanoseconds)                 \
_(digestHashValue, 326, u64)                                            \
_(hashIPPayloadOffset, 327, u64)                                        \
_(hashIPPayloadSize, 328, u64)                                          \
_(hashOutputRangeMin, 329, u64)                                         \
_(hashOutputRangeMax, 330, u64)                                         \
_(hashSelectedRangeMin, 331, u64)                                       \
_(hashSelectedRangeMax, 332, u64)                                       \
_(hashDigestOutput, 333, boolean)                                       \
_(hashInitialiserValue, 334, u64)                                       \
_(selectorName, 335, string)                                            \
_(upperCILimit, 336, float64)                                           \
_(lowerCILimit, 337, float64)                                           \
_(confidenceLevel, 338, float64)                                        \
_(informationElementDataType, 339, u8)                                  \
_(informationElementDescription, 340, string)                           \
_(informationElementName, 341, string)                                  \
_(informationElementRangeBegin, 342, u64)                               \
_(informationElementRangeEnd, 343, u64)                                 \
_(informationElementSemantics, 344, u8)                                 \
_(informationElementUnits, 345, u16)                                    \
_(privateEnterpriseNumber, 346, u32)                                    \
_(virtualStationInterfaceId, 347, octetArray)                           \
_(virtualStationInterfaceName, 348, string)                             \
_(virtualStationUUID, 349, octetArray)                                  \
_(virtualStationName, 350, string)                                      \
_(layer2SegmentId, 351, u64)                                            \
_(layer2OctetDeltaCount, 352, u64)                                      \
_(layer2OctetTotalCount, 353, u64)                                      \
_(ingressUnicastPacketTotalCount, 354, u64)                             \
_(ingressMulticastPacketTotalCount, 355, u64)                           \
_(ingressBroadcastPacketTotalCount, 356, u64)                           \
_(egressUnicastPacketTotalCount, 357, u64)                              \
_(egressBroadcastPacketTotalCount, 358, u64)                            \
_(monitoringIntervalStartMilliSeconds, 359, dateTimeMilliseconds)       \
_(monitoringIntervalEndMilliSeconds, 360, dateTimeMilliseconds)         \
_(portRangeStart, 361, u16)                                             \
_(portRangeEnd, 362, u16)                                               \
_(portRangeStepSize, 363, u16)                                          \
_(portRangeNumPorts, 364, u16)                                          \
_(staMacAddress, 365, macAddress)                                       \
_(staIPv4Address, 366, ip4_address_t)                                   \
_(wtpMacAddress, 367, macAddress )                                      \
_(ingressInterfaceType, 368, u32)                                       \
_(egressInterfaceType, 369, u32)                                        \
_(rtpSequenceNumber, 370, u16)                                          \
_(userName, 371, string)                                                \
_(applicationCategoryName, 372, string)                                 \
_(applicationSubCategoryName, 373, string)                              \
_(applicationGroupName, 374, string)                                    \
_(originalFlowsPresent, 375, u64)                                       \
_(originalFlowsInitiated, 376, u64)                                     \
_(originalFlowsCompleted, 377, u64)                                     \
_(distinctCountOfSourceIPAddress, 378, u64)                             \
_(distinctCountOfDestinationIPAddress, 379, u64)                        \
_(distinctCountOfSourceIPv4Address, 380, u32)                           \
_(distinctCountOfDestinationIPv4Address, 381, u32)                      \
_(distinctCountOfSourceIPv6Address, 382, u64)                           \
_(distinctCountOfDestinationIPv6Address, 383, u64)                      \
_(valueDistributionMethod, 384, u8)                                     \
_(rfc3550JitterMilliseconds, 385, u32)                                  \
_(rfc3550JitterMicroseconds, 386, u32)                                  \
_(rfc3550JitterNanoseconds, 387, u32)                                   \
_(dot1qDEI, 388, boolean)                                               \
_(dot1qCustomerDEI, 389, boolean)                                       \
_(flowSelectorAlgorithm, 390, u16)                                      \
_(flowSelectedOctetDeltaCount, 391, u64)                                \
_(flowSelectedPacketDeltaCount, 392, u64)                               \
_(flowSelectedFlowDeltaCount, 393, u64)                                 \
_(selectorIDTotalFlowsObserved, 394, u64)                               \
_(selectorIDTotalFlowsSelected, 395, u64)                               \
_(samplingFlowInterval, 396, u64)                                       \
_(samplingFlowSpacing, 397, u64)                                        \
_(flowSamplingTimeInterval, 398, u64)                                   \
_(flowSamplingTimeSpacing, 399, u64)                                    \
_(hashFlowDomain, 400, u16)                                             \
_(transportOctetDeltaCount, 401, u64)                                   \
_(transportPacketDeltaCount, 402, u64)                                  \
_(originalExporterIPv4Address, 403, ip4_address_t)                      \
_(originalExporterIPv6Address, 404, ip6_address_t)                      \
_(originalObservationDomainId, 405, u32)                                \
_(intermediateProcessId, 406, u32)                                      \
_(ignoredDataRecordTotalCount, 407, u64)                                \
_(dataLinkFrameType, 408, u16)                                          \
_(sectionOffset, 409, u16)                                              \
_(sectionExportedOctets, 410, u16)                                      \
_(dot1qServiceInstanceTag, 411, octetArray)                             \
_(dot1qServiceInstanceId, 412, u32)                                     \
_(dot1qServiceInstancePriority, 413, u8)                                \
_(dot1qCustomerSourceMacAddress, 414, macAddress)                       \
_(dot1qCustomerDestinationMacAddress, 415, macAddress)                  \
_(postLayer2OctetDeltaCount, 417, u64)                                  \
_(postMCastLayer2OctetDeltaCount, 418, u64)                             \
_(postLayer2OctetTotalCount, 420, u64)                                  \
_(postMCastLayer2OctetTotalCount, 421, u64)                             \
_(minimumLayer2TotalLength, 422, u64)                                   \
_(maximumLayer2TotalLength, 423, u64)                                   \
_(droppedLayer2OctetDeltaCount, 424, u64)                               \
_(droppedLayer2OctetTotalCount, 425, u64)                               \
_(ignoredLayer2OctetTotalCount, 426, u64)                               \
_(notSentLayer2OctetTotalCount, 427, u64)                               \
_(layer2OctetDeltaSumOfSquares, 428, u64)                               \
_(layer2OctetTotalSumOfSquares, 429, u64)                               \
_(layer2FrameDeltaCount, 430, u64)                                      \
_(layer2FrameTotalCount, 431, u64)                                      \
_(pseudoWireDestinationIPv4Address, 432, ip4_address_t)                 \
_(ignoredLayer2FrameTotalCount, 433, u64)                               \
_(natQuotaExceededEvent, 466, u32)                                      \
_(maxSessionEntries, 471, u32)                                          \
_(maxBIBEntries, 472, u32)                                              \
_(maxEntriesPerUser, 473, u32)                                          \
_(maxFragmentsPendingReassembly, 475, u32)

typedef enum
{
#define _(n,v,t) n = v,
  foreach_ipfix_info_element_t
#undef _
} ipfix_info_element_id_t;

#endif /* __included_ipfix_info_elements_h__ */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
(): node = i[1] # Check the system resources if not acfg.min_system_resources(node): return # Stop VPP VPPUtil.stop(node) # Huge Pages ret = autoconfig_hugepage_apply(node, ask_questions) if ret != 0: return # VPP ret = autoconfig_vpp_apply(node, ask_questions) if ret != 0: return # Grub ret = autoconfig_grub_apply(node, ask_questions) if ret != 0: # We can still start VPP, even if we haven't configured grub VPPUtil.start(node) return # Everything is configured start vpp VPPUtil.start(node) def autoconfig_dryrun(ask_questions=True): """ Execute the dryrun function. :param ask_questions: When true ask the user for paraameters :type ask_questions: bool """ acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE, clean=True) # Stop VPP on each node nodes = acfg.get_nodes() for i in nodes.items(): node = i[1] VPPUtil.stop(node) # Discover acfg.discover() # Check the system resources nodes = acfg.get_nodes() for i in nodes.items(): node = i[1] if not acfg.min_system_resources(node): return # Modify the devices if ask_questions: acfg.modify_devices() else: acfg.update_interfaces_config() # If there are no interfaces, just return for i in nodes.items(): node = i[1] if not acfg.has_interfaces(node): print("\nThere are no VPP interfaces configured, please configure at least 1.") return # Modify CPU acfg.modify_cpu(ask_questions) # Calculate the cpu parameters acfg.calculate_cpu_parameters() # Acquire TCP stack parameters if ask_questions: acfg.acquire_tcp_params() # Apply the startup acfg.apply_vpp_startup() # Apply the grub configuration acfg.apply_grub_cmdline() # Huge Pages if ask_questions: acfg.modify_huge_pages() acfg.apply_huge_pages() def autoconfig_install(): """ Install or Uninstall VPP. """ # Since these commands will take a while, we # want to see the progress logger = logging.getLogger() acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE) vutil = VPPUtil() nodes = acfg.get_nodes() for i in nodes.items(): node = i[1] pkgs = vutil.get_installed_vpp_pkgs() if len(pkgs) > 0: print ("\nThese packages are installed on node {}" .format(node['host'])) print ("{:25} {}".format("Name", "Version")) for pkg in pkgs: try: print ("{:25} {}".format( pkg['name'], pkg['version'])) except KeyError: print ("{}".format(pkg['name'])) question = "\nDo you want to uninstall these " question += "packages [y/N]? " answer = autoconfig_yn(question, 'n') if answer == 'y': logger.setLevel(logging.INFO) vutil.uninstall_vpp(node) else: print ("\nThere are no VPP packages on node {}." .format(node['host'])) question = "Do you want to install VPP [Y/n]? " answer = autoconfig_yn(question, 'y') if answer == 'y': question = "Do you want to install the release version [Y/n]? " answer = autoconfig_yn(question, 'y') if answer == 'y': branch = 'release' else: branch = 'master' logger.setLevel(logging.INFO) vutil.install_vpp(node, branch) # Set the logging level back logger.setLevel(logging.ERROR) def autoconfig_patch_qemu(): """ Patch the correct qemu version that is needed for openstack """ # Since these commands will take a while, we # want to see the progress logger = logging.getLogger() acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE) nodes = acfg.get_nodes() for i in nodes.items(): node = i[1] logger.setLevel(logging.INFO) acfg.patch_qemu(node) def autoconfig_ipv4_setup(): """ Setup IPv4 interfaces """ acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE) acfg.ipv4_interface_setup() def autoconfig_create_iperf_vm(): """ Setup IPv4 interfaces """ acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE) acfg.destroy_iperf_vm('iperf-server') acfg.create_and_bridge_iperf_virtual_interface() acfg.create_iperf_vm('iperf-server') def autoconfig_not_implemented(): """ This feature is not implemented """ print ("\nThis Feature is not implemented yet....") def autoconfig_basic_test_menu(): """ The auto configuration basic test menu """ basic_menu_text = '\nWhat would you like to do?\n\n\ 1) List/Create Simple IPv4 Setup\n\ 2) Create an iperf VM and Connect to VPP an interface\n\ 9 or q) Back to main menu.' print ("{}".format(basic_menu_text)) input_valid = False answer = '' while not input_valid: answer = input("\nCommand: ") if len(answer) > 1: print ("Please enter only 1 character.") continue if re.findall(r'[Qq1-29]', answer): input_valid = True answer = answer[0].lower() else: print ("Please enter a character between 1 and 2 or 9.") if answer == '9': answer = 'q' return answer def autoconfig_basic_test(): """ The auto configuration basic test menu """ vutil = VPPUtil() pkgs = vutil.get_installed_vpp_pkgs() if len(pkgs) == 0: print ("\nVPP is not installed, install VPP with option 4.") return answer = '' while answer != 'q': answer = autoconfig_basic_test_menu() if answer == '1': autoconfig_ipv4_setup() elif answer == '2': autoconfig_create_iperf_vm() elif answer == '9' or answer == 'q': return else: autoconfig_not_implemented() def autoconfig_main_menu(): """ The auto configuration main menu """ main_menu_text = '\nWhat would you like to do?\n\n\ 1) Show basic system information\n\ 2) Dry Run (Saves the configuration files in {}/vpp/vpp-config/dryrun.\n\ 3) Full configuration (WARNING: This will change the system configuration)\n\ 4) List/Install/Uninstall VPP.\n\ q) Quit'.format(rootdir, rootdir) # 5) Dry Run from {}/vpp/vpp-config/auto-config.yaml (will not ask questions).\n\ # 6) Install QEMU patch (Needed when running openstack).\n\ print ("{}".format(main_menu_text)) input_valid = False answer = '' while not input_valid: answer = input("\nCommand: ") if len(answer) > 1: print ("Please enter only 1 character.") continue if re.findall(r'[Qq1-4]', answer): input_valid = True answer = answer[0].lower() else: print ("Please enter a character between 1 and 4 or q.") return answer def autoconfig_main(): """ The auto configuration main entry point """ # Setup autoconfig_setup() answer = '' while answer != 'q': answer = autoconfig_main_menu() if answer == '1': autoconfig_show_system() elif answer == '2': autoconfig_dryrun() elif answer == '3': autoconfig_apply() elif answer == '4': autoconfig_install() elif answer == 'q': return else: autoconfig_not_implemented() def autoconfig_setup(ask_questions=True): """ The auto configuration setup function. We will copy the configuration files to the dryrun directory. """ global rootdir distro = VPPUtil.get_linux_distro() if distro[0] == 'Ubuntu': rootdir = '/usr/local' else: rootdir = '/usr' # If there is a system configuration file use that, if not use the initial auto-config file filename = rootdir + VPP_AUTO_CONFIGURATION_FILE if os.path.isfile(filename) is True: acfg = AutoConfig(rootdir, VPP_AUTO_CONFIGURATION_FILE) else: raise RuntimeError('The Auto configuration file does not exist {}'. format(filename)) if ask_questions: print ("\nWelcome to the VPP system configuration utility") print ("\nThese are the files we will modify:") print (" /etc/vpp/startup.conf") print (" /etc/sysctl.d/80-vpp.conf") print (" /etc/default/grub") print ( "\nBefore we change them, we'll create working copies in " "{}".format(rootdir + VPP_DRYRUNDIR)) print ( "Please inspect them carefully before applying the actual " "configuration (option 3)!") nodes = acfg.get_nodes() for i in nodes.items(): node = i[1] if (os.path.isfile(rootdir + VPP_STARTUP_FILE) is not True) and \ (os.path.isfile(VPP_REAL_STARTUP_FILE) is True): autoconfig_cp(node, VPP_REAL_STARTUP_FILE, '{}'.format(rootdir + VPP_STARTUP_FILE)) if (os.path.isfile(rootdir + VPP_HUGE_PAGE_FILE) is not True) and \ (os.path.isfile(VPP_REAL_HUGE_PAGE_FILE) is True): autoconfig_cp(node, VPP_REAL_HUGE_PAGE_FILE, '{}'.format(rootdir + VPP_HUGE_PAGE_FILE)) if (os.path.isfile(rootdir + VPP_GRUB_FILE) is not True) and \ (os.path.isfile(VPP_REAL_GRUB_FILE) is True): autoconfig_cp(node, VPP_REAL_GRUB_FILE, '{}'.format(rootdir + VPP_GRUB_FILE)) # Be sure the uio_pci_generic driver is installed cmd = 'modprobe uio_pci_generic' (ret, stdout, stderr) = VPPUtil.exec_command(cmd) if ret != 0: logging.warning('{} failed on node {} {}'. format(cmd, node['host'], stderr)) # noinspection PyUnresolvedReferences def execute_with_args(args): """ Execute the configuration utility with agruments. :param args: The Command line arguments :type args: tuple """ # Setup autoconfig_setup(ask_questions=False) # Execute the command if args.show: autoconfig_show_system() elif args.dry_run: autoconfig_dryrun(ask_questions=False) elif args.apply: autoconfig_apply(ask_questions=False) else: autoconfig_not_implemented() def config_main(): """ The vpp configuration utility main entry point. """ # Check for root if not os.geteuid() == 0: sys.exit('\nPlease run the VPP Configuration Utility as root.') if len(sys.argv) > 1 and ((sys.argv[1] == '-d') or ( sys.argv[1] == '--debug')): logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.ERROR) # If no arguments were entered, ask the user questions to # get the main parameters if len(sys.argv) == 1: autoconfig_main() return elif len(sys.argv) == 2 and ((sys.argv[1] == '-d') or ( sys.argv[1] == '--debug')): autoconfig_main() return # There were arguments specified, so execute the utility using # command line arguments description = 'The VPP configuration utility allows the user to ' 'configure VPP in a simple and safe manner. The utility takes input ' 'from the user or the specified .yaml file. The user should then ' 'examine these files to be sure they are correct and then actually ' 'apply the configuration. When run without arguments the utility run ' 'in an interactive mode' main_parser = argparse.ArgumentParser( prog='arg-test', description=description, epilog='See "%(prog)s help COMMAND" for help on a specific command.') main_parser.add_argument('--apply', '-a', action='store_true', help='Apply the cofiguration.') main_parser.add_argument('--dry-run', '-dr', action='store_true', help='Create the dryrun configuration files.') main_parser.add_argument('--show', '-s', action='store_true', help='Shows basic system information') main_parser.add_argument('--debug', '-d', action='count', help='Print debug output (multiple levels)') args = main_parser.parse_args() return execute_with_args(args) if __name__ == '__main__': config_main()