github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/tcp/tcp.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: core/tcp.api.json 6 7 // Package tcp contains generated bindings for API file tcp.api. 8 // 9 // Contents: 10 // - 2 messages 11 package tcp 12 13 import ( 14 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 15 api "go.fd.io/govpp/api" 16 codec "go.fd.io/govpp/codec" 17 ) 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the GoVPP api package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // GoVPP api package needs to be updated. 23 const _ = api.GoVppAPIPackageIsVersion2 24 25 const ( 26 APIFile = "tcp" 27 APIVersion = "2.0.0" 28 VersionCrc = 0x93d07485 29 ) 30 31 // Configure TCP source addresses, for active-open TCP sessions 32 // 33 // TCP src/dst ports are 16 bits, with the low-order 1024 ports 34 // reserved. So, it's necessary to provide a considerable number of 35 // source IP addresses if one wishes to initiate a large number of 36 // connections. 37 // Each of those addresses needs to have a receive adjacency - 38 // either a /32 or a /128 - and vpp needs to answer (proxy) arps or 39 // neighbor discovery requests for the addresses. 40 // - is_ipv6 - 1 for ipv6, 0 for ipv4 41 // - vrf_id - fib table / vrf id for local adjacencies 42 // - first_address - first address that TCP will use 43 // - last_address - last address that TCP will use 44 // 45 // TCPConfigureSrcAddresses defines message 'tcp_configure_src_addresses'. 46 type TCPConfigureSrcAddresses struct { 47 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 48 FirstAddress ip_types.Address `binapi:"address,name=first_address" json:"first_address,omitempty"` 49 LastAddress ip_types.Address `binapi:"address,name=last_address" json:"last_address,omitempty"` 50 } 51 52 func (m *TCPConfigureSrcAddresses) Reset() { *m = TCPConfigureSrcAddresses{} } 53 func (*TCPConfigureSrcAddresses) GetMessageName() string { return "tcp_configure_src_addresses" } 54 func (*TCPConfigureSrcAddresses) GetCrcString() string { return "67eede0d" } 55 func (*TCPConfigureSrcAddresses) GetMessageType() api.MessageType { 56 return api.RequestMessage 57 } 58 59 func (m *TCPConfigureSrcAddresses) Size() (size int) { 60 if m == nil { 61 return 0 62 } 63 size += 4 // m.VrfID 64 size += 1 // m.FirstAddress.Af 65 size += 1 * 16 // m.FirstAddress.Un 66 size += 1 // m.LastAddress.Af 67 size += 1 * 16 // m.LastAddress.Un 68 return size 69 } 70 func (m *TCPConfigureSrcAddresses) Marshal(b []byte) ([]byte, error) { 71 if b == nil { 72 b = make([]byte, m.Size()) 73 } 74 buf := codec.NewBuffer(b) 75 buf.EncodeUint32(m.VrfID) 76 buf.EncodeUint8(uint8(m.FirstAddress.Af)) 77 buf.EncodeBytes(m.FirstAddress.Un.XXX_UnionData[:], 16) 78 buf.EncodeUint8(uint8(m.LastAddress.Af)) 79 buf.EncodeBytes(m.LastAddress.Un.XXX_UnionData[:], 16) 80 return buf.Bytes(), nil 81 } 82 func (m *TCPConfigureSrcAddresses) Unmarshal(b []byte) error { 83 buf := codec.NewBuffer(b) 84 m.VrfID = buf.DecodeUint32() 85 m.FirstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 86 copy(m.FirstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 87 m.LastAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 88 copy(m.LastAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 89 return nil 90 } 91 92 // TCPConfigureSrcAddressesReply defines message 'tcp_configure_src_addresses_reply'. 93 type TCPConfigureSrcAddressesReply struct { 94 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 95 } 96 97 func (m *TCPConfigureSrcAddressesReply) Reset() { *m = TCPConfigureSrcAddressesReply{} } 98 func (*TCPConfigureSrcAddressesReply) GetMessageName() string { 99 return "tcp_configure_src_addresses_reply" 100 } 101 func (*TCPConfigureSrcAddressesReply) GetCrcString() string { return "e8d4e804" } 102 func (*TCPConfigureSrcAddressesReply) GetMessageType() api.MessageType { 103 return api.ReplyMessage 104 } 105 106 func (m *TCPConfigureSrcAddressesReply) Size() (size int) { 107 if m == nil { 108 return 0 109 } 110 size += 4 // m.Retval 111 return size 112 } 113 func (m *TCPConfigureSrcAddressesReply) Marshal(b []byte) ([]byte, error) { 114 if b == nil { 115 b = make([]byte, m.Size()) 116 } 117 buf := codec.NewBuffer(b) 118 buf.EncodeInt32(m.Retval) 119 return buf.Bytes(), nil 120 } 121 func (m *TCPConfigureSrcAddressesReply) Unmarshal(b []byte) error { 122 buf := codec.NewBuffer(b) 123 m.Retval = buf.DecodeInt32() 124 return nil 125 } 126 127 func init() { file_tcp_binapi_init() } 128 func file_tcp_binapi_init() { 129 api.RegisterMessage((*TCPConfigureSrcAddresses)(nil), "tcp_configure_src_addresses_67eede0d") 130 api.RegisterMessage((*TCPConfigureSrcAddressesReply)(nil), "tcp_configure_src_addresses_reply_e8d4e804") 131 } 132 133 // Messages returns list of all messages in this module. 134 func AllMessages() []api.Message { 135 return []api.Message{ 136 (*TCPConfigureSrcAddresses)(nil), 137 (*TCPConfigureSrcAddressesReply)(nil), 138 } 139 }