diff options
author | 2020-07-17 10:36:28 +0200 | |
---|---|---|
committer | 2020-07-17 11:43:41 +0200 | |
commit | d1f24d37bd447b64e402298bb8eb2479681facf9 (patch) | |
tree | a3fc21ba730a91d8a402c7a5bf9c614e3677c4fc /binapi/map/map.ba.go | |
parent | 1548c7e12531e3d055567d761c580a1c7ff0ac40 (diff) |
Improve binapi generator
- simplified Size/Marshal/Unmarshal methods
- replace struc in unions with custom marshal/unmarshal
- fix imports in generated files
- fix mock adapter
- generate rpc service using low-level stream API (dumps generate control ping or stream msg..)
- move examples/binapi to binapi and generate all API for latest release
- add binapigen.Plugin for developing custom generator plugins
- optionally generate HTTP handlers (REST API) for RPC services
- add govpp program for browsing VPP API
Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'binapi/map/map.ba.go')
-rw-r--r-- | binapi/map/map.ba.go | 1404 |
1 files changed, 1404 insertions, 0 deletions
diff --git a/binapi/map/map.ba.go b/binapi/map/map.ba.go new file mode 100644 index 0000000..fc3c733 --- /dev/null +++ b/binapi/map/map.ba.go @@ -0,0 +1,1404 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.4.0-dev +// VPP: 20.05-release +// source: /usr/share/vpp/api/plugins/map.api.json + +// Package maps contains generated bindings for API file map.api. +// +// Contents: +// 30 messages +// +package maps + +import ( + api "git.fd.io/govpp.git/api" + interface_types "git.fd.io/govpp.git/binapi/interface_types" + ip_types "git.fd.io/govpp.git/binapi/ip_types" + codec "git.fd.io/govpp.git/codec" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "map" + APIVersion = "4.1.1" + VersionCrc = 0x82b79829 +) + +// MapAddDelRule defines message 'map_add_del_rule'. +type MapAddDelRule struct { + Index uint32 `binapi:"u32,name=index" json:"index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` + IP6Dst ip_types.IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"` + Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"` +} + +func (m *MapAddDelRule) Reset() { *m = MapAddDelRule{} } +func (*MapAddDelRule) GetMessageName() string { return "map_add_del_rule" } +func (*MapAddDelRule) GetCrcString() string { return "c65b32f7" } +func (*MapAddDelRule) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapAddDelRule) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Index + size += 1 // m.IsAdd + size += 1 * 16 // m.IP6Dst + size += 2 // m.Psid + return size +} +func (m *MapAddDelRule) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Index)) + buf.EncodeBool(m.IsAdd) + buf.EncodeBytes(m.IP6Dst[:], 16) + buf.EncodeUint16(uint16(m.Psid)) + return buf.Bytes(), nil +} +func (m *MapAddDelRule) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Index = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + copy(m.IP6Dst[:], buf.DecodeBytes(16)) + m.Psid = buf.DecodeUint16() + return nil +} + +// MapAddDelRuleReply defines message 'map_add_del_rule_reply'. +type MapAddDelRuleReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapAddDelRuleReply) Reset() { *m = MapAddDelRuleReply{} } +func (*MapAddDelRuleReply) GetMessageName() string { return "map_add_del_rule_reply" } +func (*MapAddDelRuleReply) GetCrcString() string { return "e8d4e804" } +func (*MapAddDelRuleReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapAddDelRuleReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapAddDelRuleReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapAddDelRuleReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapAddDomain defines message 'map_add_domain'. +type MapAddDomain struct { + IP6Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"` + IP4Prefix ip_types.IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"` + IP6Src ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"` + EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"` + PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"` + PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"` + Mtu uint16 `binapi:"u16,name=mtu,default=%!s(float64=1280)" json:"mtu,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` +} + +func (m *MapAddDomain) Reset() { *m = MapAddDomain{} } +func (*MapAddDomain) GetMessageName() string { return "map_add_domain" } +func (*MapAddDomain) GetCrcString() string { return "7a5a18c9" } +func (*MapAddDomain) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapAddDomain) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 * 16 // m.IP6Prefix.Address + size += 1 // m.IP6Prefix.Len + size += 1 * 4 // m.IP4Prefix.Address + size += 1 // m.IP4Prefix.Len + size += 1 * 16 // m.IP6Src.Address + size += 1 // m.IP6Src.Len + size += 1 // m.EaBitsLen + size += 1 // m.PsidOffset + size += 1 // m.PsidLength + size += 2 // m.Mtu + size += 64 // m.Tag + return size +} +func (m *MapAddDomain) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBytes(m.IP6Prefix.Address[:], 16) + buf.EncodeUint8(uint8(m.IP6Prefix.Len)) + buf.EncodeBytes(m.IP4Prefix.Address[:], 4) + buf.EncodeUint8(uint8(m.IP4Prefix.Len)) + buf.EncodeBytes(m.IP6Src.Address[:], 16) + buf.EncodeUint8(uint8(m.IP6Src.Len)) + buf.EncodeUint8(uint8(m.EaBitsLen)) + buf.EncodeUint8(uint8(m.PsidOffset)) + buf.EncodeUint8(uint8(m.PsidLength)) + buf.EncodeUint16(uint16(m.Mtu)) + buf.EncodeString(m.Tag, 64) + return buf.Bytes(), nil +} +func (m *MapAddDomain) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16)) + m.IP6Prefix.Len = buf.DecodeUint8() + copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4)) + m.IP4Prefix.Len = buf.DecodeUint8() + copy(m.IP6Src.Address[:], buf.DecodeBytes(16)) + m.IP6Src.Len = buf.DecodeUint8() + m.EaBitsLen = buf.DecodeUint8() + m.PsidOffset = buf.DecodeUint8() + m.PsidLength = buf.DecodeUint8() + m.Mtu = buf.DecodeUint16() + m.Tag = buf.DecodeString(64) + return nil +} + +// MapAddDomainReply defines message 'map_add_domain_reply'. +type MapAddDomainReply struct { + Index uint32 `binapi:"u32,name=index" json:"index,omitempty"` + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapAddDomainReply) Reset() { *m = MapAddDomainReply{} } +func (*MapAddDomainReply) GetMessageName() string { return "map_add_domain_reply" } +func (*MapAddDomainReply) GetCrcString() string { return "3e6d4e2c" } +func (*MapAddDomainReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapAddDomainReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Index + size += 4 // m.Retval + return size +} +func (m *MapAddDomainReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Index)) + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapAddDomainReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Index = buf.DecodeUint32() + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapDelDomain defines message 'map_del_domain'. +type MapDelDomain struct { + Index uint32 `binapi:"u32,name=index" json:"index,omitempty"` +} + +func (m *MapDelDomain) Reset() { *m = MapDelDomain{} } +func (*MapDelDomain) GetMessageName() string { return "map_del_domain" } +func (*MapDelDomain) GetCrcString() string { return "8ac76db6" } +func (*MapDelDomain) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapDelDomain) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Index + return size +} +func (m *MapDelDomain) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Index)) + return buf.Bytes(), nil +} +func (m *MapDelDomain) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Index = buf.DecodeUint32() + return nil +} + +// MapDelDomainReply defines message 'map_del_domain_reply'. +type MapDelDomainReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapDelDomainReply) Reset() { *m = MapDelDomainReply{} } +func (*MapDelDomainReply) GetMessageName() string { return "map_del_domain_reply" } +func (*MapDelDomainReply) GetCrcString() string { return "e8d4e804" } +func (*MapDelDomainReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapDelDomainReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapDelDomainReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapDelDomainReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapDomainDetails defines message 'map_domain_details'. +type MapDomainDetails struct { + DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"` + IP6Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"` + IP4Prefix ip_types.IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"` + IP6Src ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_src" json:"ip6_src,omitempty"` + EaBitsLen uint8 `binapi:"u8,name=ea_bits_len" json:"ea_bits_len,omitempty"` + PsidOffset uint8 `binapi:"u8,name=psid_offset" json:"psid_offset,omitempty"` + PsidLength uint8 `binapi:"u8,name=psid_length" json:"psid_length,omitempty"` + Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` + Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` +} + +func (m *MapDomainDetails) Reset() { *m = MapDomainDetails{} } +func (*MapDomainDetails) GetMessageName() string { return "map_domain_details" } +func (*MapDomainDetails) GetCrcString() string { return "fc1859dd" } +func (*MapDomainDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapDomainDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.DomainIndex + size += 1 * 16 // m.IP6Prefix.Address + size += 1 // m.IP6Prefix.Len + size += 1 * 4 // m.IP4Prefix.Address + size += 1 // m.IP4Prefix.Len + size += 1 * 16 // m.IP6Src.Address + size += 1 // m.IP6Src.Len + size += 1 // m.EaBitsLen + size += 1 // m.PsidOffset + size += 1 // m.PsidLength + size += 1 // m.Flags + size += 2 // m.Mtu + size += 64 // m.Tag + return size +} +func (m *MapDomainDetails) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.DomainIndex)) + buf.EncodeBytes(m.IP6Prefix.Address[:], 16) + buf.EncodeUint8(uint8(m.IP6Prefix.Len)) + buf.EncodeBytes(m.IP4Prefix.Address[:], 4) + buf.EncodeUint8(uint8(m.IP4Prefix.Len)) + buf.EncodeBytes(m.IP6Src.Address[:], 16) + buf.EncodeUint8(uint8(m.IP6Src.Len)) + buf.EncodeUint8(uint8(m.EaBitsLen)) + buf.EncodeUint8(uint8(m.PsidOffset)) + buf.EncodeUint8(uint8(m.PsidLength)) + buf.EncodeUint8(uint8(m.Flags)) + buf.EncodeUint16(uint16(m.Mtu)) + buf.EncodeString(m.Tag, 64) + return buf.Bytes(), nil +} +func (m *MapDomainDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.DomainIndex = buf.DecodeUint32() + copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16)) + m.IP6Prefix.Len = buf.DecodeUint8() + copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4)) + m.IP4Prefix.Len = buf.DecodeUint8() + copy(m.IP6Src.Address[:], buf.DecodeBytes(16)) + m.IP6Src.Len = buf.DecodeUint8() + m.EaBitsLen = buf.DecodeUint8() + m.PsidOffset = buf.DecodeUint8() + m.PsidLength = buf.DecodeUint8() + m.Flags = buf.DecodeUint8() + m.Mtu = buf.DecodeUint16() + m.Tag = buf.DecodeString(64) + return nil +} + +// MapDomainDump defines message 'map_domain_dump'. +type MapDomainDump struct{} + +func (m *MapDomainDump) Reset() { *m = MapDomainDump{} } +func (*MapDomainDump) GetMessageName() string { return "map_domain_dump" } +func (*MapDomainDump) GetCrcString() string { return "51077d14" } +func (*MapDomainDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapDomainDump) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *MapDomainDump) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + return buf.Bytes(), nil +} +func (m *MapDomainDump) Unmarshal(b []byte) error { + return nil +} + +// MapIfEnableDisable defines message 'map_if_enable_disable'. +type MapIfEnableDisable struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IsEnable bool `binapi:"bool,name=is_enable" json:"is_enable,omitempty"` + IsTranslation bool `binapi:"bool,name=is_translation" json:"is_translation,omitempty"` +} + +func (m *MapIfEnableDisable) Reset() { *m = MapIfEnableDisable{} } +func (*MapIfEnableDisable) GetMessageName() string { return "map_if_enable_disable" } +func (*MapIfEnableDisable) GetCrcString() string { return "59bb32f4" } +func (*MapIfEnableDisable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapIfEnableDisable) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 1 // m.IsEnable + size += 1 // m.IsTranslation + return size +} +func (m *MapIfEnableDisable) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.IsEnable) + buf.EncodeBool(m.IsTranslation) + return buf.Bytes(), nil +} +func (m *MapIfEnableDisable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsEnable = buf.DecodeBool() + m.IsTranslation = buf.DecodeBool() + return nil +} + +// MapIfEnableDisableReply defines message 'map_if_enable_disable_reply'. +type MapIfEnableDisableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapIfEnableDisableReply) Reset() { *m = MapIfEnableDisableReply{} } +func (*MapIfEnableDisableReply) GetMessageName() string { return "map_if_enable_disable_reply" } +func (*MapIfEnableDisableReply) GetCrcString() string { return "e8d4e804" } +func (*MapIfEnableDisableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapIfEnableDisableReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapIfEnableDisableReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapIfEnableDisableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamAddDelPreResolve defines message 'map_param_add_del_pre_resolve'. +type MapParamAddDelPreResolve struct { + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` + IP4NhAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"` + IP6NhAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"` +} + +func (m *MapParamAddDelPreResolve) Reset() { *m = MapParamAddDelPreResolve{} } +func (*MapParamAddDelPreResolve) GetMessageName() string { return "map_param_add_del_pre_resolve" } +func (*MapParamAddDelPreResolve) GetCrcString() string { return "17008c66" } +func (*MapParamAddDelPreResolve) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamAddDelPreResolve) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.IsAdd + size += 1 * 4 // m.IP4NhAddress + size += 1 * 16 // m.IP6NhAddress + return size +} +func (m *MapParamAddDelPreResolve) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.IsAdd) + buf.EncodeBytes(m.IP4NhAddress[:], 4) + buf.EncodeBytes(m.IP6NhAddress[:], 16) + return buf.Bytes(), nil +} +func (m *MapParamAddDelPreResolve) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsAdd = buf.DecodeBool() + copy(m.IP4NhAddress[:], buf.DecodeBytes(4)) + copy(m.IP6NhAddress[:], buf.DecodeBytes(16)) + return nil +} + +// MapParamAddDelPreResolveReply defines message 'map_param_add_del_pre_resolve_reply'. +type MapParamAddDelPreResolveReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamAddDelPreResolveReply) Reset() { *m = MapParamAddDelPreResolveReply{} } +func (*MapParamAddDelPreResolveReply) GetMessageName() string { + return "map_param_add_del_pre_resolve_reply" +} +func (*MapParamAddDelPreResolveReply) GetCrcString() string { return "e8d4e804" } +func (*MapParamAddDelPreResolveReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamAddDelPreResolveReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamAddDelPreResolveReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamAddDelPreResolveReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamGet defines message 'map_param_get'. +type MapParamGet struct{} + +func (m *MapParamGet) Reset() { *m = MapParamGet{} } +func (*MapParamGet) GetMessageName() string { return "map_param_get" } +func (*MapParamGet) GetCrcString() string { return "51077d14" } +func (*MapParamGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamGet) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *MapParamGet) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + return buf.Bytes(), nil +} +func (m *MapParamGet) Unmarshal(b []byte) error { + return nil +} + +// MapParamGetReply defines message 'map_param_get_reply'. +type MapParamGetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + FragInner uint8 `binapi:"u8,name=frag_inner" json:"frag_inner,omitempty"` + FragIgnoreDf uint8 `binapi:"u8,name=frag_ignore_df" json:"frag_ignore_df,omitempty"` + ICMPIP4ErrRelaySrc ip_types.IP4Address `binapi:"ip4_address,name=icmp_ip4_err_relay_src" json:"icmp_ip4_err_relay_src,omitempty"` + ICMP6EnableUnreachable bool `binapi:"bool,name=icmp6_enable_unreachable" json:"icmp6_enable_unreachable,omitempty"` + IP4NhAddress ip_types.IP4Address `binapi:"ip4_address,name=ip4_nh_address" json:"ip4_nh_address,omitempty"` + IP6NhAddress ip_types.IP6Address `binapi:"ip6_address,name=ip6_nh_address" json:"ip6_nh_address,omitempty"` + IP4LifetimeMs uint16 `binapi:"u16,name=ip4_lifetime_ms" json:"ip4_lifetime_ms,omitempty"` + IP4PoolSize uint16 `binapi:"u16,name=ip4_pool_size" json:"ip4_pool_size,omitempty"` + IP4Buffers uint32 `binapi:"u32,name=ip4_buffers" json:"ip4_buffers,omitempty"` + IP4HtRatio float64 `binapi:"f64,name=ip4_ht_ratio" json:"ip4_ht_ratio,omitempty"` + SecCheckEnable bool `binapi:"bool,name=sec_check_enable" json:"sec_check_enable,omitempty"` + SecCheckFragments bool `binapi:"bool,name=sec_check_fragments" json:"sec_check_fragments,omitempty"` + TcCopy bool `binapi:"bool,name=tc_copy" json:"tc_copy,omitempty"` + TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"` +} + +func (m *MapParamGetReply) Reset() { *m = MapParamGetReply{} } +func (*MapParamGetReply) GetMessageName() string { return "map_param_get_reply" } +func (*MapParamGetReply) GetCrcString() string { return "28092156" } +func (*MapParamGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamGetReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + size += 1 // m.FragInner + size += 1 // m.FragIgnoreDf + size += 1 * 4 // m.ICMPIP4ErrRelaySrc + size += 1 // m.ICMP6EnableUnreachable + size += 1 * 4 // m.IP4NhAddress + size += 1 * 16 // m.IP6NhAddress + size += 2 // m.IP4LifetimeMs + size += 2 // m.IP4PoolSize + size += 4 // m.IP4Buffers + size += 8 // m.IP4HtRatio + size += 1 // m.SecCheckEnable + size += 1 // m.SecCheckFragments + size += 1 // m.TcCopy + size += 1 // m.TcClass + return size +} +func (m *MapParamGetReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + buf.EncodeUint8(uint8(m.FragInner)) + buf.EncodeUint8(uint8(m.FragIgnoreDf)) + buf.EncodeBytes(m.ICMPIP4ErrRelaySrc[:], 4) + buf.EncodeBool(m.ICMP6EnableUnreachable) + buf.EncodeBytes(m.IP4NhAddress[:], 4) + buf.EncodeBytes(m.IP6NhAddress[:], 16) + buf.EncodeUint16(uint16(m.IP4LifetimeMs)) + buf.EncodeUint16(uint16(m.IP4PoolSize)) + buf.EncodeUint32(uint32(m.IP4Buffers)) + buf.EncodeFloat64(float64(m.IP4HtRatio)) + buf.EncodeBool(m.SecCheckEnable) + buf.EncodeBool(m.SecCheckFragments) + buf.EncodeBool(m.TcCopy) + buf.EncodeUint8(uint8(m.TcClass)) + return buf.Bytes(), nil +} +func (m *MapParamGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + m.FragInner = buf.DecodeUint8() + m.FragIgnoreDf = buf.DecodeUint8() + copy(m.ICMPIP4ErrRelaySrc[:], buf.DecodeBytes(4)) + m.ICMP6EnableUnreachable = buf.DecodeBool() + copy(m.IP4NhAddress[:], buf.DecodeBytes(4)) + copy(m.IP6NhAddress[:], buf.DecodeBytes(16)) + m.IP4LifetimeMs = buf.DecodeUint16() + m.IP4PoolSize = buf.DecodeUint16() + m.IP4Buffers = buf.DecodeUint32() + m.IP4HtRatio = float64(buf.DecodeFloat64()) + m.SecCheckEnable = buf.DecodeBool() + m.SecCheckFragments = buf.DecodeBool() + m.TcCopy = buf.DecodeBool() + m.TcClass = buf.DecodeUint8() + return nil +} + +// MapParamSetFragmentation defines message 'map_param_set_fragmentation'. +type MapParamSetFragmentation struct { + Inner bool `binapi:"bool,name=inner" json:"inner,omitempty"` + IgnoreDf bool `binapi:"bool,name=ignore_df" json:"ignore_df,omitempty"` +} + +func (m *MapParamSetFragmentation) Reset() { *m = MapParamSetFragmentation{} } +func (*MapParamSetFragmentation) GetMessageName() string { return "map_param_set_fragmentation" } +func (*MapParamSetFragmentation) GetCrcString() string { return "9ff54d90" } +func (*MapParamSetFragmentation) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamSetFragmentation) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.Inner + size += 1 // m.IgnoreDf + return size +} +func (m *MapParamSetFragmentation) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.Inner) + buf.EncodeBool(m.IgnoreDf) + return buf.Bytes(), nil +} +func (m *MapParamSetFragmentation) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Inner = buf.DecodeBool() + m.IgnoreDf = buf.DecodeBool() + return nil +} + +// MapParamSetFragmentationReply defines message 'map_param_set_fragmentation_reply'. +type MapParamSetFragmentationReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamSetFragmentationReply) Reset() { *m = MapParamSetFragmentationReply{} } +func (*MapParamSetFragmentationReply) GetMessageName() string { + return "map_param_set_fragmentation_reply" +} +func (*MapParamSetFragmentationReply) GetCrcString() string { return "e8d4e804" } +func (*MapParamSetFragmentationReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamSetFragmentationReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamSetFragmentationReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamSetFragmentationReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamSetICMP defines message 'map_param_set_icmp'. +type MapParamSetICMP struct { + IP4ErrRelaySrc ip_types.IP4Address `binapi:"ip4_address,name=ip4_err_relay_src" json:"ip4_err_relay_src,omitempty"` +} + +func (m *MapParamSetICMP) Reset() { *m = MapParamSetICMP{} } +func (*MapParamSetICMP) GetMessageName() string { return "map_param_set_icmp" } +func (*MapParamSetICMP) GetCrcString() string { return "58210cbf" } +func (*MapParamSetICMP) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamSetICMP) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 * 4 // m.IP4ErrRelaySrc + return size +} +func (m *MapParamSetICMP) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBytes(m.IP4ErrRelaySrc[:], 4) + return buf.Bytes(), nil +} +func (m *MapParamSetICMP) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + copy(m.IP4ErrRelaySrc[:], buf.DecodeBytes(4)) + return nil +} + +// MapParamSetICMP6 defines message 'map_param_set_icmp6'. +type MapParamSetICMP6 struct { + EnableUnreachable bool `binapi:"bool,name=enable_unreachable" json:"enable_unreachable,omitempty"` +} + +func (m *MapParamSetICMP6) Reset() { *m = MapParamSetICMP6{} } +func (*MapParamSetICMP6) GetMessageName() string { return "map_param_set_icmp6" } +func (*MapParamSetICMP6) GetCrcString() string { return "5d01f8c1" } +func (*MapParamSetICMP6) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamSetICMP6) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.EnableUnreachable + return size +} +func (m *MapParamSetICMP6) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.EnableUnreachable) + return buf.Bytes(), nil +} +func (m *MapParamSetICMP6) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.EnableUnreachable = buf.DecodeBool() + return nil +} + +// MapParamSetICMP6Reply defines message 'map_param_set_icmp6_reply'. +type MapParamSetICMP6Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamSetICMP6Reply) Reset() { *m = MapParamSetICMP6Reply{} } +func (*MapParamSetICMP6Reply) GetMessageName() string { return "map_param_set_icmp6_reply" } +func (*MapParamSetICMP6Reply) GetCrcString() string { return "e8d4e804" } +func (*MapParamSetICMP6Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamSetICMP6Reply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamSetICMP6Reply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamSetICMP6Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamSetICMPReply defines message 'map_param_set_icmp_reply'. +type MapParamSetICMPReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamSetICMPReply) Reset() { *m = MapParamSetICMPReply{} } +func (*MapParamSetICMPReply) GetMessageName() string { return "map_param_set_icmp_reply" } +func (*MapParamSetICMPReply) GetCrcString() string { return "e8d4e804" } +func (*MapParamSetICMPReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamSetICMPReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamSetICMPReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamSetICMPReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamSetSecurityCheck defines message 'map_param_set_security_check'. +type MapParamSetSecurityCheck struct { + Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` + Fragments bool `binapi:"bool,name=fragments" json:"fragments,omitempty"` +} + +func (m *MapParamSetSecurityCheck) Reset() { *m = MapParamSetSecurityCheck{} } +func (*MapParamSetSecurityCheck) GetMessageName() string { return "map_param_set_security_check" } +func (*MapParamSetSecurityCheck) GetCrcString() string { return "6abe9836" } +func (*MapParamSetSecurityCheck) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamSetSecurityCheck) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.Enable + size += 1 // m.Fragments + return size +} +func (m *MapParamSetSecurityCheck) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.Enable) + buf.EncodeBool(m.Fragments) + return buf.Bytes(), nil +} +func (m *MapParamSetSecurityCheck) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Enable = buf.DecodeBool() + m.Fragments = buf.DecodeBool() + return nil +} + +// MapParamSetSecurityCheckReply defines message 'map_param_set_security_check_reply'. +type MapParamSetSecurityCheckReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamSetSecurityCheckReply) Reset() { *m = MapParamSetSecurityCheckReply{} } +func (*MapParamSetSecurityCheckReply) GetMessageName() string { + return "map_param_set_security_check_reply" +} +func (*MapParamSetSecurityCheckReply) GetCrcString() string { return "e8d4e804" } +func (*MapParamSetSecurityCheckReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamSetSecurityCheckReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamSetSecurityCheckReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamSetSecurityCheckReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamSetTCP defines message 'map_param_set_tcp'. +type MapParamSetTCP struct { + TCPMss uint16 `binapi:"u16,name=tcp_mss" json:"tcp_mss,omitempty"` +} + +func (m *MapParamSetTCP) Reset() { *m = MapParamSetTCP{} } +func (*MapParamSetTCP) GetMessageName() string { return "map_param_set_tcp" } +func (*MapParamSetTCP) GetCrcString() string { return "87a825d9" } +func (*MapParamSetTCP) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamSetTCP) Size() int { + if m == nil { + return 0 + } + var size int + size += 2 // m.TCPMss + return size +} +func (m *MapParamSetTCP) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint16(uint16(m.TCPMss)) + return buf.Bytes(), nil +} +func (m *MapParamSetTCP) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TCPMss = buf.DecodeUint16() + return nil +} + +// MapParamSetTCPReply defines message 'map_param_set_tcp_reply'. +type MapParamSetTCPReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamSetTCPReply) Reset() { *m = MapParamSetTCPReply{} } +func (*MapParamSetTCPReply) GetMessageName() string { return "map_param_set_tcp_reply" } +func (*MapParamSetTCPReply) GetCrcString() string { return "e8d4e804" } +func (*MapParamSetTCPReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamSetTCPReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamSetTCPReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamSetTCPReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapParamSetTrafficClass defines message 'map_param_set_traffic_class'. +type MapParamSetTrafficClass struct { + Copy bool `binapi:"bool,name=copy" json:"copy,omitempty"` + TcClass uint8 `binapi:"u8,name=tc_class" json:"tc_class,omitempty"` +} + +func (m *MapParamSetTrafficClass) Reset() { *m = MapParamSetTrafficClass{} } +func (*MapParamSetTrafficClass) GetMessageName() string { return "map_param_set_traffic_class" } +func (*MapParamSetTrafficClass) GetCrcString() string { return "9cac455c" } +func (*MapParamSetTrafficClass) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapParamSetTrafficClass) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.Copy + size += 1 // m.TcClass + return size +} +func (m *MapParamSetTrafficClass) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.Copy) + buf.EncodeUint8(uint8(m.TcClass)) + return buf.Bytes(), nil +} +func (m *MapParamSetTrafficClass) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Copy = buf.DecodeBool() + m.TcClass = buf.DecodeUint8() + return nil +} + +// MapParamSetTrafficClassReply defines message 'map_param_set_traffic_class_reply'. +type MapParamSetTrafficClassReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *MapParamSetTrafficClassReply) Reset() { *m = MapParamSetTrafficClassReply{} } +func (*MapParamSetTrafficClassReply) GetMessageName() string { + return "map_param_set_traffic_class_reply" +} +func (*MapParamSetTrafficClassReply) GetCrcString() string { return "e8d4e804" } +func (*MapParamSetTrafficClassReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapParamSetTrafficClassReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *MapParamSetTrafficClassReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *MapParamSetTrafficClassReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// MapRuleDetails defines message 'map_rule_details'. +type MapRuleDetails struct { + IP6Dst ip_types.IP6Address `binapi:"ip6_address,name=ip6_dst" json:"ip6_dst,omitempty"` + Psid uint16 `binapi:"u16,name=psid" json:"psid,omitempty"` +} + +func (m *MapRuleDetails) Reset() { *m = MapRuleDetails{} } +func (*MapRuleDetails) GetMessageName() string { return "map_rule_details" } +func (*MapRuleDetails) GetCrcString() string { return "c7cbeea5" } +func (*MapRuleDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapRuleDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 * 16 // m.IP6Dst + size += 2 // m.Psid + return size +} +func (m *MapRuleDetails) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBytes(m.IP6Dst[:], 16) + buf.EncodeUint16(uint16(m.Psid)) + return buf.Bytes(), nil +} +func (m *MapRuleDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + copy(m.IP6Dst[:], buf.DecodeBytes(16)) + m.Psid = buf.DecodeUint16() + return nil +} + +// MapRuleDump defines message 'map_rule_dump'. +type MapRuleDump struct { + DomainIndex uint32 `binapi:"u32,name=domain_index" json:"domain_index,omitempty"` +} + +func (m *MapRuleDump) Reset() { *m = MapRuleDump{} } +func (*MapRuleDump) GetMessageName() string { return "map_rule_dump" } +func (*MapRuleDump) GetCrcString() string { return "e43e6ff6" } +func (*MapRuleDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapRuleDump) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.DomainIndex + return size +} +func (m *MapRuleDump) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.DomainIndex)) + return buf.Bytes(), nil +} +func (m *MapRuleDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.DomainIndex = buf.DecodeUint32() + return nil +} + +// MapSummaryStats defines message 'map_summary_stats'. +type MapSummaryStats struct{} + +func (m *MapSummaryStats) Reset() { *m = MapSummaryStats{} } +func (*MapSummaryStats) GetMessageName() string { return "map_summary_stats" } +func (*MapSummaryStats) GetCrcString() string { return "51077d14" } +func (*MapSummaryStats) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *MapSummaryStats) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *MapSummaryStats) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + return buf.Bytes(), nil +} +func (m *MapSummaryStats) Unmarshal(b []byte) error { + return nil +} + +// MapSummaryStatsReply defines message 'map_summary_stats_reply'. +type MapSummaryStatsReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TotalBindings uint64 `binapi:"u64,name=total_bindings" json:"total_bindings,omitempty"` + TotalPkts []uint64 `binapi:"u64[2],name=total_pkts" json:"total_pkts,omitempty"` + TotalBytes []uint64 `binapi:"u64[2],name=total_bytes" json:"total_bytes,omitempty"` + TotalIP4Fragments uint64 `binapi:"u64,name=total_ip4_fragments" json:"total_ip4_fragments,omitempty"` + TotalSecurityCheck []uint64 `binapi:"u64[2],name=total_security_check" json:"total_security_check,omitempty"` +} + +func (m *MapSummaryStatsReply) Reset() { *m = MapSummaryStatsReply{} } +func (*MapSummaryStatsReply) GetMessageName() string { return "map_summary_stats_reply" } +func (*MapSummaryStatsReply) GetCrcString() string { return "0e4ace0e" } +func (*MapSummaryStatsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *MapSummaryStatsReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + size += 8 // m.TotalBindings + size += 8 * 2 // m.TotalPkts + size += 8 * 2 // m.TotalBytes + size += 8 // m.TotalIP4Fragments + size += 8 * 2 // m.TotalSecurityCheck + return size +} +func (m *MapSummaryStatsReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + buf.EncodeUint64(uint64(m.TotalBindings)) + for i := 0; i < 2; i++ { + var x uint64 + if i < len(m.TotalPkts) { + x = uint64(m.TotalPkts[i]) + } + buf.EncodeUint64(uint64(x)) + } + for i := 0; i < 2; i++ { + var x uint64 + if i < len(m.TotalBytes) { + x = uint64(m.TotalBytes[i]) + } + buf.EncodeUint64(uint64(x)) + } + buf.EncodeUint64(uint64(m.TotalIP4Fragments)) + for i := 0; i < 2; i++ { + var x uint64 + if i < len(m.TotalSecurityCheck) { + x = uint64(m.TotalSecurityCheck[i]) + } + buf.EncodeUint64(uint64(x)) + } + return buf.Bytes(), nil +} +func (m *MapSummaryStatsReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + m.TotalBindings = buf.DecodeUint64() + m.TotalPkts = make([]uint64, 2) + for i := 0; i < len(m.TotalPkts); i++ { + m.TotalPkts[i] = buf.DecodeUint64() + } + m.TotalBytes = make([]uint64, 2) + for i := 0; i < len(m.TotalBytes); i++ { + m.TotalBytes[i] = buf.DecodeUint64() + } + m.TotalIP4Fragments = buf.DecodeUint64() + m.TotalSecurityCheck = make([]uint64, 2) + for i := 0; i < len(m.TotalSecurityCheck); i++ { + m.TotalSecurityCheck[i] = buf.DecodeUint64() + } + return nil +} + +func init() { file_maps_binapi_init() } +func file_maps_binapi_init() { + api.RegisterMessage((*MapAddDelRule)(nil), "map_add_del_rule_c65b32f7") + api.RegisterMessage((*MapAddDelRuleReply)(nil), "map_add_del_rule_reply_e8d4e804") + api.RegisterMessage((*MapAddDomain)(nil), "map_add_domain_7a5a18c9") + api.RegisterMessage((*MapAddDomainReply)(nil), "map_add_domain_reply_3e6d4e2c") + api.RegisterMessage((*MapDelDomain)(nil), "map_del_domain_8ac76db6") + api.RegisterMessage((*MapDelDomainReply)(nil), "map_del_domain_reply_e8d4e804") + api.RegisterMessage((*MapDomainDetails)(nil), "map_domain_details_fc1859dd") + api.RegisterMessage((*MapDomainDump)(nil), "map_domain_dump_51077d14") + api.RegisterMessage((*MapIfEnableDisable)(nil), "map_if_enable_disable_59bb32f4") + api.RegisterMessage((*MapIfEnableDisableReply)(nil), "map_if_enable_disable_reply_e8d4e804") + api.RegisterMessage((*MapParamAddDelPreResolve)(nil), "map_param_add_del_pre_resolve_17008c66") + api.RegisterMessage((*MapParamAddDelPreResolveReply)(nil), "map_param_add_del_pre_resolve_reply_e8d4e804") + api.RegisterMessage((*MapParamGet)(nil), "map_param_get_51077d14") + api.RegisterMessage((*MapParamGetReply)(nil), "map_param_get_reply_28092156") + api.RegisterMessage((*MapParamSetFragmentation)(nil), "map_param_set_fragmentation_9ff54d90") + api.RegisterMessage((*MapParamSetFragmentationReply)(nil), "map_param_set_fragmentation_reply_e8d4e804") + api.RegisterMessage((*MapParamSetICMP)(nil), "map_param_set_icmp_58210cbf") + api.RegisterMessage((*MapParamSetICMP6)(nil), "map_param_set_icmp6_5d01f8c1") + api.RegisterMessage((*MapParamSetICMP6Reply)(nil), "map_param_set_icmp6_reply_e8d4e804") + api.RegisterMessage((*MapParamSetICMPReply)(nil), "map_param_set_icmp_reply_e8d4e804") + api.RegisterMessage((*MapParamSetSecurityCheck)(nil), "map_param_set_security_check_6abe9836") + api.RegisterMessage((*MapParamSetSecurityCheckReply)(nil), "map_param_set_security_check_reply_e8d4e804") + api.RegisterMessage((*MapParamSetTCP)(nil), "map_param_set_tcp_87a825d9") + api.RegisterMessage((*MapParamSetTCPReply)(nil), "map_param_set_tcp_reply_e8d4e804") + api.RegisterMessage((*MapParamSetTrafficClass)(nil), "map_param_set_traffic_class_9cac455c") + api.RegisterMessage((*MapParamSetTrafficClassReply)(nil), "map_param_set_traffic_class_reply_e8d4e804") + api.RegisterMessage((*MapRuleDetails)(nil), "map_rule_details_c7cbeea5") + api.RegisterMessage((*MapRuleDump)(nil), "map_rule_dump_e43e6ff6") + api.RegisterMessage((*MapSummaryStats)(nil), "map_summary_stats_51077d14") + api.RegisterMessage((*MapSummaryStatsReply)(nil), "map_summary_stats_reply_0e4ace0e") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*MapAddDelRule)(nil), + (*MapAddDelRuleReply)(nil), + (*MapAddDomain)(nil), + (*MapAddDomainReply)(nil), + (*MapDelDomain)(nil), + (*MapDelDomainReply)(nil), + (*MapDomainDetails)(nil), + (*MapDomainDump)(nil), + (*MapIfEnableDisable)(nil), + (*MapIfEnableDisableReply)(nil), + (*MapParamAddDelPreResolve)(nil), + (*MapParamAddDelPreResolveReply)(nil), + (*MapParamGet)(nil), + (*MapParamGetReply)(nil), + (*MapParamSetFragmentation)(nil), + (*MapParamSetFragmentationReply)(nil), + (*MapParamSetICMP)(nil), + (*MapParamSetICMP6)(nil), + (*MapParamSetICMP6Reply)(nil), + (*MapParamSetICMPReply)(nil), + (*MapParamSetSecurityCheck)(nil), + (*MapParamSetSecurityCheckReply)(nil), + (*MapParamSetTCP)(nil), + (*MapParamSetTCPReply)(nil), + (*MapParamSetTrafficClass)(nil), + (*MapParamSetTrafficClassReply)(nil), + (*MapRuleDetails)(nil), + (*MapRuleDump)(nil), + (*MapSummaryStats)(nil), + (*MapSummaryStatsReply)(nil), + } +} |