// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
-// binapi-generator: v0.4.0-alpha-1-g435c3f4-dirty
-// VPP: 20.01-45~g7a071e370~b63
+// binapi-generator: v0.4.0-dev
+// VPP: 20.05-release
// source: /usr/share/vpp/api/plugins/acl.api.json
/*
-Package acl contains generated code for VPP binary API defined by acl.api (version 1.0.1).
+Package acl contains generated code for VPP API file acl.api (2.0.0).
It consists of:
+ 7 aliases
+ 11 enums
38 messages
- 2 types
+ 8 types
+ 1 union
*/
package acl
"bytes"
"context"
"encoding/binary"
+ "fmt"
"io"
"math"
+ "net"
"strconv"
+ "strings"
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
struc "github.com/lunixbochs/struc"
+
+ interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
+ ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
)
// This is a compile-time assertion to ensure that this generated file
// ModuleName is the name of this module.
ModuleName = "acl"
// APIVersion is the API version of this module.
- APIVersion = "1.0.1"
+ APIVersion = "2.0.0"
// VersionCrc is the CRC of this module.
- VersionCrc = 0x11c5c1e5
+ VersionCrc = 0x68c4cb37
+)
+
+// ACLAction represents VPP binary API enum 'acl_action'.
+type ACLAction uint8
+
+const (
+ ACL_ACTION_API_DENY ACLAction = 0
+ ACL_ACTION_API_PERMIT ACLAction = 1
+ ACL_ACTION_API_PERMIT_REFLECT ACLAction = 2
)
+var (
+ ACLAction_name = map[uint8]string{
+ 0: "ACL_ACTION_API_DENY",
+ 1: "ACL_ACTION_API_PERMIT",
+ 2: "ACL_ACTION_API_PERMIT_REFLECT",
+ }
+ ACLAction_value = map[string]uint8{
+ "ACL_ACTION_API_DENY": 0,
+ "ACL_ACTION_API_PERMIT": 1,
+ "ACL_ACTION_API_PERMIT_REFLECT": 2,
+ }
+)
+
+func (x ACLAction) String() string {
+ s, ok := ACLAction_name[uint8(x)]
+ if ok {
+ return s
+ }
+ return "ACLAction(" + strconv.Itoa(int(x)) + ")"
+}
+
+// MacAddress represents VPP binary API alias 'mac_address'.
+type MacAddress [6]uint8
+
+func ParseMAC(mac string) (parsed MacAddress, err error) {
+ var hw net.HardwareAddr
+ if hw, err = net.ParseMAC(mac); err != nil {
+ return
+ }
+ copy(parsed[:], hw[:])
+ return
+}
+
+func (m *MacAddress) ToString() string {
+ return net.HardwareAddr(m[:]).String()
+}
+
// ACLRule represents VPP binary API type 'acl_rule'.
type ACLRule struct {
- IsPermit uint8 `binapi:"u8,name=is_permit" json:"is_permit,omitempty"`
- IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
- SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty" struc:"[16]byte"`
- SrcIPPrefixLen uint8 `binapi:"u8,name=src_ip_prefix_len" json:"src_ip_prefix_len,omitempty"`
- DstIPAddr []byte `binapi:"u8[16],name=dst_ip_addr" json:"dst_ip_addr,omitempty" struc:"[16]byte"`
- DstIPPrefixLen uint8 `binapi:"u8,name=dst_ip_prefix_len" json:"dst_ip_prefix_len,omitempty"`
- Proto uint8 `binapi:"u8,name=proto" json:"proto,omitempty"`
- SrcportOrIcmptypeFirst uint16 `binapi:"u16,name=srcport_or_icmptype_first" json:"srcport_or_icmptype_first,omitempty"`
- SrcportOrIcmptypeLast uint16 `binapi:"u16,name=srcport_or_icmptype_last" json:"srcport_or_icmptype_last,omitempty"`
- DstportOrIcmpcodeFirst uint16 `binapi:"u16,name=dstport_or_icmpcode_first" json:"dstport_or_icmpcode_first,omitempty"`
- DstportOrIcmpcodeLast uint16 `binapi:"u16,name=dstport_or_icmpcode_last" json:"dstport_or_icmpcode_last,omitempty"`
- TCPFlagsMask uint8 `binapi:"u8,name=tcp_flags_mask" json:"tcp_flags_mask,omitempty"`
- TCPFlagsValue uint8 `binapi:"u8,name=tcp_flags_value" json:"tcp_flags_value,omitempty"`
+ IsPermit ACLAction `binapi:"acl_action,name=is_permit" json:"is_permit,omitempty"`
+ SrcPrefix ip_types.Prefix `binapi:"prefix,name=src_prefix" json:"src_prefix,omitempty"`
+ DstPrefix ip_types.Prefix `binapi:"prefix,name=dst_prefix" json:"dst_prefix,omitempty"`
+ Proto ip_types.IPProto `binapi:"ip_proto,name=proto" json:"proto,omitempty"`
+ SrcportOrIcmptypeFirst uint16 `binapi:"u16,name=srcport_or_icmptype_first" json:"srcport_or_icmptype_first,omitempty"`
+ SrcportOrIcmptypeLast uint16 `binapi:"u16,name=srcport_or_icmptype_last" json:"srcport_or_icmptype_last,omitempty"`
+ DstportOrIcmpcodeFirst uint16 `binapi:"u16,name=dstport_or_icmpcode_first" json:"dstport_or_icmpcode_first,omitempty"`
+ DstportOrIcmpcodeLast uint16 `binapi:"u16,name=dstport_or_icmpcode_last" json:"dstport_or_icmpcode_last,omitempty"`
+ TCPFlagsMask uint8 `binapi:"u8,name=tcp_flags_mask" json:"tcp_flags_mask,omitempty"`
+ TCPFlagsValue uint8 `binapi:"u8,name=tcp_flags_value" json:"tcp_flags_value,omitempty"`
}
func (*ACLRule) GetTypeName() string { return "acl_rule" }
// MacipACLRule represents VPP binary API type 'macip_acl_rule'.
type MacipACLRule struct {
- IsPermit uint8 `binapi:"u8,name=is_permit" json:"is_permit,omitempty"`
- IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
- SrcMac []byte `binapi:"u8[6],name=src_mac" json:"src_mac,omitempty" struc:"[6]byte"`
- SrcMacMask []byte `binapi:"u8[6],name=src_mac_mask" json:"src_mac_mask,omitempty" struc:"[6]byte"`
- SrcIPAddr []byte `binapi:"u8[16],name=src_ip_addr" json:"src_ip_addr,omitempty" struc:"[16]byte"`
- SrcIPPrefixLen uint8 `binapi:"u8,name=src_ip_prefix_len" json:"src_ip_prefix_len,omitempty"`
+ IsPermit ACLAction `binapi:"acl_action,name=is_permit" json:"is_permit,omitempty"`
+ SrcMac MacAddress `binapi:"mac_address,name=src_mac" json:"src_mac,omitempty"`
+ SrcMacMask MacAddress `binapi:"mac_address,name=src_mac_mask" json:"src_mac_mask,omitempty"`
+ SrcPrefix ip_types.Prefix `binapi:"prefix,name=src_prefix" json:"src_prefix,omitempty"`
}
func (*MacipACLRule) GetTypeName() string { return "macip_acl_rule" }
// ACLAddReplace represents VPP binary API message 'acl_add_replace'.
type ACLAddReplace struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
R []ACLRule `binapi:"acl_rule[count],name=r" json:"r,omitempty"`
}
func (m *ACLAddReplace) Reset() { *m = ACLAddReplace{} }
func (*ACLAddReplace) GetMessageName() string { return "acl_add_replace" }
-func (*ACLAddReplace) GetCrcString() string { return "13bc8539" }
+func (*ACLAddReplace) GetCrcString() string { return "1cabdeab" }
func (*ACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *ACLAddReplace) Size() int {
}
// field[2] s1.IsPermit
size += 1
- // field[2] s1.IsIPv6
+ // field[2] s1.SrcPrefix
+ // field[3] s1.SrcPrefix.Address
+ // field[4] s1.SrcPrefix.Address.Af
size += 1
- // field[2] s1.SrcIPAddr
+ // field[4] s1.SrcPrefix.Address.Un
size += 16
- // field[2] s1.SrcIPPrefixLen
+ // field[3] s1.SrcPrefix.Len
+ size += 1
+ // field[2] s1.DstPrefix
+ // field[3] s1.DstPrefix.Address
+ // field[4] s1.DstPrefix.Address.Af
size += 1
- // field[2] s1.DstIPAddr
+ // field[4] s1.DstPrefix.Address.Un
size += 16
- // field[2] s1.DstIPPrefixLen
+ // field[3] s1.DstPrefix.Len
size += 1
// field[2] s1.Proto
size += 1
o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
pos += 4
// field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
+ copy(buf[pos:pos+64], m.Tag)
+ pos += 64
// field[1] m.Count
o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
pos += 4
// field[2] v1.IsPermit
buf[pos] = uint8(v1.IsPermit)
pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
+ // field[2] v1.SrcPrefix
+ // field[3] v1.SrcPrefix.Address
+ // field[4] v1.SrcPrefix.Address.Af
+ buf[pos] = uint8(v1.SrcPrefix.Address.Af)
pos += 1
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
+ // field[4] v1.SrcPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.SrcPrefix.Len
+ buf[pos] = uint8(v1.SrcPrefix.Len)
pos += 1
- // field[2] v1.DstIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.DstIPAddr) {
- x = uint8(v1.DstIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.DstIPPrefixLen
- buf[pos] = uint8(v1.DstIPPrefixLen)
+ // field[2] v1.DstPrefix
+ // field[3] v1.DstPrefix.Address
+ // field[4] v1.DstPrefix.Address.Af
+ buf[pos] = uint8(v1.DstPrefix.Address.Af)
+ pos += 1
+ // field[4] v1.DstPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.DstPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.DstPrefix.Len
+ buf[pos] = uint8(v1.DstPrefix.Len)
pos += 1
// field[2] v1.Proto
buf[pos] = uint8(v1.Proto)
m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.Tag = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
}
// field[1] m.Count
m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
m.R = make([]ACLRule, int(m.Count))
for j1 := 0; j1 < int(m.Count); j1++ {
// field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
+ m.R[j1].IsPermit = ACLAction(tmp[pos])
pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
+ // field[2] m.R[j1].SrcPrefix
+ // field[3] m.R[j1].SrcPrefix.Address
+ // field[4] m.R[j1].SrcPrefix.Address.Af
+ m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
pos += 1
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
+ // field[4] m.R[j1].SrcPrefix.Address.Un
+ copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].SrcPrefix.Len
+ m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
pos += 1
- // field[2] m.R[j1].DstIPAddr
- m.R[j1].DstIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].DstIPAddr); i++ {
- m.R[j1].DstIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].DstIPPrefixLen
- m.R[j1].DstIPPrefixLen = uint8(tmp[pos])
+ // field[2] m.R[j1].DstPrefix
+ // field[3] m.R[j1].DstPrefix.Address
+ // field[4] m.R[j1].DstPrefix.Address.Af
+ m.R[j1].DstPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
+ pos += 1
+ // field[4] m.R[j1].DstPrefix.Address.Un
+ copy(m.R[j1].DstPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].DstPrefix.Len
+ m.R[j1].DstPrefix.Len = uint8(tmp[pos])
pos += 1
// field[2] m.R[j1].Proto
- m.R[j1].Proto = uint8(tmp[pos])
+ m.R[j1].Proto = ip_types.IPProto(tmp[pos])
pos += 1
// field[2] m.R[j1].SrcportOrIcmptypeFirst
m.R[j1].SrcportOrIcmptypeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
// ACLDetails represents VPP binary API message 'acl_details'.
type ACLDetails struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
R []ACLRule `binapi:"acl_rule[count],name=r" json:"r,omitempty"`
}
func (m *ACLDetails) Reset() { *m = ACLDetails{} }
func (*ACLDetails) GetMessageName() string { return "acl_details" }
-func (*ACLDetails) GetCrcString() string { return "f89d7a88" }
+func (*ACLDetails) GetCrcString() string { return "7a97f21c" }
func (*ACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
func (m *ACLDetails) Size() int {
}
// field[2] s1.IsPermit
size += 1
- // field[2] s1.IsIPv6
+ // field[2] s1.SrcPrefix
+ // field[3] s1.SrcPrefix.Address
+ // field[4] s1.SrcPrefix.Address.Af
size += 1
- // field[2] s1.SrcIPAddr
+ // field[4] s1.SrcPrefix.Address.Un
size += 16
- // field[2] s1.SrcIPPrefixLen
+ // field[3] s1.SrcPrefix.Len
+ size += 1
+ // field[2] s1.DstPrefix
+ // field[3] s1.DstPrefix.Address
+ // field[4] s1.DstPrefix.Address.Af
size += 1
- // field[2] s1.DstIPAddr
+ // field[4] s1.DstPrefix.Address.Un
size += 16
- // field[2] s1.DstIPPrefixLen
+ // field[3] s1.DstPrefix.Len
size += 1
// field[2] s1.Proto
size += 1
o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
pos += 4
// field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
+ copy(buf[pos:pos+64], m.Tag)
+ pos += 64
// field[1] m.Count
o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
pos += 4
// field[2] v1.IsPermit
buf[pos] = uint8(v1.IsPermit)
pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
+ // field[2] v1.SrcPrefix
+ // field[3] v1.SrcPrefix.Address
+ // field[4] v1.SrcPrefix.Address.Af
+ buf[pos] = uint8(v1.SrcPrefix.Address.Af)
pos += 1
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
+ // field[4] v1.SrcPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.SrcPrefix.Len
+ buf[pos] = uint8(v1.SrcPrefix.Len)
pos += 1
- // field[2] v1.DstIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.DstIPAddr) {
- x = uint8(v1.DstIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.DstIPPrefixLen
- buf[pos] = uint8(v1.DstIPPrefixLen)
+ // field[2] v1.DstPrefix
+ // field[3] v1.DstPrefix.Address
+ // field[4] v1.DstPrefix.Address.Af
+ buf[pos] = uint8(v1.DstPrefix.Address.Af)
+ pos += 1
+ // field[4] v1.DstPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.DstPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.DstPrefix.Len
+ buf[pos] = uint8(v1.DstPrefix.Len)
pos += 1
// field[2] v1.Proto
buf[pos] = uint8(v1.Proto)
m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.Tag = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
}
// field[1] m.Count
m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
m.R = make([]ACLRule, int(m.Count))
for j1 := 0; j1 < int(m.Count); j1++ {
// field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
+ m.R[j1].IsPermit = ACLAction(tmp[pos])
pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
+ // field[2] m.R[j1].SrcPrefix
+ // field[3] m.R[j1].SrcPrefix.Address
+ // field[4] m.R[j1].SrcPrefix.Address.Af
+ m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
pos += 1
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
+ // field[4] m.R[j1].SrcPrefix.Address.Un
+ copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].SrcPrefix.Len
+ m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
pos += 1
- // field[2] m.R[j1].DstIPAddr
- m.R[j1].DstIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].DstIPAddr); i++ {
- m.R[j1].DstIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].DstIPPrefixLen
- m.R[j1].DstIPPrefixLen = uint8(tmp[pos])
+ // field[2] m.R[j1].DstPrefix
+ // field[3] m.R[j1].DstPrefix.Address
+ // field[4] m.R[j1].DstPrefix.Address.Af
+ m.R[j1].DstPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
+ pos += 1
+ // field[4] m.R[j1].DstPrefix.Address.Un
+ copy(m.R[j1].DstPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].DstPrefix.Len
+ m.R[j1].DstPrefix.Len = uint8(tmp[pos])
pos += 1
// field[2] m.R[j1].Proto
- m.R[j1].Proto = uint8(tmp[pos])
+ m.R[j1].Proto = ip_types.IPProto(tmp[pos])
pos += 1
// field[2] m.R[j1].SrcportOrIcmptypeFirst
m.R[j1].SrcportOrIcmptypeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
// ACLInterfaceAddDel represents VPP binary API message 'acl_interface_add_del'.
type ACLInterfaceAddDel struct {
- IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
- IsInput uint8 `binapi:"u8,name=is_input" json:"is_input,omitempty"`
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
+ IsInput bool `binapi:"bool,name=is_input" json:"is_input,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
func (m *ACLInterfaceAddDel) Reset() { *m = ACLInterfaceAddDel{} }
func (*ACLInterfaceAddDel) GetMessageName() string { return "acl_interface_add_del" }
-func (*ACLInterfaceAddDel) GetCrcString() string { return "0b2aedd1" }
+func (*ACLInterfaceAddDel) GetCrcString() string { return "4b54bebd" }
func (*ACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *ACLInterfaceAddDel) Size() int {
buf = b
}
// field[1] m.IsAdd
- buf[pos] = uint8(m.IsAdd)
+ if m.IsAdd {
+ buf[pos] = 1
+ }
pos += 1
// field[1] m.IsInput
- buf[pos] = uint8(m.IsInput)
+ if m.IsInput {
+ buf[pos] = 1
+ }
pos += 1
// field[1] m.SwIfIndex
o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
pos := 0
_ = pos
// field[1] m.IsAdd
- m.IsAdd = uint8(tmp[pos])
+ m.IsAdd = tmp[pos] != 0
pos += 1
// field[1] m.IsInput
- m.IsInput = uint8(tmp[pos])
+ m.IsInput = tmp[pos] != 0
pos += 1
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.ACLIndex
m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
// ACLInterfaceEtypeWhitelistDetails represents VPP binary API message 'acl_interface_etype_whitelist_details'.
type ACLInterfaceEtypeWhitelistDetails struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
+ NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
+ Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
}
func (m *ACLInterfaceEtypeWhitelistDetails) Reset() { *m = ACLInterfaceEtypeWhitelistDetails{} }
func (*ACLInterfaceEtypeWhitelistDetails) GetMessageName() string {
return "acl_interface_etype_whitelist_details"
}
-func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { return "6a5d4e81" }
+func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { return "cc2bfded" }
func (*ACLInterfaceEtypeWhitelistDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
func (m *ACLInterfaceEtypeWhitelistDetails) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Count
m.Count = uint8(tmp[pos])
// ACLInterfaceEtypeWhitelistDump represents VPP binary API message 'acl_interface_etype_whitelist_dump'.
type ACLInterfaceEtypeWhitelistDump struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
func (m *ACLInterfaceEtypeWhitelistDump) Reset() { *m = ACLInterfaceEtypeWhitelistDump{} }
func (*ACLInterfaceEtypeWhitelistDump) GetMessageName() string {
return "acl_interface_etype_whitelist_dump"
}
-func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { return "529cb13f" }
+func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { return "f9e6675e" }
func (*ACLInterfaceEtypeWhitelistDump) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *ACLInterfaceEtypeWhitelistDump) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
return nil
}
// ACLInterfaceListDetails represents VPP binary API message 'acl_interface_list_details'.
type ACLInterfaceListDetails struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
+ Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
func (m *ACLInterfaceListDetails) Reset() { *m = ACLInterfaceListDetails{} }
func (*ACLInterfaceListDetails) GetMessageName() string { return "acl_interface_list_details" }
-func (*ACLInterfaceListDetails) GetCrcString() string { return "d5e80809" }
+func (*ACLInterfaceListDetails) GetCrcString() string { return "e695d256" }
func (*ACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
func (m *ACLInterfaceListDetails) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Count
m.Count = uint8(tmp[pos])
// ACLInterfaceListDump represents VPP binary API message 'acl_interface_list_dump'.
type ACLInterfaceListDump struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" json:"sw_if_index,omitempty"`
}
func (m *ACLInterfaceListDump) Reset() { *m = ACLInterfaceListDump{} }
func (*ACLInterfaceListDump) GetMessageName() string { return "acl_interface_list_dump" }
-func (*ACLInterfaceListDump) GetCrcString() string { return "529cb13f" }
+func (*ACLInterfaceListDump) GetCrcString() string { return "f9e6675e" }
func (*ACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *ACLInterfaceListDump) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
return nil
}
// ACLInterfaceSetACLList represents VPP binary API message 'acl_interface_set_acl_list'.
type ACLInterfaceSetACLList struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
+ Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
func (m *ACLInterfaceSetACLList) Reset() { *m = ACLInterfaceSetACLList{} }
func (*ACLInterfaceSetACLList) GetMessageName() string { return "acl_interface_set_acl_list" }
-func (*ACLInterfaceSetACLList) GetCrcString() string { return "8baece38" }
+func (*ACLInterfaceSetACLList) GetCrcString() string { return "473982bd" }
func (*ACLInterfaceSetACLList) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *ACLInterfaceSetACLList) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Count
m.Count = uint8(tmp[pos])
// ACLInterfaceSetEtypeWhitelist represents VPP binary API message 'acl_interface_set_etype_whitelist'.
type ACLInterfaceSetEtypeWhitelist struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
+ NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
+ Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
}
func (m *ACLInterfaceSetEtypeWhitelist) Reset() { *m = ACLInterfaceSetEtypeWhitelist{} }
func (*ACLInterfaceSetEtypeWhitelist) GetMessageName() string {
return "acl_interface_set_etype_whitelist"
}
-func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { return "f515efc5" }
+func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { return "3f5c2d2d" }
func (*ACLInterfaceSetEtypeWhitelist) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *ACLInterfaceSetEtypeWhitelist) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Count
m.Count = uint8(tmp[pos])
// MacipACLAdd represents VPP binary API message 'macip_acl_add'.
type MacipACLAdd struct {
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
}
func (m *MacipACLAdd) Reset() { *m = MacipACLAdd{} }
func (*MacipACLAdd) GetMessageName() string { return "macip_acl_add" }
-func (*MacipACLAdd) GetCrcString() string { return "0c680ca5" }
+func (*MacipACLAdd) GetCrcString() string { return "d648fd0a" }
func (*MacipACLAdd) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *MacipACLAdd) Size() int {
}
// field[2] s1.IsPermit
size += 1
- // field[2] s1.IsIPv6
- size += 1
// field[2] s1.SrcMac
size += 6
// field[2] s1.SrcMacMask
size += 6
- // field[2] s1.SrcIPAddr
+ // field[2] s1.SrcPrefix
+ // field[3] s1.SrcPrefix.Address
+ // field[4] s1.SrcPrefix.Address.Af
+ size += 1
+ // field[4] s1.SrcPrefix.Address.Un
size += 16
- // field[2] s1.SrcIPPrefixLen
+ // field[3] s1.SrcPrefix.Len
size += 1
}
return size
buf = b
}
// field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
+ copy(buf[pos:pos+64], m.Tag)
+ pos += 64
// field[1] m.Count
o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
pos += 4
// field[2] v1.IsPermit
buf[pos] = uint8(v1.IsPermit)
pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
// field[2] v1.SrcMac
for i := 0; i < 6; i++ {
var x uint8
buf[pos] = uint8(x)
pos += 1
}
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
+ // field[2] v1.SrcPrefix
+ // field[3] v1.SrcPrefix.Address
+ // field[4] v1.SrcPrefix.Address.Af
+ buf[pos] = uint8(v1.SrcPrefix.Address.Af)
+ pos += 1
+ // field[4] v1.SrcPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.SrcPrefix.Len
+ buf[pos] = uint8(v1.SrcPrefix.Len)
pos += 1
}
return buf, nil
pos := 0
_ = pos
// field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.Tag = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
}
// field[1] m.Count
m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
m.R = make([]MacipACLRule, int(m.Count))
for j1 := 0; j1 < int(m.Count); j1++ {
// field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
+ m.R[j1].IsPermit = ACLAction(tmp[pos])
pos += 1
// field[2] m.R[j1].SrcMac
- m.R[j1].SrcMac = make([]uint8, 6)
for i := 0; i < len(m.R[j1].SrcMac); i++ {
m.R[j1].SrcMac[i] = uint8(tmp[pos])
pos += 1
}
// field[2] m.R[j1].SrcMacMask
- m.R[j1].SrcMacMask = make([]uint8, 6)
for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
pos += 1
}
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
+ // field[2] m.R[j1].SrcPrefix
+ // field[3] m.R[j1].SrcPrefix.Address
+ // field[4] m.R[j1].SrcPrefix.Address.Af
+ m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
+ pos += 1
+ // field[4] m.R[j1].SrcPrefix.Address.Un
+ copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].SrcPrefix.Len
+ m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
pos += 1
}
return nil
// MacipACLAddReplace represents VPP binary API message 'macip_acl_add_replace'.
type MacipACLAddReplace struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
+ ACLIndex uint32 `binapi:"u32,name=acl_index,default=4.294967295e+09" json:"acl_index,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
}
func (m *MacipACLAddReplace) Reset() { *m = MacipACLAddReplace{} }
func (*MacipACLAddReplace) GetMessageName() string { return "macip_acl_add_replace" }
-func (*MacipACLAddReplace) GetCrcString() string { return "d3d313e7" }
+func (*MacipACLAddReplace) GetCrcString() string { return "e34402a7" }
func (*MacipACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *MacipACLAddReplace) Size() int {
}
// field[2] s1.IsPermit
size += 1
- // field[2] s1.IsIPv6
- size += 1
// field[2] s1.SrcMac
size += 6
// field[2] s1.SrcMacMask
size += 6
- // field[2] s1.SrcIPAddr
+ // field[2] s1.SrcPrefix
+ // field[3] s1.SrcPrefix.Address
+ // field[4] s1.SrcPrefix.Address.Af
+ size += 1
+ // field[4] s1.SrcPrefix.Address.Un
size += 16
- // field[2] s1.SrcIPPrefixLen
+ // field[3] s1.SrcPrefix.Len
size += 1
}
return size
o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
pos += 4
// field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
+ copy(buf[pos:pos+64], m.Tag)
+ pos += 64
// field[1] m.Count
o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
pos += 4
// field[2] v1.IsPermit
buf[pos] = uint8(v1.IsPermit)
pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
// field[2] v1.SrcMac
for i := 0; i < 6; i++ {
var x uint8
buf[pos] = uint8(x)
pos += 1
}
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
+ // field[2] v1.SrcPrefix
+ // field[3] v1.SrcPrefix.Address
+ // field[4] v1.SrcPrefix.Address.Af
+ buf[pos] = uint8(v1.SrcPrefix.Address.Af)
+ pos += 1
+ // field[4] v1.SrcPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.SrcPrefix.Len
+ buf[pos] = uint8(v1.SrcPrefix.Len)
pos += 1
}
return buf, nil
m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.Tag = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
}
// field[1] m.Count
m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
m.R = make([]MacipACLRule, int(m.Count))
for j1 := 0; j1 < int(m.Count); j1++ {
// field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
+ m.R[j1].IsPermit = ACLAction(tmp[pos])
pos += 1
// field[2] m.R[j1].SrcMac
- m.R[j1].SrcMac = make([]uint8, 6)
for i := 0; i < len(m.R[j1].SrcMac); i++ {
m.R[j1].SrcMac[i] = uint8(tmp[pos])
pos += 1
}
// field[2] m.R[j1].SrcMacMask
- m.R[j1].SrcMacMask = make([]uint8, 6)
for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
pos += 1
}
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
+ // field[2] m.R[j1].SrcPrefix
+ // field[3] m.R[j1].SrcPrefix.Address
+ // field[4] m.R[j1].SrcPrefix.Address.Af
+ m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
+ pos += 1
+ // field[4] m.R[j1].SrcPrefix.Address.Un
+ copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].SrcPrefix.Len
+ m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
pos += 1
}
return nil
// MacipACLDetails represents VPP binary API message 'macip_acl_details'.
type MacipACLDetails struct {
ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag []byte `binapi:"u8[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
}
func (m *MacipACLDetails) Reset() { *m = MacipACLDetails{} }
func (*MacipACLDetails) GetMessageName() string { return "macip_acl_details" }
-func (*MacipACLDetails) GetCrcString() string { return "e164e69a" }
+func (*MacipACLDetails) GetCrcString() string { return "57c7482f" }
func (*MacipACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
func (m *MacipACLDetails) Size() int {
}
// field[2] s1.IsPermit
size += 1
- // field[2] s1.IsIPv6
- size += 1
// field[2] s1.SrcMac
size += 6
// field[2] s1.SrcMacMask
size += 6
- // field[2] s1.SrcIPAddr
+ // field[2] s1.SrcPrefix
+ // field[3] s1.SrcPrefix.Address
+ // field[4] s1.SrcPrefix.Address.Af
+ size += 1
+ // field[4] s1.SrcPrefix.Address.Un
size += 16
- // field[2] s1.SrcIPPrefixLen
+ // field[3] s1.SrcPrefix.Len
size += 1
}
return size
o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
pos += 4
// field[1] m.Tag
- for i := 0; i < 64; i++ {
- var x uint8
- if i < len(m.Tag) {
- x = uint8(m.Tag[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
+ copy(buf[pos:pos+64], m.Tag)
+ pos += 64
// field[1] m.Count
o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
pos += 4
// field[2] v1.IsPermit
buf[pos] = uint8(v1.IsPermit)
pos += 1
- // field[2] v1.IsIPv6
- buf[pos] = uint8(v1.IsIPv6)
- pos += 1
// field[2] v1.SrcMac
for i := 0; i < 6; i++ {
var x uint8
buf[pos] = uint8(x)
pos += 1
}
- // field[2] v1.SrcIPAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v1.SrcIPAddr) {
- x = uint8(v1.SrcIPAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcIPPrefixLen
- buf[pos] = uint8(v1.SrcIPPrefixLen)
+ // field[2] v1.SrcPrefix
+ // field[3] v1.SrcPrefix.Address
+ // field[4] v1.SrcPrefix.Address.Af
+ buf[pos] = uint8(v1.SrcPrefix.Address.Af)
+ pos += 1
+ // field[4] v1.SrcPrefix.Address.Un
+ copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
+ pos += 16
+ // field[3] v1.SrcPrefix.Len
+ buf[pos] = uint8(v1.SrcPrefix.Len)
pos += 1
}
return buf, nil
m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Tag
- m.Tag = make([]uint8, 64)
- for i := 0; i < len(m.Tag); i++ {
- m.Tag[i] = uint8(tmp[pos])
- pos += 1
+ {
+ nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
+ m.Tag = codec.DecodeString(tmp[pos : pos+nul])
+ pos += 64
}
// field[1] m.Count
m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
m.R = make([]MacipACLRule, int(m.Count))
for j1 := 0; j1 < int(m.Count); j1++ {
// field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].IsIPv6
- m.R[j1].IsIPv6 = uint8(tmp[pos])
+ m.R[j1].IsPermit = ACLAction(tmp[pos])
pos += 1
// field[2] m.R[j1].SrcMac
- m.R[j1].SrcMac = make([]uint8, 6)
for i := 0; i < len(m.R[j1].SrcMac); i++ {
m.R[j1].SrcMac[i] = uint8(tmp[pos])
pos += 1
}
// field[2] m.R[j1].SrcMacMask
- m.R[j1].SrcMacMask = make([]uint8, 6)
for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
pos += 1
}
- // field[2] m.R[j1].SrcIPAddr
- m.R[j1].SrcIPAddr = make([]uint8, 16)
- for i := 0; i < len(m.R[j1].SrcIPAddr); i++ {
- m.R[j1].SrcIPAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcIPPrefixLen
- m.R[j1].SrcIPPrefixLen = uint8(tmp[pos])
+ // field[2] m.R[j1].SrcPrefix
+ // field[3] m.R[j1].SrcPrefix.Address
+ // field[4] m.R[j1].SrcPrefix.Address.Af
+ m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
+ pos += 1
+ // field[4] m.R[j1].SrcPrefix.Address.Un
+ copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
+ pos += 16
+ // field[3] m.R[j1].SrcPrefix.Len
+ m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
pos += 1
}
return nil
// MacipACLDump represents VPP binary API message 'macip_acl_dump'.
type MacipACLDump struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
+ ACLIndex uint32 `binapi:"u32,name=acl_index,default=4.294967295e+09" json:"acl_index,omitempty"`
}
func (m *MacipACLDump) Reset() { *m = MacipACLDump{} }
// MacipACLInterfaceAddDel represents VPP binary API message 'macip_acl_interface_add_del'.
type MacipACLInterfaceAddDel struct {
- IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
+ IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
}
func (m *MacipACLInterfaceAddDel) Reset() { *m = MacipACLInterfaceAddDel{} }
func (*MacipACLInterfaceAddDel) GetMessageName() string { return "macip_acl_interface_add_del" }
-func (*MacipACLInterfaceAddDel) GetCrcString() string { return "6a6be97c" }
+func (*MacipACLInterfaceAddDel) GetCrcString() string { return "4b8690b1" }
func (*MacipACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *MacipACLInterfaceAddDel) Size() int {
buf = b
}
// field[1] m.IsAdd
- buf[pos] = uint8(m.IsAdd)
+ if m.IsAdd {
+ buf[pos] = 1
+ }
pos += 1
// field[1] m.SwIfIndex
o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
pos := 0
_ = pos
// field[1] m.IsAdd
- m.IsAdd = uint8(tmp[pos])
+ m.IsAdd = tmp[pos] != 0
pos += 1
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.ACLIndex
m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
// MacipACLInterfaceListDetails represents VPP binary API message 'macip_acl_interface_list_details'.
type MacipACLInterfaceListDetails struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
+ Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
+ Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
}
func (m *MacipACLInterfaceListDetails) Reset() { *m = MacipACLInterfaceListDetails{} }
func (*MacipACLInterfaceListDetails) GetMessageName() string {
return "macip_acl_interface_list_details"
}
-func (*MacipACLInterfaceListDetails) GetCrcString() string { return "29783fa0" }
+func (*MacipACLInterfaceListDetails) GetCrcString() string { return "a0c5d56d" }
func (*MacipACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
func (m *MacipACLInterfaceListDetails) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
// field[1] m.Count
m.Count = uint8(tmp[pos])
// MacipACLInterfaceListDump represents VPP binary API message 'macip_acl_interface_list_dump'.
type MacipACLInterfaceListDump struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
func (m *MacipACLInterfaceListDump) Reset() { *m = MacipACLInterfaceListDump{} }
func (*MacipACLInterfaceListDump) GetMessageName() string { return "macip_acl_interface_list_dump" }
-func (*MacipACLInterfaceListDump) GetCrcString() string { return "529cb13f" }
+func (*MacipACLInterfaceListDump) GetCrcString() string { return "f9e6675e" }
func (*MacipACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage }
func (m *MacipACLInterfaceListDump) Size() int {
pos := 0
_ = pos
// field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
+ m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
pos += 4
return nil
}
var _ = context.Background
var _ = io.Copy
var _ = strconv.Itoa
+var _ = strings.Contains
var _ = struc.Pack
var _ = binary.BigEndian
var _ = math.Float32bits
+var _ = net.ParseIP
+var _ = fmt.Errorf