1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // source: /usr/share/vpp/api/core/ip_types.api.json
5 Package ip_types is a generated VPP binary API for 'ip_types' module.
18 api "git.fd.io/govpp.git/api"
19 struc "github.com/lunixbochs/struc"
25 // ModuleName is the name of this module.
26 ModuleName = "ip_types"
27 // APIVersion is the API version of this module.
29 // VersionCrc is the CRC of this module.
30 VersionCrc = 0x80424562
33 // AddressFamily represents VPP binary API enum 'address_family'.
34 type AddressFamily uint32
37 ADDRESS_IP4 AddressFamily = 0
38 ADDRESS_IP6 AddressFamily = 1
41 var AddressFamily_name = map[uint32]string{
46 var AddressFamily_value = map[string]uint32{
51 func (x AddressFamily) String() string {
52 s, ok := AddressFamily_name[uint32(x)]
56 return strconv.Itoa(int(x))
59 // IPDscp represents VPP binary API enum 'ip_dscp'.
63 IP_API_DSCP_CS0 IPDscp = 0
64 IP_API_DSCP_CS1 IPDscp = 8
65 IP_API_DSCP_AF11 IPDscp = 10
66 IP_API_DSCP_AF12 IPDscp = 12
67 IP_API_DSCP_AF13 IPDscp = 14
68 IP_API_DSCP_CS2 IPDscp = 16
69 IP_API_DSCP_AF21 IPDscp = 18
70 IP_API_DSCP_AF22 IPDscp = 20
71 IP_API_DSCP_AF23 IPDscp = 22
72 IP_API_DSCP_CS3 IPDscp = 24
73 IP_API_DSCP_AF31 IPDscp = 26
74 IP_API_DSCP_AF32 IPDscp = 28
75 IP_API_DSCP_AF33 IPDscp = 30
76 IP_API_DSCP_CS4 IPDscp = 32
77 IP_API_DSCP_AF41 IPDscp = 34
78 IP_API_DSCP_AF42 IPDscp = 36
79 IP_API_DSCP_AF43 IPDscp = 38
80 IP_API_DSCP_CS5 IPDscp = 40
81 IP_API_DSCP_EF IPDscp = 46
82 IP_API_DSCP_CS6 IPDscp = 48
83 IP_API_DSCP_CS7 IPDscp = 50
86 var IPDscp_name = map[uint8]string{
89 10: "IP_API_DSCP_AF11",
90 12: "IP_API_DSCP_AF12",
91 14: "IP_API_DSCP_AF13",
92 16: "IP_API_DSCP_CS2",
93 18: "IP_API_DSCP_AF21",
94 20: "IP_API_DSCP_AF22",
95 22: "IP_API_DSCP_AF23",
96 24: "IP_API_DSCP_CS3",
97 26: "IP_API_DSCP_AF31",
98 28: "IP_API_DSCP_AF32",
99 30: "IP_API_DSCP_AF33",
100 32: "IP_API_DSCP_CS4",
101 34: "IP_API_DSCP_AF41",
102 36: "IP_API_DSCP_AF42",
103 38: "IP_API_DSCP_AF43",
104 40: "IP_API_DSCP_CS5",
105 46: "IP_API_DSCP_EF",
106 48: "IP_API_DSCP_CS6",
107 50: "IP_API_DSCP_CS7",
110 var IPDscp_value = map[string]uint8{
111 "IP_API_DSCP_CS0": 0,
112 "IP_API_DSCP_CS1": 8,
113 "IP_API_DSCP_AF11": 10,
114 "IP_API_DSCP_AF12": 12,
115 "IP_API_DSCP_AF13": 14,
116 "IP_API_DSCP_CS2": 16,
117 "IP_API_DSCP_AF21": 18,
118 "IP_API_DSCP_AF22": 20,
119 "IP_API_DSCP_AF23": 22,
120 "IP_API_DSCP_CS3": 24,
121 "IP_API_DSCP_AF31": 26,
122 "IP_API_DSCP_AF32": 28,
123 "IP_API_DSCP_AF33": 30,
124 "IP_API_DSCP_CS4": 32,
125 "IP_API_DSCP_AF41": 34,
126 "IP_API_DSCP_AF42": 36,
127 "IP_API_DSCP_AF43": 38,
128 "IP_API_DSCP_CS5": 40,
129 "IP_API_DSCP_EF": 46,
130 "IP_API_DSCP_CS6": 48,
131 "IP_API_DSCP_CS7": 50,
134 func (x IPDscp) String() string {
135 s, ok := IPDscp_name[uint8(x)]
139 return strconv.Itoa(int(x))
142 // IPEcn represents VPP binary API enum 'ip_ecn'.
146 IP_API_ECN_NONE IPEcn = 0
147 IP_API_ECN_ECT0 IPEcn = 1
148 IP_API_ECN_ECT1 IPEcn = 2
149 IP_API_ECN_CE IPEcn = 3
152 var IPEcn_name = map[uint8]string{
153 0: "IP_API_ECN_NONE",
154 1: "IP_API_ECN_ECT0",
155 2: "IP_API_ECN_ECT1",
159 var IPEcn_value = map[string]uint8{
160 "IP_API_ECN_NONE": 0,
161 "IP_API_ECN_ECT0": 1,
162 "IP_API_ECN_ECT1": 2,
166 func (x IPEcn) String() string {
167 s, ok := IPEcn_name[uint8(x)]
171 return strconv.Itoa(int(x))
174 // IPProto represents VPP binary API enum 'ip_proto'.
178 IP_API_PROTO_HOPOPT IPProto = 0
179 IP_API_PROTO_ICMP IPProto = 1
180 IP_API_PROTO_IGMP IPProto = 2
181 IP_API_PROTO_TCP IPProto = 6
182 IP_API_PROTO_UDP IPProto = 17
183 IP_API_PROTO_GRE IPProto = 47
184 IP_API_PROTO_AH IPProto = 50
185 IP_API_PROTO_ESP IPProto = 51
186 IP_API_PROTO_EIGRP IPProto = 88
187 IP_API_PROTO_OSPF IPProto = 89
188 IP_API_PROTO_SCTP IPProto = 132
189 IP_API_PROTO_RESERVED IPProto = 255
192 var IPProto_name = map[uint32]string{
193 0: "IP_API_PROTO_HOPOPT",
194 1: "IP_API_PROTO_ICMP",
195 2: "IP_API_PROTO_IGMP",
196 6: "IP_API_PROTO_TCP",
197 17: "IP_API_PROTO_UDP",
198 47: "IP_API_PROTO_GRE",
199 50: "IP_API_PROTO_AH",
200 51: "IP_API_PROTO_ESP",
201 88: "IP_API_PROTO_EIGRP",
202 89: "IP_API_PROTO_OSPF",
203 132: "IP_API_PROTO_SCTP",
204 255: "IP_API_PROTO_RESERVED",
207 var IPProto_value = map[string]uint32{
208 "IP_API_PROTO_HOPOPT": 0,
209 "IP_API_PROTO_ICMP": 1,
210 "IP_API_PROTO_IGMP": 2,
211 "IP_API_PROTO_TCP": 6,
212 "IP_API_PROTO_UDP": 17,
213 "IP_API_PROTO_GRE": 47,
214 "IP_API_PROTO_AH": 50,
215 "IP_API_PROTO_ESP": 51,
216 "IP_API_PROTO_EIGRP": 88,
217 "IP_API_PROTO_OSPF": 89,
218 "IP_API_PROTO_SCTP": 132,
219 "IP_API_PROTO_RESERVED": 255,
222 func (x IPProto) String() string {
223 s, ok := IPProto_name[uint32(x)]
227 return strconv.Itoa(int(x))
230 // AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
231 type AddressWithPrefix Prefix
233 // IP4Address represents VPP binary API alias 'ip4_address'.
234 type IP4Address [4]uint8
236 // IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
237 type IP4AddressWithPrefix IP4Prefix
239 // IP6Address represents VPP binary API alias 'ip6_address'.
240 type IP6Address [16]uint8
242 // IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
243 type IP6AddressWithPrefix IP6Prefix
245 // Address represents VPP binary API type 'address'.
246 type Address struct {
251 func (*Address) GetTypeName() string { return "address" }
253 // IP4Prefix represents VPP binary API type 'ip4_prefix'.
254 type IP4Prefix struct {
259 func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
261 // IP6Prefix represents VPP binary API type 'ip6_prefix'.
262 type IP6Prefix struct {
267 func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
269 // Mprefix represents VPP binary API type 'mprefix'.
270 type Mprefix struct {
272 GrpAddressLength uint16
273 GrpAddress AddressUnion
274 SrcAddress AddressUnion
277 func (*Mprefix) GetTypeName() string { return "mprefix" }
279 // Prefix represents VPP binary API type 'prefix'.
285 func (*Prefix) GetTypeName() string { return "prefix" }
287 // PrefixMatcher represents VPP binary API type 'prefix_matcher'.
288 type PrefixMatcher struct {
293 func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
295 // AddressUnion represents VPP binary API union 'address_union'.
296 type AddressUnion struct {
297 XXX_UnionData [16]byte
300 func (*AddressUnion) GetTypeName() string { return "address_union" }
302 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
306 func (u *AddressUnion) SetIP4(a IP4Address) {
307 var b = new(bytes.Buffer)
308 if err := struc.Pack(b, &a); err != nil {
311 copy(u.XXX_UnionData[:], b.Bytes())
313 func (u *AddressUnion) GetIP4() (a IP4Address) {
314 var b = bytes.NewReader(u.XXX_UnionData[:])
319 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
323 func (u *AddressUnion) SetIP6(a IP6Address) {
324 var b = new(bytes.Buffer)
325 if err := struc.Pack(b, &a); err != nil {
328 copy(u.XXX_UnionData[:], b.Bytes())
330 func (u *AddressUnion) GetIP6() (a IP6Address) {
331 var b = bytes.NewReader(u.XXX_UnionData[:])
336 // This is a compile-time assertion to ensure that this generated file
337 // is compatible with the GoVPP api package it is being compiled against.
338 // A compilation error at this line likely means your copy of the
339 // GoVPP api package needs to be updated.
340 const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
342 // Reference imports to suppress errors if they are not otherwise used.
343 var _ = api.RegisterMessage
344 var _ = bytes.NewBuffer
345 var _ = context.Background