forked from gravwell/ipfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrfc5103.go
41 lines (32 loc) · 996 Bytes
/
rfc5103.go
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
package ipfix
import "strings"
// This implements RFC 5103, Bidirectional Flow Export Using IP Flow
// Information Export (IPFIX)
// IPFIX Reverse Information Element ("reverse PEN")
const reversePEN = 29305
func init() {
for k, v := range builtinIpfixDictionary {
if k.EnterpriseID != 0 {
continue
}
switch k.FieldID {
case 148, 145, 149, 137:
// Not reversible: flowId, templateId, observationDomainId, and
// commonPropertiesId
case 130, 131, 217, 211, 212, 213, 214, 215, 216, 173:
// Not reversible: process configuration elements defined in
// Section 5.2 of RFC5102.
case 41, 40, 42, 163, 164, 165, 166, 167, 168:
// Not reversible: process statistics elements defined in Section
// 5.3 of RFC5102.
case 210:
// Not reversible: paddingOctets
default:
// Reversible!
v.Name = "reverse" + strings.ToUpper(v.Name[0:1]) + v.Name[1:]
v.EnterpriseID = reversePEN
k.EnterpriseID = reversePEN
builtinIpfixDictionary[k] = v
}
}
}