1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-alpha-1-g435c3f4-dirty
4 // VPP: 20.01-45~g7a071e370~b63
5 // source: /usr/share/vpp/api/core/ip_types.api.json
8 Package ip_types contains generated code for VPP binary API defined by ip_types.api (version 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 = 0x80424562
46 // AddressFamily represents VPP binary API enum 'address_family'.
47 type AddressFamily uint32
50 ADDRESS_IP4 AddressFamily = 0
51 ADDRESS_IP6 AddressFamily = 1
55 AddressFamily_name = map[uint32]string{
59 AddressFamily_value = map[string]uint32{
65 func (x AddressFamily) String() string {
66 s, ok := AddressFamily_name[uint32(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_AH IPProto = 50
201 IP_API_PROTO_ESP IPProto = 51
202 IP_API_PROTO_EIGRP IPProto = 88
203 IP_API_PROTO_OSPF IPProto = 89
204 IP_API_PROTO_SCTP IPProto = 132
205 IP_API_PROTO_RESERVED IPProto = 255
209 IPProto_name = map[uint32]string{
210 0: "IP_API_PROTO_HOPOPT",
211 1: "IP_API_PROTO_ICMP",
212 2: "IP_API_PROTO_IGMP",
213 6: "IP_API_PROTO_TCP",
214 17: "IP_API_PROTO_UDP",
215 47: "IP_API_PROTO_GRE",
216 50: "IP_API_PROTO_AH",
217 51: "IP_API_PROTO_ESP",
218 88: "IP_API_PROTO_EIGRP",
219 89: "IP_API_PROTO_OSPF",
220 132: "IP_API_PROTO_SCTP",
221 255: "IP_API_PROTO_RESERVED",
223 IPProto_value = map[string]uint32{
224 "IP_API_PROTO_HOPOPT": 0,
225 "IP_API_PROTO_ICMP": 1,
226 "IP_API_PROTO_IGMP": 2,
227 "IP_API_PROTO_TCP": 6,
228 "IP_API_PROTO_UDP": 17,
229 "IP_API_PROTO_GRE": 47,
230 "IP_API_PROTO_AH": 50,
231 "IP_API_PROTO_ESP": 51,
232 "IP_API_PROTO_EIGRP": 88,
233 "IP_API_PROTO_OSPF": 89,
234 "IP_API_PROTO_SCTP": 132,
235 "IP_API_PROTO_RESERVED": 255,
239 func (x IPProto) String() string {
240 s, ok := IPProto_name[uint32(x)]
244 return "IPProto(" + strconv.Itoa(int(x)) + ")"
247 // AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
248 type AddressWithPrefix Prefix
250 // IP4Address represents VPP binary API alias 'ip4_address'.
251 type IP4Address [4]uint8
253 // IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
254 type IP4AddressWithPrefix IP4Prefix
256 // IP6Address represents VPP binary API alias 'ip6_address'.
257 type IP6Address [16]uint8
259 // IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
260 type IP6AddressWithPrefix IP6Prefix
262 // Address represents VPP binary API type 'address'.
263 type Address struct {
264 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
265 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
268 func (*Address) GetTypeName() string { return "address" }
270 // IP4Prefix represents VPP binary API type 'ip4_prefix'.
271 type IP4Prefix struct {
272 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
273 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
276 func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
278 // IP6Prefix represents VPP binary API type 'ip6_prefix'.
279 type IP6Prefix struct {
280 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
281 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
284 func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
286 // Mprefix represents VPP binary API type 'mprefix'.
287 type Mprefix struct {
288 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
289 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
290 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
291 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
294 func (*Mprefix) GetTypeName() string { return "mprefix" }
296 // Prefix represents VPP binary API type 'prefix'.
298 Address Address `binapi:"address,name=address" json:"address,omitempty"`
299 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
302 func (*Prefix) GetTypeName() string { return "prefix" }
304 // PrefixMatcher represents VPP binary API type 'prefix_matcher'.
305 type PrefixMatcher struct {
306 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
307 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
310 func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
312 // AddressUnion represents VPP binary API union 'address_union'.
313 type AddressUnion struct {
314 XXX_UnionData [16]byte
317 func (*AddressUnion) GetTypeName() string { return "address_union" }
319 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
323 func (u *AddressUnion) SetIP4(a IP4Address) {
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) GetIP4() (a IP4Address) {
331 var b = bytes.NewReader(u.XXX_UnionData[:])
336 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
340 func (u *AddressUnion) SetIP6(a IP6Address) {
341 var b = new(bytes.Buffer)
342 if err := struc.Pack(b, &a); err != nil {
345 copy(u.XXX_UnionData[:], b.Bytes())
347 func (u *AddressUnion) GetIP6() (a IP6Address) {
348 var b = bytes.NewReader(u.XXX_UnionData[:])
353 // Reference imports to suppress errors if they are not otherwise used.
354 var _ = api.RegisterMessage
355 var _ = codec.DecodeString
356 var _ = bytes.NewBuffer
357 var _ = context.Background
361 var _ = binary.BigEndian
362 var _ = math.Float32bits