1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/ip_types.api.json
8 Package ip_types contains generated code for VPP API file ip_types.api (3.0.0).
26 api "git.fd.io/govpp.git/api"
27 codec "git.fd.io/govpp.git/codec"
28 struc "github.com/lunixbochs/struc"
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the GoVPP api package it is being compiled against.
33 // A compilation error at this line likely means your copy of the
34 // GoVPP api package needs to be updated.
35 const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
38 // ModuleName is the name of this module.
39 ModuleName = "ip_types"
40 // APIVersion is the API version of this module.
42 // VersionCrc is the CRC of this module.
43 VersionCrc = 0x9cb1c2e2
46 // AddressFamily represents VPP binary API enum 'address_family'.
47 type AddressFamily uint8
50 ADDRESS_IP4 AddressFamily = 0
51 ADDRESS_IP6 AddressFamily = 1
55 AddressFamily_name = map[uint8]string{
59 AddressFamily_value = map[string]uint8{
65 func (x AddressFamily) String() string {
66 s, ok := AddressFamily_name[uint8(x)]
70 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
73 // IPDscp represents VPP binary API enum 'ip_dscp'.
77 IP_API_DSCP_CS0 IPDscp = 0
78 IP_API_DSCP_CS1 IPDscp = 8
79 IP_API_DSCP_AF11 IPDscp = 10
80 IP_API_DSCP_AF12 IPDscp = 12
81 IP_API_DSCP_AF13 IPDscp = 14
82 IP_API_DSCP_CS2 IPDscp = 16
83 IP_API_DSCP_AF21 IPDscp = 18
84 IP_API_DSCP_AF22 IPDscp = 20
85 IP_API_DSCP_AF23 IPDscp = 22
86 IP_API_DSCP_CS3 IPDscp = 24
87 IP_API_DSCP_AF31 IPDscp = 26
88 IP_API_DSCP_AF32 IPDscp = 28
89 IP_API_DSCP_AF33 IPDscp = 30
90 IP_API_DSCP_CS4 IPDscp = 32
91 IP_API_DSCP_AF41 IPDscp = 34
92 IP_API_DSCP_AF42 IPDscp = 36
93 IP_API_DSCP_AF43 IPDscp = 38
94 IP_API_DSCP_CS5 IPDscp = 40
95 IP_API_DSCP_EF IPDscp = 46
96 IP_API_DSCP_CS6 IPDscp = 48
97 IP_API_DSCP_CS7 IPDscp = 50
101 IPDscp_name = map[uint8]string{
102 0: "IP_API_DSCP_CS0",
103 8: "IP_API_DSCP_CS1",
104 10: "IP_API_DSCP_AF11",
105 12: "IP_API_DSCP_AF12",
106 14: "IP_API_DSCP_AF13",
107 16: "IP_API_DSCP_CS2",
108 18: "IP_API_DSCP_AF21",
109 20: "IP_API_DSCP_AF22",
110 22: "IP_API_DSCP_AF23",
111 24: "IP_API_DSCP_CS3",
112 26: "IP_API_DSCP_AF31",
113 28: "IP_API_DSCP_AF32",
114 30: "IP_API_DSCP_AF33",
115 32: "IP_API_DSCP_CS4",
116 34: "IP_API_DSCP_AF41",
117 36: "IP_API_DSCP_AF42",
118 38: "IP_API_DSCP_AF43",
119 40: "IP_API_DSCP_CS5",
120 46: "IP_API_DSCP_EF",
121 48: "IP_API_DSCP_CS6",
122 50: "IP_API_DSCP_CS7",
124 IPDscp_value = map[string]uint8{
125 "IP_API_DSCP_CS0": 0,
126 "IP_API_DSCP_CS1": 8,
127 "IP_API_DSCP_AF11": 10,
128 "IP_API_DSCP_AF12": 12,
129 "IP_API_DSCP_AF13": 14,
130 "IP_API_DSCP_CS2": 16,
131 "IP_API_DSCP_AF21": 18,
132 "IP_API_DSCP_AF22": 20,
133 "IP_API_DSCP_AF23": 22,
134 "IP_API_DSCP_CS3": 24,
135 "IP_API_DSCP_AF31": 26,
136 "IP_API_DSCP_AF32": 28,
137 "IP_API_DSCP_AF33": 30,
138 "IP_API_DSCP_CS4": 32,
139 "IP_API_DSCP_AF41": 34,
140 "IP_API_DSCP_AF42": 36,
141 "IP_API_DSCP_AF43": 38,
142 "IP_API_DSCP_CS5": 40,
143 "IP_API_DSCP_EF": 46,
144 "IP_API_DSCP_CS6": 48,
145 "IP_API_DSCP_CS7": 50,
149 func (x IPDscp) String() string {
150 s, ok := IPDscp_name[uint8(x)]
154 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
157 // IPEcn represents VPP binary API enum 'ip_ecn'.
161 IP_API_ECN_NONE IPEcn = 0
162 IP_API_ECN_ECT0 IPEcn = 1
163 IP_API_ECN_ECT1 IPEcn = 2
164 IP_API_ECN_CE IPEcn = 3
168 IPEcn_name = map[uint8]string{
169 0: "IP_API_ECN_NONE",
170 1: "IP_API_ECN_ECT0",
171 2: "IP_API_ECN_ECT1",
174 IPEcn_value = map[string]uint8{
175 "IP_API_ECN_NONE": 0,
176 "IP_API_ECN_ECT0": 1,
177 "IP_API_ECN_ECT1": 2,
182 func (x IPEcn) String() string {
183 s, ok := IPEcn_name[uint8(x)]
187 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
190 // IPProto represents VPP binary API enum 'ip_proto'.
194 IP_API_PROTO_HOPOPT IPProto = 0
195 IP_API_PROTO_ICMP IPProto = 1
196 IP_API_PROTO_IGMP IPProto = 2
197 IP_API_PROTO_TCP IPProto = 6
198 IP_API_PROTO_UDP IPProto = 17
199 IP_API_PROTO_GRE IPProto = 47
200 IP_API_PROTO_ESP IPProto = 50
201 IP_API_PROTO_AH IPProto = 51
202 IP_API_PROTO_ICMP6 IPProto = 58
203 IP_API_PROTO_EIGRP IPProto = 88
204 IP_API_PROTO_OSPF IPProto = 89
205 IP_API_PROTO_SCTP IPProto = 132
206 IP_API_PROTO_RESERVED IPProto = 255
210 IPProto_name = map[uint8]string{
211 0: "IP_API_PROTO_HOPOPT",
212 1: "IP_API_PROTO_ICMP",
213 2: "IP_API_PROTO_IGMP",
214 6: "IP_API_PROTO_TCP",
215 17: "IP_API_PROTO_UDP",
216 47: "IP_API_PROTO_GRE",
217 50: "IP_API_PROTO_ESP",
218 51: "IP_API_PROTO_AH",
219 58: "IP_API_PROTO_ICMP6",
220 88: "IP_API_PROTO_EIGRP",
221 89: "IP_API_PROTO_OSPF",
222 132: "IP_API_PROTO_SCTP",
223 255: "IP_API_PROTO_RESERVED",
225 IPProto_value = map[string]uint8{
226 "IP_API_PROTO_HOPOPT": 0,
227 "IP_API_PROTO_ICMP": 1,
228 "IP_API_PROTO_IGMP": 2,
229 "IP_API_PROTO_TCP": 6,
230 "IP_API_PROTO_UDP": 17,
231 "IP_API_PROTO_GRE": 47,
232 "IP_API_PROTO_ESP": 50,
233 "IP_API_PROTO_AH": 51,
234 "IP_API_PROTO_ICMP6": 58,
235 "IP_API_PROTO_EIGRP": 88,
236 "IP_API_PROTO_OSPF": 89,
237 "IP_API_PROTO_SCTP": 132,
238 "IP_API_PROTO_RESERVED": 255,
242 func (x IPProto) String() string {
243 s, ok := IPProto_name[uint8(x)]
247 return "IPProto(" + strconv.Itoa(int(x)) + ")"
250 // AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
251 type AddressWithPrefix Prefix
253 // IP4Address represents VPP binary API alias 'ip4_address'.
254 type IP4Address [4]uint8
256 // IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
257 type IP4AddressWithPrefix IP4Prefix
259 // IP6Address represents VPP binary API alias 'ip6_address'.
260 type IP6Address [16]uint8
262 // IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
263 type IP6AddressWithPrefix IP6Prefix
265 // Address represents VPP binary API type 'address'.
266 type Address struct {
267 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
268 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
271 func (*Address) GetTypeName() string { return "address" }
273 // IP4Prefix represents VPP binary API type 'ip4_prefix'.
274 type IP4Prefix struct {
275 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
276 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
279 func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
281 // IP6Prefix represents VPP binary API type 'ip6_prefix'.
282 type IP6Prefix struct {
283 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
284 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
287 func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
289 // Mprefix represents VPP binary API type 'mprefix'.
290 type Mprefix struct {
291 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
292 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
293 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
294 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
297 func (*Mprefix) GetTypeName() string { return "mprefix" }
299 // Prefix represents VPP binary API type 'prefix'.
301 Address Address `binapi:"address,name=address" json:"address,omitempty"`
302 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
305 func (*Prefix) GetTypeName() string { return "prefix" }
307 // PrefixMatcher represents VPP binary API type 'prefix_matcher'.
308 type PrefixMatcher struct {
309 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
310 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
313 func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
315 // AddressUnion represents VPP binary API union 'address_union'.
316 type AddressUnion struct {
317 XXX_UnionData [16]byte
320 func (*AddressUnion) GetTypeName() string { return "address_union" }
322 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
326 func (u *AddressUnion) SetIP4(a IP4Address) {
327 var b = new(bytes.Buffer)
328 if err := struc.Pack(b, &a); err != nil {
331 copy(u.XXX_UnionData[:], b.Bytes())
333 func (u *AddressUnion) GetIP4() (a IP4Address) {
334 var b = bytes.NewReader(u.XXX_UnionData[:])
339 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
343 func (u *AddressUnion) SetIP6(a IP6Address) {
344 var b = new(bytes.Buffer)
345 if err := struc.Pack(b, &a); err != nil {
348 copy(u.XXX_UnionData[:], b.Bytes())
350 func (u *AddressUnion) GetIP6() (a IP6Address) {
351 var b = bytes.NewReader(u.XXX_UnionData[:])
356 // Reference imports to suppress errors if they are not otherwise used.
357 var _ = api.RegisterMessage
358 var _ = codec.DecodeString
359 var _ = bytes.NewBuffer
360 var _ = context.Background
364 var _ = binary.BigEndian
365 var _ = math.Float32bits