diff options
Diffstat (limited to 'binapi/cnat/cnat.ba.go')
-rw-r--r-- | binapi/cnat/cnat.ba.go | 1213 |
1 files changed, 1213 insertions, 0 deletions
diff --git a/binapi/cnat/cnat.ba.go b/binapi/cnat/cnat.ba.go new file mode 100644 index 0000000..735aaeb --- /dev/null +++ b/binapi/cnat/cnat.ba.go @@ -0,0 +1,1213 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.3.5-56-gc0da1f2-dirty +// VPP: 21.06-release +// source: /usr/share/vpp/api/plugins/cnat.api.json + +// Package cnat contains generated bindings for API file cnat.api. +// +// Contents: +// 5 enums +// 4 structs +// 20 messages +// +package cnat + +import ( + "strconv" + + api "git.fd.io/govpp.git/api" + _ "git.fd.io/govpp.git/binapi/fib_types" + 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 = "cnat" + APIVersion = "0.2.0" + VersionCrc = 0xfd05573b +) + +// CnatEndpointTupleFlags defines enum 'cnat_endpoint_tuple_flags'. +type CnatEndpointTupleFlags uint8 + +const ( + CNAT_EPT_NO_NAT CnatEndpointTupleFlags = 1 +) + +var ( + CnatEndpointTupleFlags_name = map[uint8]string{ + 1: "CNAT_EPT_NO_NAT", + } + CnatEndpointTupleFlags_value = map[string]uint8{ + "CNAT_EPT_NO_NAT": 1, + } +) + +func (x CnatEndpointTupleFlags) String() string { + s, ok := CnatEndpointTupleFlags_name[uint8(x)] + if ok { + return s + } + str := func(n uint8) string { + s, ok := CnatEndpointTupleFlags_name[uint8(n)] + if ok { + return s + } + return "CnatEndpointTupleFlags(" + strconv.Itoa(int(n)) + ")" + } + for i := uint8(0); i <= 8; i++ { + val := uint8(x) + if val&(1<<i) != 0 { + if s != "" { + s += "|" + } + s += str(1 << i) + } + } + if s == "" { + return str(uint8(x)) + } + return s +} + +// CnatLbType defines enum 'cnat_lb_type'. +type CnatLbType uint8 + +const ( + CNAT_LB_TYPE_DEFAULT CnatLbType = 0 + CNAT_LB_TYPE_MAGLEV CnatLbType = 1 +) + +var ( + CnatLbType_name = map[uint8]string{ + 0: "CNAT_LB_TYPE_DEFAULT", + 1: "CNAT_LB_TYPE_MAGLEV", + } + CnatLbType_value = map[string]uint8{ + "CNAT_LB_TYPE_DEFAULT": 0, + "CNAT_LB_TYPE_MAGLEV": 1, + } +) + +func (x CnatLbType) String() string { + s, ok := CnatLbType_name[uint8(x)] + if ok { + return s + } + return "CnatLbType(" + strconv.Itoa(int(x)) + ")" +} + +// CnatSnatPolicies defines enum 'cnat_snat_policies'. +type CnatSnatPolicies uint8 + +const ( + CNAT_POLICY_NONE CnatSnatPolicies = 0 + CNAT_POLICY_IF_PFX CnatSnatPolicies = 1 + CNAT_POLICY_K8S CnatSnatPolicies = 2 +) + +var ( + CnatSnatPolicies_name = map[uint8]string{ + 0: "CNAT_POLICY_NONE", + 1: "CNAT_POLICY_IF_PFX", + 2: "CNAT_POLICY_K8S", + } + CnatSnatPolicies_value = map[string]uint8{ + "CNAT_POLICY_NONE": 0, + "CNAT_POLICY_IF_PFX": 1, + "CNAT_POLICY_K8S": 2, + } +) + +func (x CnatSnatPolicies) String() string { + s, ok := CnatSnatPolicies_name[uint8(x)] + if ok { + return s + } + return "CnatSnatPolicies(" + strconv.Itoa(int(x)) + ")" +} + +// CnatSnatPolicyTable defines enum 'cnat_snat_policy_table'. +type CnatSnatPolicyTable uint8 + +const ( + CNAT_POLICY_INCLUDE_V4 CnatSnatPolicyTable = 0 + CNAT_POLICY_INCLUDE_V6 CnatSnatPolicyTable = 1 + CNAT_POLICY_POD CnatSnatPolicyTable = 2 +) + +var ( + CnatSnatPolicyTable_name = map[uint8]string{ + 0: "CNAT_POLICY_INCLUDE_V4", + 1: "CNAT_POLICY_INCLUDE_V6", + 2: "CNAT_POLICY_POD", + } + CnatSnatPolicyTable_value = map[string]uint8{ + "CNAT_POLICY_INCLUDE_V4": 0, + "CNAT_POLICY_INCLUDE_V6": 1, + "CNAT_POLICY_POD": 2, + } +) + +func (x CnatSnatPolicyTable) String() string { + s, ok := CnatSnatPolicyTable_name[uint8(x)] + if ok { + return s + } + return "CnatSnatPolicyTable(" + strconv.Itoa(int(x)) + ")" +} + +// CnatTranslationFlags defines enum 'cnat_translation_flags'. +type CnatTranslationFlags uint8 + +const ( + CNAT_TRANSLATION_ALLOC_PORT CnatTranslationFlags = 1 +) + +var ( + CnatTranslationFlags_name = map[uint8]string{ + 1: "CNAT_TRANSLATION_ALLOC_PORT", + } + CnatTranslationFlags_value = map[string]uint8{ + "CNAT_TRANSLATION_ALLOC_PORT": 1, + } +) + +func (x CnatTranslationFlags) String() string { + s, ok := CnatTranslationFlags_name[uint8(x)] + if ok { + return s + } + str := func(n uint8) string { + s, ok := CnatTranslationFlags_name[uint8(n)] + if ok { + return s + } + return "CnatTranslationFlags(" + strconv.Itoa(int(n)) + ")" + } + for i := uint8(0); i <= 8; i++ { + val := uint8(x) + if val&(1<<i) != 0 { + if s != "" { + s += "|" + } + s += str(1 << i) + } + } + if s == "" { + return str(uint8(x)) + } + return s +} + +// CnatEndpoint defines type 'cnat_endpoint'. +type CnatEndpoint struct { + Addr ip_types.Address `binapi:"address,name=addr" json:"addr,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IfAf ip_types.AddressFamily `binapi:"address_family,name=if_af" json:"if_af,omitempty"` + Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` +} + +// CnatEndpointTuple defines type 'cnat_endpoint_tuple'. +type CnatEndpointTuple struct { + DstEp CnatEndpoint `binapi:"cnat_endpoint,name=dst_ep" json:"dst_ep,omitempty"` + SrcEp CnatEndpoint `binapi:"cnat_endpoint,name=src_ep" json:"src_ep,omitempty"` + Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` +} + +// CnatSession defines type 'cnat_session'. +type CnatSession struct { + Src CnatEndpoint `binapi:"cnat_endpoint,name=src" json:"src,omitempty"` + Dst CnatEndpoint `binapi:"cnat_endpoint,name=dst" json:"dst,omitempty"` + New CnatEndpoint `binapi:"cnat_endpoint,name=new" json:"new,omitempty"` + IPProto ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"` + Location uint8 `binapi:"u8,name=location" json:"location,omitempty"` + Timestamp float64 `binapi:"f64,name=timestamp" json:"timestamp,omitempty"` +} + +// CnatTranslation defines type 'cnat_translation'. +type CnatTranslation struct { + Vip CnatEndpoint `binapi:"cnat_endpoint,name=vip" json:"vip,omitempty"` + ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` + IPProto ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"` + IsRealIP uint8 `binapi:"u8,name=is_real_ip" json:"is_real_ip,omitempty"` + Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` + LbType CnatLbType `binapi:"cnat_lb_type,name=lb_type" json:"lb_type,omitempty"` + NPaths uint32 `binapi:"u32,name=n_paths" json:"-"` + Paths []CnatEndpointTuple `binapi:"cnat_endpoint_tuple[n_paths],name=paths" json:"paths,omitempty"` +} + +// CnatGetSnatAddresses defines message 'cnat_get_snat_addresses'. +// InProgress: the message form may change in the future versions +type CnatGetSnatAddresses struct{} + +func (m *CnatGetSnatAddresses) Reset() { *m = CnatGetSnatAddresses{} } +func (*CnatGetSnatAddresses) GetMessageName() string { return "cnat_get_snat_addresses" } +func (*CnatGetSnatAddresses) GetCrcString() string { return "51077d14" } +func (*CnatGetSnatAddresses) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatGetSnatAddresses) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *CnatGetSnatAddresses) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *CnatGetSnatAddresses) Unmarshal(b []byte) error { + return nil +} + +// CnatGetSnatAddressesReply defines message 'cnat_get_snat_addresses_reply'. +// InProgress: the message form may change in the future versions +type CnatGetSnatAddressesReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` + SnatIP4 ip_types.IP4Address `binapi:"ip4_address,name=snat_ip4" json:"snat_ip4,omitempty"` + SnatIP6 ip_types.IP6Address `binapi:"ip6_address,name=snat_ip6" json:"snat_ip6,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *CnatGetSnatAddressesReply) Reset() { *m = CnatGetSnatAddressesReply{} } +func (*CnatGetSnatAddressesReply) GetMessageName() string { return "cnat_get_snat_addresses_reply" } +func (*CnatGetSnatAddressesReply) GetCrcString() string { return "879513c1" } +func (*CnatGetSnatAddressesReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatGetSnatAddressesReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.ID + size += 1 * 4 // m.SnatIP4 + size += 1 * 16 // m.SnatIP6 + size += 4 // m.SwIfIndex + return size +} +func (m *CnatGetSnatAddressesReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ID) + buf.EncodeBytes(m.SnatIP4[:], 4) + buf.EncodeBytes(m.SnatIP6[:], 16) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *CnatGetSnatAddressesReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.ID = buf.DecodeUint32() + copy(m.SnatIP4[:], buf.DecodeBytes(4)) + copy(m.SnatIP6[:], buf.DecodeBytes(16)) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// CnatSessionDetails defines message 'cnat_session_details'. +// InProgress: the message form may change in the future versions +type CnatSessionDetails struct { + Session CnatSession `binapi:"cnat_session,name=session" json:"session,omitempty"` +} + +func (m *CnatSessionDetails) Reset() { *m = CnatSessionDetails{} } +func (*CnatSessionDetails) GetMessageName() string { return "cnat_session_details" } +func (*CnatSessionDetails) GetCrcString() string { return "7e5017c7" } +func (*CnatSessionDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSessionDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Session.Src.Addr.Af + size += 1 * 16 // m.Session.Src.Addr.Un + size += 4 // m.Session.Src.SwIfIndex + size += 1 // m.Session.Src.IfAf + size += 2 // m.Session.Src.Port + size += 1 // m.Session.Dst.Addr.Af + size += 1 * 16 // m.Session.Dst.Addr.Un + size += 4 // m.Session.Dst.SwIfIndex + size += 1 // m.Session.Dst.IfAf + size += 2 // m.Session.Dst.Port + size += 1 // m.Session.New.Addr.Af + size += 1 * 16 // m.Session.New.Addr.Un + size += 4 // m.Session.New.SwIfIndex + size += 1 // m.Session.New.IfAf + size += 2 // m.Session.New.Port + size += 1 // m.Session.IPProto + size += 1 // m.Session.Location + size += 8 // m.Session.Timestamp + return size +} +func (m *CnatSessionDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Session.Src.Addr.Af)) + buf.EncodeBytes(m.Session.Src.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Session.Src.SwIfIndex)) + buf.EncodeUint8(uint8(m.Session.Src.IfAf)) + buf.EncodeUint16(m.Session.Src.Port) + buf.EncodeUint8(uint8(m.Session.Dst.Addr.Af)) + buf.EncodeBytes(m.Session.Dst.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Session.Dst.SwIfIndex)) + buf.EncodeUint8(uint8(m.Session.Dst.IfAf)) + buf.EncodeUint16(m.Session.Dst.Port) + buf.EncodeUint8(uint8(m.Session.New.Addr.Af)) + buf.EncodeBytes(m.Session.New.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Session.New.SwIfIndex)) + buf.EncodeUint8(uint8(m.Session.New.IfAf)) + buf.EncodeUint16(m.Session.New.Port) + buf.EncodeUint8(uint8(m.Session.IPProto)) + buf.EncodeUint8(m.Session.Location) + buf.EncodeFloat64(m.Session.Timestamp) + return buf.Bytes(), nil +} +func (m *CnatSessionDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Session.Src.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Session.Src.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Session.Src.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Session.Src.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Session.Src.Port = buf.DecodeUint16() + m.Session.Dst.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Session.Dst.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Session.Dst.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Session.Dst.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Session.Dst.Port = buf.DecodeUint16() + m.Session.New.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Session.New.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Session.New.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Session.New.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Session.New.Port = buf.DecodeUint16() + m.Session.IPProto = ip_types.IPProto(buf.DecodeUint8()) + m.Session.Location = buf.DecodeUint8() + m.Session.Timestamp = buf.DecodeFloat64() + return nil +} + +// CnatSessionDump defines message 'cnat_session_dump'. +// InProgress: the message form may change in the future versions +type CnatSessionDump struct{} + +func (m *CnatSessionDump) Reset() { *m = CnatSessionDump{} } +func (*CnatSessionDump) GetMessageName() string { return "cnat_session_dump" } +func (*CnatSessionDump) GetCrcString() string { return "51077d14" } +func (*CnatSessionDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSessionDump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *CnatSessionDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *CnatSessionDump) Unmarshal(b []byte) error { + return nil +} + +// CnatSessionPurge defines message 'cnat_session_purge'. +// InProgress: the message form may change in the future versions +type CnatSessionPurge struct{} + +func (m *CnatSessionPurge) Reset() { *m = CnatSessionPurge{} } +func (*CnatSessionPurge) GetMessageName() string { return "cnat_session_purge" } +func (*CnatSessionPurge) GetCrcString() string { return "51077d14" } +func (*CnatSessionPurge) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSessionPurge) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *CnatSessionPurge) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *CnatSessionPurge) Unmarshal(b []byte) error { + return nil +} + +// CnatSessionPurgeReply defines message 'cnat_session_purge_reply'. +// InProgress: the message form may change in the future versions +type CnatSessionPurgeReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *CnatSessionPurgeReply) Reset() { *m = CnatSessionPurgeReply{} } +func (*CnatSessionPurgeReply) GetMessageName() string { return "cnat_session_purge_reply" } +func (*CnatSessionPurgeReply) GetCrcString() string { return "e8d4e804" } +func (*CnatSessionPurgeReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSessionPurgeReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *CnatSessionPurgeReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *CnatSessionPurgeReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// CnatSetSnatAddresses defines message 'cnat_set_snat_addresses'. +// InProgress: the message form may change in the future versions +type CnatSetSnatAddresses struct { + SnatIP4 ip_types.IP4Address `binapi:"ip4_address,name=snat_ip4" json:"snat_ip4,omitempty"` + SnatIP6 ip_types.IP6Address `binapi:"ip6_address,name=snat_ip6" json:"snat_ip6,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *CnatSetSnatAddresses) Reset() { *m = CnatSetSnatAddresses{} } +func (*CnatSetSnatAddresses) GetMessageName() string { return "cnat_set_snat_addresses" } +func (*CnatSetSnatAddresses) GetCrcString() string { return "d997e96c" } +func (*CnatSetSnatAddresses) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSetSnatAddresses) Size() (size int) { + if m == nil { + return 0 + } + size += 1 * 4 // m.SnatIP4 + size += 1 * 16 // m.SnatIP6 + size += 4 // m.SwIfIndex + return size +} +func (m *CnatSetSnatAddresses) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBytes(m.SnatIP4[:], 4) + buf.EncodeBytes(m.SnatIP6[:], 16) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *CnatSetSnatAddresses) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + copy(m.SnatIP4[:], buf.DecodeBytes(4)) + copy(m.SnatIP6[:], buf.DecodeBytes(16)) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// CnatSetSnatAddressesReply defines message 'cnat_set_snat_addresses_reply'. +// InProgress: the message form may change in the future versions +type CnatSetSnatAddressesReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *CnatSetSnatAddressesReply) Reset() { *m = CnatSetSnatAddressesReply{} } +func (*CnatSetSnatAddressesReply) GetMessageName() string { return "cnat_set_snat_addresses_reply" } +func (*CnatSetSnatAddressesReply) GetCrcString() string { return "e8d4e804" } +func (*CnatSetSnatAddressesReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSetSnatAddressesReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *CnatSetSnatAddressesReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *CnatSetSnatAddressesReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// CnatSetSnatPolicy defines message 'cnat_set_snat_policy'. +// InProgress: the message form may change in the future versions +type CnatSetSnatPolicy struct { + Policy CnatSnatPolicies `binapi:"cnat_snat_policies,name=policy" json:"policy,omitempty"` +} + +func (m *CnatSetSnatPolicy) Reset() { *m = CnatSetSnatPolicy{} } +func (*CnatSetSnatPolicy) GetMessageName() string { return "cnat_set_snat_policy" } +func (*CnatSetSnatPolicy) GetCrcString() string { return "d3e6eaf4" } +func (*CnatSetSnatPolicy) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSetSnatPolicy) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Policy + return size +} +func (m *CnatSetSnatPolicy) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Policy)) + return buf.Bytes(), nil +} +func (m *CnatSetSnatPolicy) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Policy = CnatSnatPolicies(buf.DecodeUint8()) + return nil +} + +// CnatSetSnatPolicyReply defines message 'cnat_set_snat_policy_reply'. +// InProgress: the message form may change in the future versions +type CnatSetSnatPolicyReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *CnatSetSnatPolicyReply) Reset() { *m = CnatSetSnatPolicyReply{} } +func (*CnatSetSnatPolicyReply) GetMessageName() string { return "cnat_set_snat_policy_reply" } +func (*CnatSetSnatPolicyReply) GetCrcString() string { return "e8d4e804" } +func (*CnatSetSnatPolicyReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSetSnatPolicyReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *CnatSetSnatPolicyReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *CnatSetSnatPolicyReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// CnatSnatPolicyAddDelExcludePfx defines message 'cnat_snat_policy_add_del_exclude_pfx'. +// InProgress: the message form may change in the future versions +type CnatSnatPolicyAddDelExcludePfx struct { + IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` + Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` +} + +func (m *CnatSnatPolicyAddDelExcludePfx) Reset() { *m = CnatSnatPolicyAddDelExcludePfx{} } +func (*CnatSnatPolicyAddDelExcludePfx) GetMessageName() string { + return "cnat_snat_policy_add_del_exclude_pfx" +} +func (*CnatSnatPolicyAddDelExcludePfx) GetCrcString() string { return "e26dd79a" } +func (*CnatSnatPolicyAddDelExcludePfx) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSnatPolicyAddDelExcludePfx) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.IsAdd + size += 1 // m.Prefix.Address.Af + size += 1 * 16 // m.Prefix.Address.Un + size += 1 // m.Prefix.Len + return size +} +func (m *CnatSnatPolicyAddDelExcludePfx) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(m.IsAdd) + buf.EncodeUint8(uint8(m.Prefix.Address.Af)) + buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Prefix.Len) + return buf.Bytes(), nil +} +func (m *CnatSnatPolicyAddDelExcludePfx) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsAdd = buf.DecodeUint8() + m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Prefix.Len = buf.DecodeUint8() + return nil +} + +// CnatSnatPolicyAddDelExcludePfxReply defines message 'cnat_snat_policy_add_del_exclude_pfx_reply'. +// InProgress: the message form may change in the future versions +type CnatSnatPolicyAddDelExcludePfxReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *CnatSnatPolicyAddDelExcludePfxReply) Reset() { *m = CnatSnatPolicyAddDelExcludePfxReply{} } +func (*CnatSnatPolicyAddDelExcludePfxReply) GetMessageName() string { + return "cnat_snat_policy_add_del_exclude_pfx_reply" +} +func (*CnatSnatPolicyAddDelExcludePfxReply) GetCrcString() string { return "e8d4e804" } +func (*CnatSnatPolicyAddDelExcludePfxReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSnatPolicyAddDelExcludePfxReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *CnatSnatPolicyAddDelExcludePfxReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *CnatSnatPolicyAddDelExcludePfxReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// CnatSnatPolicyAddDelIf defines message 'cnat_snat_policy_add_del_if'. +// InProgress: the message form may change in the future versions +type CnatSnatPolicyAddDelIf struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` + Table CnatSnatPolicyTable `binapi:"cnat_snat_policy_table,name=table" json:"table,omitempty"` +} + +func (m *CnatSnatPolicyAddDelIf) Reset() { *m = CnatSnatPolicyAddDelIf{} } +func (*CnatSnatPolicyAddDelIf) GetMessageName() string { return "cnat_snat_policy_add_del_if" } +func (*CnatSnatPolicyAddDelIf) GetCrcString() string { return "6828deca" } +func (*CnatSnatPolicyAddDelIf) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSnatPolicyAddDelIf) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.IsAdd + size += 1 // m.Table + return size +} +func (m *CnatSnatPolicyAddDelIf) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint8(m.IsAdd) + buf.EncodeUint8(uint8(m.Table)) + return buf.Bytes(), nil +} +func (m *CnatSnatPolicyAddDelIf) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsAdd = buf.DecodeUint8() + m.Table = CnatSnatPolicyTable(buf.DecodeUint8()) + return nil +} + +// CnatSnatPolicyAddDelIfReply defines message 'cnat_snat_policy_add_del_if_reply'. +// InProgress: the message form may change in the future versions +type CnatSnatPolicyAddDelIfReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *CnatSnatPolicyAddDelIfReply) Reset() { *m = CnatSnatPolicyAddDelIfReply{} } +func (*CnatSnatPolicyAddDelIfReply) GetMessageName() string { + return "cnat_snat_policy_add_del_if_reply" +} +func (*CnatSnatPolicyAddDelIfReply) GetCrcString() string { return "e8d4e804" } +func (*CnatSnatPolicyAddDelIfReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSnatPolicyAddDelIfReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *CnatSnatPolicyAddDelIfReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *CnatSnatPolicyAddDelIfReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// CnatTranslationDel defines message 'cnat_translation_del'. +// InProgress: the message form may change in the future versions +type CnatTranslationDel struct { + ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` +} + +func (m *CnatTranslationDel) Reset() { *m = CnatTranslationDel{} } +func (*CnatTranslationDel) GetMessageName() string { return "cnat_translation_del" } +func (*CnatTranslationDel) GetCrcString() string { return "3a91bde5" } +func (*CnatTranslationDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatTranslationDel) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.ID + return size +} +func (m *CnatTranslationDel) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.ID) + return buf.Bytes(), nil +} +func (m *CnatTranslationDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.ID = buf.DecodeUint32() + return nil +} + +// CnatTranslationDelReply defines message 'cnat_translation_del_reply'. +// InProgress: the message form may change in the future versions +type CnatTranslationDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *CnatTranslationDelReply) Reset() { *m = CnatTranslationDelReply{} } +func (*CnatTranslationDelReply) GetMessageName() string { return "cnat_translation_del_reply" } +func (*CnatTranslationDelReply) GetCrcString() string { return "e8d4e804" } +func (*CnatTranslationDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatTranslationDelReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *CnatTranslationDelReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *CnatTranslationDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// CnatTranslationDetails defines message 'cnat_translation_details'. +// InProgress: the message form may change in the future versions +type CnatTranslationDetails struct { + Translation CnatTranslation `binapi:"cnat_translation,name=translation" json:"translation,omitempty"` +} + +func (m *CnatTranslationDetails) Reset() { *m = CnatTranslationDetails{} } +func (*CnatTranslationDetails) GetMessageName() string { return "cnat_translation_details" } +func (*CnatTranslationDetails) GetCrcString() string { return "347e1f16" } +func (*CnatTranslationDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatTranslationDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Translation.Vip.Addr.Af + size += 1 * 16 // m.Translation.Vip.Addr.Un + size += 4 // m.Translation.Vip.SwIfIndex + size += 1 // m.Translation.Vip.IfAf + size += 2 // m.Translation.Vip.Port + size += 4 // m.Translation.ID + size += 1 // m.Translation.IPProto + size += 1 // m.Translation.IsRealIP + size += 1 // m.Translation.Flags + size += 1 // m.Translation.LbType + size += 4 // m.Translation.NPaths + for j2 := 0; j2 < len(m.Translation.Paths); j2++ { + var s2 CnatEndpointTuple + _ = s2 + if j2 < len(m.Translation.Paths) { + s2 = m.Translation.Paths[j2] + } + size += 1 // s2.DstEp.Addr.Af + size += 1 * 16 // s2.DstEp.Addr.Un + size += 4 // s2.DstEp.SwIfIndex + size += 1 // s2.DstEp.IfAf + size += 2 // s2.DstEp.Port + size += 1 // s2.SrcEp.Addr.Af + size += 1 * 16 // s2.SrcEp.Addr.Un + size += 4 // s2.SrcEp.SwIfIndex + size += 1 // s2.SrcEp.IfAf + size += 2 // s2.SrcEp.Port + size += 1 // s2.Flags + } + return size +} +func (m *CnatTranslationDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Translation.Vip.Addr.Af)) + buf.EncodeBytes(m.Translation.Vip.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Translation.Vip.SwIfIndex)) + buf.EncodeUint8(uint8(m.Translation.Vip.IfAf)) + buf.EncodeUint16(m.Translation.Vip.Port) + buf.EncodeUint32(m.Translation.ID) + buf.EncodeUint8(uint8(m.Translation.IPProto)) + buf.EncodeUint8(m.Translation.IsRealIP) + buf.EncodeUint8(m.Translation.Flags) + buf.EncodeUint8(uint8(m.Translation.LbType)) + buf.EncodeUint32(uint32(len(m.Translation.Paths))) + for j1 := 0; j1 < len(m.Translation.Paths); j1++ { + var v1 CnatEndpointTuple // Paths + if j1 < len(m.Translation.Paths) { + v1 = m.Translation.Paths[j1] + } + buf.EncodeUint8(uint8(v1.DstEp.Addr.Af)) + buf.EncodeBytes(v1.DstEp.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(v1.DstEp.SwIfIndex)) + buf.EncodeUint8(uint8(v1.DstEp.IfAf)) + buf.EncodeUint16(v1.DstEp.Port) + buf.EncodeUint8(uint8(v1.SrcEp.Addr.Af)) + buf.EncodeBytes(v1.SrcEp.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(v1.SrcEp.SwIfIndex)) + buf.EncodeUint8(uint8(v1.SrcEp.IfAf)) + buf.EncodeUint16(v1.SrcEp.Port) + buf.EncodeUint8(v1.Flags) + } + return buf.Bytes(), nil +} +func (m *CnatTranslationDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Translation.Vip.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Translation.Vip.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Translation.Vip.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Translation.Vip.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Translation.Vip.Port = buf.DecodeUint16() + m.Translation.ID = buf.DecodeUint32() + m.Translation.IPProto = ip_types.IPProto(buf.DecodeUint8()) + m.Translation.IsRealIP = buf.DecodeUint8() + m.Translation.Flags = buf.DecodeUint8() + m.Translation.LbType = CnatLbType(buf.DecodeUint8()) + m.Translation.NPaths = buf.DecodeUint32() + m.Translation.Paths = make([]CnatEndpointTuple, m.Translation.NPaths) + for j1 := 0; j1 < len(m.Translation.Paths); j1++ { + m.Translation.Paths[j1].DstEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Translation.Paths[j1].DstEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Translation.Paths[j1].DstEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Translation.Paths[j1].DstEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Translation.Paths[j1].DstEp.Port = buf.DecodeUint16() + m.Translation.Paths[j1].SrcEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Translation.Paths[j1].SrcEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Translation.Paths[j1].SrcEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Translation.Paths[j1].SrcEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Translation.Paths[j1].SrcEp.Port = buf.DecodeUint16() + m.Translation.Paths[j1].Flags = buf.DecodeUint8() + } + return nil +} + +// CnatTranslationDump defines message 'cnat_translation_dump'. +// InProgress: the message form may change in the future versions +type CnatTranslationDump struct{} + +func (m *CnatTranslationDump) Reset() { *m = CnatTranslationDump{} } +func (*CnatTranslationDump) GetMessageName() string { return "cnat_translation_dump" } +func (*CnatTranslationDump) GetCrcString() string { return "51077d14" } +func (*CnatTranslationDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatTranslationDump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *CnatTranslationDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *CnatTranslationDump) Unmarshal(b []byte) error { + return nil +} + +// CnatTranslationUpdate defines message 'cnat_translation_update'. +// InProgress: the message form may change in the future versions +type CnatTranslationUpdate struct { + Translation CnatTranslation `binapi:"cnat_translation,name=translation" json:"translation,omitempty"` +} + +func (m *CnatTranslationUpdate) Reset() { *m = CnatTranslationUpdate{} } +func (*CnatTranslationUpdate) GetMessageName() string { return "cnat_translation_update" } +func (*CnatTranslationUpdate) GetCrcString() string { return "cd5aedf5" } +func (*CnatTranslationUpdate) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatTranslationUpdate) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Translation.Vip.Addr.Af + size += 1 * 16 // m.Translation.Vip.Addr.Un + size += 4 // m.Translation.Vip.SwIfIndex + size += 1 // m.Translation.Vip.IfAf + size += 2 // m.Translation.Vip.Port + size += 4 // m.Translation.ID + size += 1 // m.Translation.IPProto + size += 1 // m.Translation.IsRealIP + size += 1 // m.Translation.Flags + size += 1 // m.Translation.LbType + size += 4 // m.Translation.NPaths + for j2 := 0; j2 < len(m.Translation.Paths); j2++ { + var s2 CnatEndpointTuple + _ = s2 + if j2 < len(m.Translation.Paths) { + s2 = m.Translation.Paths[j2] + } + size += 1 // s2.DstEp.Addr.Af + size += 1 * 16 // s2.DstEp.Addr.Un + size += 4 // s2.DstEp.SwIfIndex + size += 1 // s2.DstEp.IfAf + size += 2 // s2.DstEp.Port + size += 1 // s2.SrcEp.Addr.Af + size += 1 * 16 // s2.SrcEp.Addr.Un + size += 4 // s2.SrcEp.SwIfIndex + size += 1 // s2.SrcEp.IfAf + size += 2 // s2.SrcEp.Port + size += 1 // s2.Flags + } + return size +} +func (m *CnatTranslationUpdate) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Translation.Vip.Addr.Af)) + buf.EncodeBytes(m.Translation.Vip.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Translation.Vip.SwIfIndex)) + buf.EncodeUint8(uint8(m.Translation.Vip.IfAf)) + buf.EncodeUint16(m.Translation.Vip.Port) + buf.EncodeUint32(m.Translation.ID) + buf.EncodeUint8(uint8(m.Translation.IPProto)) + buf.EncodeUint8(m.Translation.IsRealIP) + buf.EncodeUint8(m.Translation.Flags) + buf.EncodeUint8(uint8(m.Translation.LbType)) + buf.EncodeUint32(uint32(len(m.Translation.Paths))) + for j1 := 0; j1 < len(m.Translation.Paths); j1++ { + var v1 CnatEndpointTuple // Paths + if j1 < len(m.Translation.Paths) { + v1 = m.Translation.Paths[j1] + } + buf.EncodeUint8(uint8(v1.DstEp.Addr.Af)) + buf.EncodeBytes(v1.DstEp.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(v1.DstEp.SwIfIndex)) + buf.EncodeUint8(uint8(v1.DstEp.IfAf)) + buf.EncodeUint16(v1.DstEp.Port) + buf.EncodeUint8(uint8(v1.SrcEp.Addr.Af)) + buf.EncodeBytes(v1.SrcEp.Addr.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(v1.SrcEp.SwIfIndex)) + buf.EncodeUint8(uint8(v1.SrcEp.IfAf)) + buf.EncodeUint16(v1.SrcEp.Port) + buf.EncodeUint8(v1.Flags) + } + return buf.Bytes(), nil +} +func (m *CnatTranslationUpdate) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Translation.Vip.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Translation.Vip.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Translation.Vip.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Translation.Vip.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Translation.Vip.Port = buf.DecodeUint16() + m.Translation.ID = buf.DecodeUint32() + m.Translation.IPProto = ip_types.IPProto(buf.DecodeUint8()) + m.Translation.IsRealIP = buf.DecodeUint8() + m.Translation.Flags = buf.DecodeUint8() + m.Translation.LbType = CnatLbType(buf.DecodeUint8()) + m.Translation.NPaths = buf.DecodeUint32() + m.Translation.Paths = make([]CnatEndpointTuple, m.Translation.NPaths) + for j1 := 0; j1 < len(m.Translation.Paths); j1++ { + m.Translation.Paths[j1].DstEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Translation.Paths[j1].DstEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Translation.Paths[j1].DstEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Translation.Paths[j1].DstEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Translation.Paths[j1].DstEp.Port = buf.DecodeUint16() + m.Translation.Paths[j1].SrcEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Translation.Paths[j1].SrcEp.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Translation.Paths[j1].SrcEp.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Translation.Paths[j1].SrcEp.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) + m.Translation.Paths[j1].SrcEp.Port = buf.DecodeUint16() + m.Translation.Paths[j1].Flags = buf.DecodeUint8() + } + return nil +} + +// CnatTranslationUpdateReply defines message 'cnat_translation_update_reply'. +// InProgress: the message form may change in the future versions +type CnatTranslationUpdateReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` +} + +func (m *CnatTranslationUpdateReply) Reset() { *m = CnatTranslationUpdateReply{} } +func (*CnatTranslationUpdateReply) GetMessageName() string { return "cnat_translation_update_reply" } +func (*CnatTranslationUpdateReply) GetCrcString() string { return "e2fc8294" } +func (*CnatTranslationUpdateReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatTranslationUpdateReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.ID + return size +} +func (m *CnatTranslationUpdateReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ID) + return buf.Bytes(), nil +} +func (m *CnatTranslationUpdateReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.ID = buf.DecodeUint32() + return nil +} + +func init() { file_cnat_binapi_init() } +func file_cnat_binapi_init() { + api.RegisterMessage((*CnatGetSnatAddresses)(nil), "cnat_get_snat_addresses_51077d14") + api.RegisterMessage((*CnatGetSnatAddressesReply)(nil), "cnat_get_snat_addresses_reply_879513c1") + api.RegisterMessage((*CnatSessionDetails)(nil), "cnat_session_details_7e5017c7") + api.RegisterMessage((*CnatSessionDump)(nil), "cnat_session_dump_51077d14") + api.RegisterMessage((*CnatSessionPurge)(nil), "cnat_session_purge_51077d14") + api.RegisterMessage((*CnatSessionPurgeReply)(nil), "cnat_session_purge_reply_e8d4e804") + api.RegisterMessage((*CnatSetSnatAddresses)(nil), "cnat_set_snat_addresses_d997e96c") + api.RegisterMessage((*CnatSetSnatAddressesReply)(nil), "cnat_set_snat_addresses_reply_e8d4e804") + api.RegisterMessage((*CnatSetSnatPolicy)(nil), "cnat_set_snat_policy_d3e6eaf4") + api.RegisterMessage((*CnatSetSnatPolicyReply)(nil), "cnat_set_snat_policy_reply_e8d4e804") + api.RegisterMessage((*CnatSnatPolicyAddDelExcludePfx)(nil), "cnat_snat_policy_add_del_exclude_pfx_e26dd79a") + api.RegisterMessage((*CnatSnatPolicyAddDelExcludePfxReply)(nil), "cnat_snat_policy_add_del_exclude_pfx_reply_e8d4e804") + api.RegisterMessage((*CnatSnatPolicyAddDelIf)(nil), "cnat_snat_policy_add_del_if_6828deca") + api.RegisterMessage((*CnatSnatPolicyAddDelIfReply)(nil), "cnat_snat_policy_add_del_if_reply_e8d4e804") + api.RegisterMessage((*CnatTranslationDel)(nil), "cnat_translation_del_3a91bde5") + api.RegisterMessage((*CnatTranslationDelReply)(nil), "cnat_translation_del_reply_e8d4e804") + api.RegisterMessage((*CnatTranslationDetails)(nil), "cnat_translation_details_347e1f16") + api.RegisterMessage((*CnatTranslationDump)(nil), "cnat_translation_dump_51077d14") + api.RegisterMessage((*CnatTranslationUpdate)(nil), "cnat_translation_update_cd5aedf5") + api.RegisterMessage((*CnatTranslationUpdateReply)(nil), "cnat_translation_update_reply_e2fc8294") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*CnatGetSnatAddresses)(nil), + (*CnatGetSnatAddressesReply)(nil), + (*CnatSessionDetails)(nil), + (*CnatSessionDump)(nil), + (*CnatSessionPurge)(nil), + (*CnatSessionPurgeReply)(nil), + (*CnatSetSnatAddresses)(nil), + (*CnatSetSnatAddressesReply)(nil), + (*CnatSetSnatPolicy)(nil), + (*CnatSetSnatPolicyReply)(nil), + (*CnatSnatPolicyAddDelExcludePfx)(nil), + (*CnatSnatPolicyAddDelExcludePfxReply)(nil), + (*CnatSnatPolicyAddDelIf)(nil), + (*CnatSnatPolicyAddDelIfReply)(nil), + (*CnatTranslationDel)(nil), + (*CnatTranslationDelReply)(nil), + (*CnatTranslationDetails)(nil), + (*CnatTranslationDump)(nil), + (*CnatTranslationUpdate)(nil), + (*CnatTranslationUpdateReply)(nil), + } +} |