github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/nsim/nsim.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: plugins/nsim.api.json 6 7 // Package nsim contains generated bindings for API file nsim.api. 8 // 9 // Contents: 10 // - 8 messages 11 package nsim 12 13 import ( 14 interface_types "github.com/networkservicemesh/govpp/binapi/interface_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 = "nsim" 27 APIVersion = "2.2.1" 28 VersionCrc = 0x3b179b8f 29 ) 30 31 // configure the network delay simulation cross-connect 32 // - delay_in_usec - microseconds of link delay to simulate 33 // - average_packet_size - average packet size for wheel sizing 34 // - bandwidth_in_bits_per_second - bps for wheel sizing 35 // 36 // NsimConfigure defines message 'nsim_configure'. 37 // Deprecated: the message will be removed in the future versions 38 type NsimConfigure struct { 39 DelayInUsec uint32 `binapi:"u32,name=delay_in_usec" json:"delay_in_usec,omitempty"` 40 AveragePacketSize uint32 `binapi:"u32,name=average_packet_size" json:"average_packet_size,omitempty"` 41 BandwidthInBitsPerSecond uint64 `binapi:"u64,name=bandwidth_in_bits_per_second" json:"bandwidth_in_bits_per_second,omitempty"` 42 PacketsPerDrop uint32 `binapi:"u32,name=packets_per_drop" json:"packets_per_drop,omitempty"` 43 } 44 45 func (m *NsimConfigure) Reset() { *m = NsimConfigure{} } 46 func (*NsimConfigure) GetMessageName() string { return "nsim_configure" } 47 func (*NsimConfigure) GetCrcString() string { return "16ed400f" } 48 func (*NsimConfigure) GetMessageType() api.MessageType { 49 return api.RequestMessage 50 } 51 52 func (m *NsimConfigure) Size() (size int) { 53 if m == nil { 54 return 0 55 } 56 size += 4 // m.DelayInUsec 57 size += 4 // m.AveragePacketSize 58 size += 8 // m.BandwidthInBitsPerSecond 59 size += 4 // m.PacketsPerDrop 60 return size 61 } 62 func (m *NsimConfigure) Marshal(b []byte) ([]byte, error) { 63 if b == nil { 64 b = make([]byte, m.Size()) 65 } 66 buf := codec.NewBuffer(b) 67 buf.EncodeUint32(m.DelayInUsec) 68 buf.EncodeUint32(m.AveragePacketSize) 69 buf.EncodeUint64(m.BandwidthInBitsPerSecond) 70 buf.EncodeUint32(m.PacketsPerDrop) 71 return buf.Bytes(), nil 72 } 73 func (m *NsimConfigure) Unmarshal(b []byte) error { 74 buf := codec.NewBuffer(b) 75 m.DelayInUsec = buf.DecodeUint32() 76 m.AveragePacketSize = buf.DecodeUint32() 77 m.BandwidthInBitsPerSecond = buf.DecodeUint64() 78 m.PacketsPerDrop = buf.DecodeUint32() 79 return nil 80 } 81 82 // configure the network delay simulation cross-connect 83 // - delay_in_usec - microseconds of link delay to simulate 84 // - average_packet_size - average packet size for wheel sizing 85 // - bandwidth_in_bits_per_second - bps for wheel sizing 86 // 87 // NsimConfigure2 defines message 'nsim_configure2'. 88 type NsimConfigure2 struct { 89 DelayInUsec uint32 `binapi:"u32,name=delay_in_usec" json:"delay_in_usec,omitempty"` 90 AveragePacketSize uint32 `binapi:"u32,name=average_packet_size" json:"average_packet_size,omitempty"` 91 BandwidthInBitsPerSecond uint64 `binapi:"u64,name=bandwidth_in_bits_per_second" json:"bandwidth_in_bits_per_second,omitempty"` 92 PacketsPerDrop uint32 `binapi:"u32,name=packets_per_drop" json:"packets_per_drop,omitempty"` 93 PacketsPerReorder uint32 `binapi:"u32,name=packets_per_reorder" json:"packets_per_reorder,omitempty"` 94 } 95 96 func (m *NsimConfigure2) Reset() { *m = NsimConfigure2{} } 97 func (*NsimConfigure2) GetMessageName() string { return "nsim_configure2" } 98 func (*NsimConfigure2) GetCrcString() string { return "64de8ed3" } 99 func (*NsimConfigure2) GetMessageType() api.MessageType { 100 return api.RequestMessage 101 } 102 103 func (m *NsimConfigure2) Size() (size int) { 104 if m == nil { 105 return 0 106 } 107 size += 4 // m.DelayInUsec 108 size += 4 // m.AveragePacketSize 109 size += 8 // m.BandwidthInBitsPerSecond 110 size += 4 // m.PacketsPerDrop 111 size += 4 // m.PacketsPerReorder 112 return size 113 } 114 func (m *NsimConfigure2) Marshal(b []byte) ([]byte, error) { 115 if b == nil { 116 b = make([]byte, m.Size()) 117 } 118 buf := codec.NewBuffer(b) 119 buf.EncodeUint32(m.DelayInUsec) 120 buf.EncodeUint32(m.AveragePacketSize) 121 buf.EncodeUint64(m.BandwidthInBitsPerSecond) 122 buf.EncodeUint32(m.PacketsPerDrop) 123 buf.EncodeUint32(m.PacketsPerReorder) 124 return buf.Bytes(), nil 125 } 126 func (m *NsimConfigure2) Unmarshal(b []byte) error { 127 buf := codec.NewBuffer(b) 128 m.DelayInUsec = buf.DecodeUint32() 129 m.AveragePacketSize = buf.DecodeUint32() 130 m.BandwidthInBitsPerSecond = buf.DecodeUint64() 131 m.PacketsPerDrop = buf.DecodeUint32() 132 m.PacketsPerReorder = buf.DecodeUint32() 133 return nil 134 } 135 136 // NsimConfigure2Reply defines message 'nsim_configure2_reply'. 137 type NsimConfigure2Reply struct { 138 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 139 } 140 141 func (m *NsimConfigure2Reply) Reset() { *m = NsimConfigure2Reply{} } 142 func (*NsimConfigure2Reply) GetMessageName() string { return "nsim_configure2_reply" } 143 func (*NsimConfigure2Reply) GetCrcString() string { return "e8d4e804" } 144 func (*NsimConfigure2Reply) GetMessageType() api.MessageType { 145 return api.ReplyMessage 146 } 147 148 func (m *NsimConfigure2Reply) Size() (size int) { 149 if m == nil { 150 return 0 151 } 152 size += 4 // m.Retval 153 return size 154 } 155 func (m *NsimConfigure2Reply) Marshal(b []byte) ([]byte, error) { 156 if b == nil { 157 b = make([]byte, m.Size()) 158 } 159 buf := codec.NewBuffer(b) 160 buf.EncodeInt32(m.Retval) 161 return buf.Bytes(), nil 162 } 163 func (m *NsimConfigure2Reply) Unmarshal(b []byte) error { 164 buf := codec.NewBuffer(b) 165 m.Retval = buf.DecodeInt32() 166 return nil 167 } 168 169 // NsimConfigureReply defines message 'nsim_configure_reply'. 170 // Deprecated: the message will be removed in the future versions 171 type NsimConfigureReply struct { 172 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 173 } 174 175 func (m *NsimConfigureReply) Reset() { *m = NsimConfigureReply{} } 176 func (*NsimConfigureReply) GetMessageName() string { return "nsim_configure_reply" } 177 func (*NsimConfigureReply) GetCrcString() string { return "e8d4e804" } 178 func (*NsimConfigureReply) GetMessageType() api.MessageType { 179 return api.ReplyMessage 180 } 181 182 func (m *NsimConfigureReply) Size() (size int) { 183 if m == nil { 184 return 0 185 } 186 size += 4 // m.Retval 187 return size 188 } 189 func (m *NsimConfigureReply) Marshal(b []byte) ([]byte, error) { 190 if b == nil { 191 b = make([]byte, m.Size()) 192 } 193 buf := codec.NewBuffer(b) 194 buf.EncodeInt32(m.Retval) 195 return buf.Bytes(), nil 196 } 197 func (m *NsimConfigureReply) Unmarshal(b []byte) error { 198 buf := codec.NewBuffer(b) 199 m.Retval = buf.DecodeInt32() 200 return nil 201 } 202 203 // enable / disable the network delay simulation cross-connect 204 // - enable_disable - enable or disable the feature 205 // - sw_if_index0 - one interface to cross-connect 206 // - sw_if_index1 - the other interface to cross-connect 207 // 208 // NsimCrossConnectEnableDisable defines message 'nsim_cross_connect_enable_disable'. 209 type NsimCrossConnectEnableDisable struct { 210 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` 211 SwIfIndex0 interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index0" json:"sw_if_index0,omitempty"` 212 SwIfIndex1 interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index1" json:"sw_if_index1,omitempty"` 213 } 214 215 func (m *NsimCrossConnectEnableDisable) Reset() { *m = NsimCrossConnectEnableDisable{} } 216 func (*NsimCrossConnectEnableDisable) GetMessageName() string { 217 return "nsim_cross_connect_enable_disable" 218 } 219 func (*NsimCrossConnectEnableDisable) GetCrcString() string { return "9c3ead86" } 220 func (*NsimCrossConnectEnableDisable) GetMessageType() api.MessageType { 221 return api.RequestMessage 222 } 223 224 func (m *NsimCrossConnectEnableDisable) Size() (size int) { 225 if m == nil { 226 return 0 227 } 228 size += 1 // m.EnableDisable 229 size += 4 // m.SwIfIndex0 230 size += 4 // m.SwIfIndex1 231 return size 232 } 233 func (m *NsimCrossConnectEnableDisable) Marshal(b []byte) ([]byte, error) { 234 if b == nil { 235 b = make([]byte, m.Size()) 236 } 237 buf := codec.NewBuffer(b) 238 buf.EncodeBool(m.EnableDisable) 239 buf.EncodeUint32(uint32(m.SwIfIndex0)) 240 buf.EncodeUint32(uint32(m.SwIfIndex1)) 241 return buf.Bytes(), nil 242 } 243 func (m *NsimCrossConnectEnableDisable) Unmarshal(b []byte) error { 244 buf := codec.NewBuffer(b) 245 m.EnableDisable = buf.DecodeBool() 246 m.SwIfIndex0 = interface_types.InterfaceIndex(buf.DecodeUint32()) 247 m.SwIfIndex1 = interface_types.InterfaceIndex(buf.DecodeUint32()) 248 return nil 249 } 250 251 // NsimCrossConnectEnableDisableReply defines message 'nsim_cross_connect_enable_disable_reply'. 252 type NsimCrossConnectEnableDisableReply struct { 253 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 254 } 255 256 func (m *NsimCrossConnectEnableDisableReply) Reset() { *m = NsimCrossConnectEnableDisableReply{} } 257 func (*NsimCrossConnectEnableDisableReply) GetMessageName() string { 258 return "nsim_cross_connect_enable_disable_reply" 259 } 260 func (*NsimCrossConnectEnableDisableReply) GetCrcString() string { return "e8d4e804" } 261 func (*NsimCrossConnectEnableDisableReply) GetMessageType() api.MessageType { 262 return api.ReplyMessage 263 } 264 265 func (m *NsimCrossConnectEnableDisableReply) Size() (size int) { 266 if m == nil { 267 return 0 268 } 269 size += 4 // m.Retval 270 return size 271 } 272 func (m *NsimCrossConnectEnableDisableReply) Marshal(b []byte) ([]byte, error) { 273 if b == nil { 274 b = make([]byte, m.Size()) 275 } 276 buf := codec.NewBuffer(b) 277 buf.EncodeInt32(m.Retval) 278 return buf.Bytes(), nil 279 } 280 func (m *NsimCrossConnectEnableDisableReply) Unmarshal(b []byte) error { 281 buf := codec.NewBuffer(b) 282 m.Retval = buf.DecodeInt32() 283 return nil 284 } 285 286 // enable / disable the network delay simulation output feature 287 // - enable_disable - enable or disable the feature 288 // - sw_if_index0 - interface 289 // 290 // NsimOutputFeatureEnableDisable defines message 'nsim_output_feature_enable_disable'. 291 type NsimOutputFeatureEnableDisable struct { 292 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` 293 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 294 } 295 296 func (m *NsimOutputFeatureEnableDisable) Reset() { *m = NsimOutputFeatureEnableDisable{} } 297 func (*NsimOutputFeatureEnableDisable) GetMessageName() string { 298 return "nsim_output_feature_enable_disable" 299 } 300 func (*NsimOutputFeatureEnableDisable) GetCrcString() string { return "3865946c" } 301 func (*NsimOutputFeatureEnableDisable) GetMessageType() api.MessageType { 302 return api.RequestMessage 303 } 304 305 func (m *NsimOutputFeatureEnableDisable) Size() (size int) { 306 if m == nil { 307 return 0 308 } 309 size += 1 // m.EnableDisable 310 size += 4 // m.SwIfIndex 311 return size 312 } 313 func (m *NsimOutputFeatureEnableDisable) Marshal(b []byte) ([]byte, error) { 314 if b == nil { 315 b = make([]byte, m.Size()) 316 } 317 buf := codec.NewBuffer(b) 318 buf.EncodeBool(m.EnableDisable) 319 buf.EncodeUint32(uint32(m.SwIfIndex)) 320 return buf.Bytes(), nil 321 } 322 func (m *NsimOutputFeatureEnableDisable) Unmarshal(b []byte) error { 323 buf := codec.NewBuffer(b) 324 m.EnableDisable = buf.DecodeBool() 325 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 326 return nil 327 } 328 329 // NsimOutputFeatureEnableDisableReply defines message 'nsim_output_feature_enable_disable_reply'. 330 type NsimOutputFeatureEnableDisableReply struct { 331 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 332 } 333 334 func (m *NsimOutputFeatureEnableDisableReply) Reset() { *m = NsimOutputFeatureEnableDisableReply{} } 335 func (*NsimOutputFeatureEnableDisableReply) GetMessageName() string { 336 return "nsim_output_feature_enable_disable_reply" 337 } 338 func (*NsimOutputFeatureEnableDisableReply) GetCrcString() string { return "e8d4e804" } 339 func (*NsimOutputFeatureEnableDisableReply) GetMessageType() api.MessageType { 340 return api.ReplyMessage 341 } 342 343 func (m *NsimOutputFeatureEnableDisableReply) Size() (size int) { 344 if m == nil { 345 return 0 346 } 347 size += 4 // m.Retval 348 return size 349 } 350 func (m *NsimOutputFeatureEnableDisableReply) Marshal(b []byte) ([]byte, error) { 351 if b == nil { 352 b = make([]byte, m.Size()) 353 } 354 buf := codec.NewBuffer(b) 355 buf.EncodeInt32(m.Retval) 356 return buf.Bytes(), nil 357 } 358 func (m *NsimOutputFeatureEnableDisableReply) Unmarshal(b []byte) error { 359 buf := codec.NewBuffer(b) 360 m.Retval = buf.DecodeInt32() 361 return nil 362 } 363 364 func init() { file_nsim_binapi_init() } 365 func file_nsim_binapi_init() { 366 api.RegisterMessage((*NsimConfigure)(nil), "nsim_configure_16ed400f") 367 api.RegisterMessage((*NsimConfigure2)(nil), "nsim_configure2_64de8ed3") 368 api.RegisterMessage((*NsimConfigure2Reply)(nil), "nsim_configure2_reply_e8d4e804") 369 api.RegisterMessage((*NsimConfigureReply)(nil), "nsim_configure_reply_e8d4e804") 370 api.RegisterMessage((*NsimCrossConnectEnableDisable)(nil), "nsim_cross_connect_enable_disable_9c3ead86") 371 api.RegisterMessage((*NsimCrossConnectEnableDisableReply)(nil), "nsim_cross_connect_enable_disable_reply_e8d4e804") 372 api.RegisterMessage((*NsimOutputFeatureEnableDisable)(nil), "nsim_output_feature_enable_disable_3865946c") 373 api.RegisterMessage((*NsimOutputFeatureEnableDisableReply)(nil), "nsim_output_feature_enable_disable_reply_e8d4e804") 374 } 375 376 // Messages returns list of all messages in this module. 377 func AllMessages() []api.Message { 378 return []api.Message{ 379 (*NsimConfigure)(nil), 380 (*NsimConfigure2)(nil), 381 (*NsimConfigure2Reply)(nil), 382 (*NsimConfigureReply)(nil), 383 (*NsimCrossConnectEnableDisable)(nil), 384 (*NsimCrossConnectEnableDisableReply)(nil), 385 (*NsimOutputFeatureEnableDisable)(nil), 386 (*NsimOutputFeatureEnableDisableReply)(nil), 387 } 388 }