github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/nsim/nsim.ba.go (about)

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