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.
21 api "git.fd.io/govpp.git/api"
22 struc "github.com/lunixbochs/struc"
26 // ModuleName is the name of this module.
27 ModuleName = "ip_types"
28 // APIVersion is the API version of this module.
30 // VersionCrc is the CRC of this module.
31 VersionCrc = 0x80424562
34 // AddressFamily represents VPP binary API enum 'address_family'.
35 type AddressFamily uint32
38 ADDRESS_IP4 AddressFamily = 0
39 ADDRESS_IP6 AddressFamily = 1
42 var AddressFamily_name = map[uint32]string{
47 var AddressFamily_value = map[string]uint32{
52 func (x AddressFamily) String() string {
53 s, ok := AddressFamily_name[uint32(x)]
57 return strconv.Itoa(int(x))
60 // IPDscp represents VPP binary API enum 'ip_dscp'.
64 IP_API_DSCP_CS0 IPDscp = 0
65 IP_API_DSCP_CS1 IPDscp = 8
66 IP_API_DSCP_AF11 IPDscp = 10
67 IP_API_DSCP_AF12 IPDscp = 12
68 IP_API_DSCP_AF13 IPDscp = 14
69 IP_API_DSCP_CS2 IPDscp = 16
70 IP_API_DSCP_AF21 IPDscp = 18
71 IP_API_DSCP_AF22 IPDscp = 20
72 IP_API_DSCP_AF23 IPDscp = 22
73 IP_API_DSCP_CS3 IPDscp = 24
74 IP_API_DSCP_AF31 IPDscp = 26
75 IP_API_DSCP_AF32 IPDscp = 28
76 IP_API_DSCP_AF33 IPDscp = 30
77 IP_API_DSCP_CS4 IPDscp = 32
78 IP_API_DSCP_AF41 IPDscp = 34
79 IP_API_DSCP_AF42 IPDscp = 36
80 IP_API_DSCP_AF43 IPDscp = 38
81 IP_API_DSCP_CS5 IPDscp = 40
82 IP_API_DSCP_EF IPDscp = 46
83 IP_API_DSCP_CS6 IPDscp = 48
84 IP_API_DSCP_CS7 IPDscp = 50
87 var IPDscp_name = map[uint8]string{
90 10: "IP_API_DSCP_AF11",
91 12: "IP_API_DSCP_AF12",
92 14: "IP_API_DSCP_AF13",
93 16: "IP_API_DSCP_CS2",
94 18: "IP_API_DSCP_AF21",
95 20: "IP_API_DSCP_AF22",
96 22: "IP_API_DSCP_AF23",
97 24: "IP_API_DSCP_CS3",
98 26: "IP_API_DSCP_AF31",
99 28: "IP_API_DSCP_AF32",
100 30: "IP_API_DSCP_AF33",
101 32: "IP_API_DSCP_CS4",
102 34: "IP_API_DSCP_AF41",
103 36: "IP_API_DSCP_AF42",
104 38: "IP_API_DSCP_AF43",
105 40: "IP_API_DSCP_CS5",
106 46: "IP_API_DSCP_EF",
107 48: "IP_API_DSCP_CS6",
108 50: "IP_API_DSCP_CS7",
111 var IPDscp_value = map[string]uint8{
112 "IP_API_DSCP_CS0": 0,
113 "IP_API_DSCP_CS1": 8,
114 "IP_API_DSCP_AF11": 10,
115 "IP_API_DSCP_AF12": 12,
116 "IP_API_DSCP_AF13": 14,
117 "IP_API_DSCP_CS2": 16,
118 "IP_API_DSCP_AF21": 18,
119 "IP_API_DSCP_AF22": 20,
120 "IP_API_DSCP_AF23": 22,
121 "IP_API_DSCP_CS3": 24,
122 "IP_API_DSCP_AF31": 26,
123 "IP_API_DSCP_AF32": 28,
124 "IP_API_DSCP_AF33": 30,
125 "IP_API_DSCP_CS4": 32,
126 "IP_API_DSCP_AF41": 34,
127 "IP_API_DSCP_AF42": 36,
128 "IP_API_DSCP_AF43": 38,
129 "IP_API_DSCP_CS5": 40,
130 "IP_API_DSCP_EF": 46,
131 "IP_API_DSCP_CS6": 48,
132 "IP_API_DSCP_CS7": 50,
135 func (x IPDscp) String() string {
136 s, ok := IPDscp_name[uint8(x)]
140 return strconv.Itoa(int(x))
143 // IPEcn represents VPP binary API enum 'ip_ecn'.
147 IP_API_ECN_NONE IPEcn = 0
148 IP_API_ECN_ECT0 IPEcn = 1
149 IP_API_ECN_ECT1 IPEcn = 2
150 IP_API_ECN_CE IPEcn = 3
153 var IPEcn_name = map[uint8]string{
154 0: "IP_API_ECN_NONE",
155 1: "IP_API_ECN_ECT0",
156 2: "IP_API_ECN_ECT1",
160 var IPEcn_value = map[string]uint8{
161 "IP_API_ECN_NONE": 0,
162 "IP_API_ECN_ECT0": 1,
163 "IP_API_ECN_ECT1": 2,
167 func (x IPEcn) String() string {
168 s, ok := IPEcn_name[uint8(x)]
172 return strconv.Itoa(int(x))
175 // IPProto represents VPP binary API enum 'ip_proto'.
179 IP_API_PROTO_HOPOPT IPProto = 0
180 IP_API_PROTO_ICMP IPProto = 1
181 IP_API_PROTO_IGMP IPProto = 2
182 IP_API_PROTO_TCP IPProto = 6
183 IP_API_PROTO_UDP IPProto = 17
184 IP_API_PROTO_GRE IPProto = 47
185 IP_API_PROTO_AH IPProto = 50
186 IP_API_PROTO_ESP IPProto = 51
187 IP_API_PROTO_EIGRP IPProto = 88
188 IP_API_PROTO_OSPF IPProto = 89
189 IP_API_PROTO_SCTP IPProto = 132
190 IP_API_PROTO_RESERVED IPProto = 255
193 var IPProto_name = map[uint32]string{
194 0: "IP_API_PROTO_HOPOPT",
195 1: "IP_API_PROTO_ICMP",
196 2: "IP_API_PROTO_IGMP",
197 6: "IP_API_PROTO_TCP",
198 17: "IP_API_PROTO_UDP",
199 47: "IP_API_PROTO_GRE",
200 50: "IP_API_PROTO_AH",
201 51: "IP_API_PROTO_ESP",
202 88: "IP_API_PROTO_EIGRP",
203 89: "IP_API_PROTO_OSPF",
204 132: "IP_API_PROTO_SCTP",
205 255: "IP_API_PROTO_RESERVED",
208 var IPProto_value = map[string]uint32{
209 "IP_API_PROTO_HOPOPT": 0,
210 "IP_API_PROTO_ICMP": 1,
211 "IP_API_PROTO_IGMP": 2,
212 "IP_API_PROTO_TCP": 6,
213 "IP_API_PROTO_UDP": 17,
214 "IP_API_PROTO_GRE": 47,
215 "IP_API_PROTO_AH": 50,
216 "IP_API_PROTO_ESP": 51,
217 "IP_API_PROTO_EIGRP": 88,
218 "IP_API_PROTO_OSPF": 89,
219 "IP_API_PROTO_SCTP": 132,
220 "IP_API_PROTO_RESERVED": 255,
223 func (x IPProto) String() string {
224 s, ok := IPProto_name[uint32(x)]
228 return strconv.Itoa(int(x))
231 // AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
232 type AddressWithPrefix Prefix
234 // IP4Address represents VPP binary API alias 'ip4_address'.
235 type IP4Address [4]uint8
237 // IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
238 type IP4AddressWithPrefix IP4Prefix
240 // IP6Address represents VPP binary API alias 'ip6_address'.
241 type IP6Address [16]uint8
243 // IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
244 type IP6AddressWithPrefix IP6Prefix
246 // Address represents VPP binary API type 'address'.
247 type Address struct {
252 func (*Address) GetTypeName() string { return "address" }
254 // IP4Prefix represents VPP binary API type 'ip4_prefix'.
255 type IP4Prefix struct {
260 func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
262 // IP6Prefix represents VPP binary API type 'ip6_prefix'.
263 type IP6Prefix struct {
268 func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
270 // Mprefix represents VPP binary API type 'mprefix'.
271 type Mprefix struct {
273 GrpAddressLength uint16
274 GrpAddress AddressUnion
275 SrcAddress AddressUnion
278 func (*Mprefix) GetTypeName() string { return "mprefix" }
280 // Prefix represents VPP binary API type 'prefix'.
286 func (*Prefix) GetTypeName() string { return "prefix" }
288 // PrefixMatcher represents VPP binary API type 'prefix_matcher'.
289 type PrefixMatcher struct {
294 func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
296 // AddressUnion represents VPP binary API union 'address_union'.
297 type AddressUnion struct {
298 XXX_UnionData [16]byte
301 func (*AddressUnion) GetTypeName() string { return "address_union" }
303 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
307 func (u *AddressUnion) SetIP4(a IP4Address) {
308 var b = new(bytes.Buffer)
309 if err := struc.Pack(b, &a); err != nil {
312 copy(u.XXX_UnionData[:], b.Bytes())
314 func (u *AddressUnion) GetIP4() (a IP4Address) {
315 var b = bytes.NewReader(u.XXX_UnionData[:])
320 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
324 func (u *AddressUnion) SetIP6(a IP6Address) {
325 var b = new(bytes.Buffer)
326 if err := struc.Pack(b, &a); err != nil {
329 copy(u.XXX_UnionData[:], b.Bytes())
331 func (u *AddressUnion) GetIP6() (a IP6Address) {
332 var b = bytes.NewReader(u.XXX_UnionData[:])
337 // This is a compile-time assertion to ensure that this generated file
338 // is compatible with the GoVPP api package it is being compiled against.
339 // A compilation error at this line likely means your copy of the
340 // GoVPP api package needs to be updated.
341 const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
343 // Reference imports to suppress errors if they are not otherwise used.
344 var _ = api.RegisterMessage
345 var _ = bytes.NewBuffer
346 var _ = context.Background