github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/trace/trace.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/trace.api.json
     6  
     7  // Package trace contains generated bindings for API file trace.api.
     8  //
     9  // Contents:
    10  // -  6 messages
    11  package trace
    12  
    13  import (
    14  	api "go.fd.io/govpp/api"
    15  	codec "go.fd.io/govpp/codec"
    16  )
    17  
    18  // This is a compile-time assertion to ensure that this generated file
    19  // is compatible with the GoVPP api package it is being compiled against.
    20  // A compilation error at this line likely means your copy of the
    21  // GoVPP api package needs to be updated.
    22  const _ = api.GoVppAPIPackageIsVersion2
    23  
    24  const (
    25  	APIFile    = "trace"
    26  	APIVersion = "1.0.0"
    27  	VersionCrc = 0x397cbf90
    28  )
    29  
    30  // iOAM6 Trace - Set the iOAM6 trace profile
    31  //   - trace_type - Type of trace requested
    32  //   - num_elts - Number of trace elements to be inserted
    33  //   - node_id - Trace Node ID
    34  //   - trace_tsp- Timestamp resolution
    35  //   - app_data - Application specific opaque
    36  //
    37  // TraceProfileAdd defines message 'trace_profile_add'.
    38  type TraceProfileAdd struct {
    39  	TraceType uint8  `binapi:"u8,name=trace_type" json:"trace_type,omitempty"`
    40  	NumElts   uint8  `binapi:"u8,name=num_elts" json:"num_elts,omitempty"`
    41  	TraceTsp  uint8  `binapi:"u8,name=trace_tsp" json:"trace_tsp,omitempty"`
    42  	NodeID    uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
    43  	AppData   uint32 `binapi:"u32,name=app_data" json:"app_data,omitempty"`
    44  }
    45  
    46  func (m *TraceProfileAdd) Reset()               { *m = TraceProfileAdd{} }
    47  func (*TraceProfileAdd) GetMessageName() string { return "trace_profile_add" }
    48  func (*TraceProfileAdd) GetCrcString() string   { return "de08aa6d" }
    49  func (*TraceProfileAdd) GetMessageType() api.MessageType {
    50  	return api.RequestMessage
    51  }
    52  
    53  func (m *TraceProfileAdd) Size() (size int) {
    54  	if m == nil {
    55  		return 0
    56  	}
    57  	size += 1 // m.TraceType
    58  	size += 1 // m.NumElts
    59  	size += 1 // m.TraceTsp
    60  	size += 4 // m.NodeID
    61  	size += 4 // m.AppData
    62  	return size
    63  }
    64  func (m *TraceProfileAdd) Marshal(b []byte) ([]byte, error) {
    65  	if b == nil {
    66  		b = make([]byte, m.Size())
    67  	}
    68  	buf := codec.NewBuffer(b)
    69  	buf.EncodeUint8(m.TraceType)
    70  	buf.EncodeUint8(m.NumElts)
    71  	buf.EncodeUint8(m.TraceTsp)
    72  	buf.EncodeUint32(m.NodeID)
    73  	buf.EncodeUint32(m.AppData)
    74  	return buf.Bytes(), nil
    75  }
    76  func (m *TraceProfileAdd) Unmarshal(b []byte) error {
    77  	buf := codec.NewBuffer(b)
    78  	m.TraceType = buf.DecodeUint8()
    79  	m.NumElts = buf.DecodeUint8()
    80  	m.TraceTsp = buf.DecodeUint8()
    81  	m.NodeID = buf.DecodeUint32()
    82  	m.AppData = buf.DecodeUint32()
    83  	return nil
    84  }
    85  
    86  // TraceProfileAddReply defines message 'trace_profile_add_reply'.
    87  type TraceProfileAddReply struct {
    88  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    89  }
    90  
    91  func (m *TraceProfileAddReply) Reset()               { *m = TraceProfileAddReply{} }
    92  func (*TraceProfileAddReply) GetMessageName() string { return "trace_profile_add_reply" }
    93  func (*TraceProfileAddReply) GetCrcString() string   { return "e8d4e804" }
    94  func (*TraceProfileAddReply) GetMessageType() api.MessageType {
    95  	return api.ReplyMessage
    96  }
    97  
    98  func (m *TraceProfileAddReply) Size() (size int) {
    99  	if m == nil {
   100  		return 0
   101  	}
   102  	size += 4 // m.Retval
   103  	return size
   104  }
   105  func (m *TraceProfileAddReply) Marshal(b []byte) ([]byte, error) {
   106  	if b == nil {
   107  		b = make([]byte, m.Size())
   108  	}
   109  	buf := codec.NewBuffer(b)
   110  	buf.EncodeInt32(m.Retval)
   111  	return buf.Bytes(), nil
   112  }
   113  func (m *TraceProfileAddReply) Unmarshal(b []byte) error {
   114  	buf := codec.NewBuffer(b)
   115  	m.Retval = buf.DecodeInt32()
   116  	return nil
   117  }
   118  
   119  // Delete trace Profile
   120  // TraceProfileDel defines message 'trace_profile_del'.
   121  type TraceProfileDel struct{}
   122  
   123  func (m *TraceProfileDel) Reset()               { *m = TraceProfileDel{} }
   124  func (*TraceProfileDel) GetMessageName() string { return "trace_profile_del" }
   125  func (*TraceProfileDel) GetCrcString() string   { return "51077d14" }
   126  func (*TraceProfileDel) GetMessageType() api.MessageType {
   127  	return api.RequestMessage
   128  }
   129  
   130  func (m *TraceProfileDel) Size() (size int) {
   131  	if m == nil {
   132  		return 0
   133  	}
   134  	return size
   135  }
   136  func (m *TraceProfileDel) Marshal(b []byte) ([]byte, error) {
   137  	if b == nil {
   138  		b = make([]byte, m.Size())
   139  	}
   140  	buf := codec.NewBuffer(b)
   141  	return buf.Bytes(), nil
   142  }
   143  func (m *TraceProfileDel) Unmarshal(b []byte) error {
   144  	return nil
   145  }
   146  
   147  // TraceProfileDelReply defines message 'trace_profile_del_reply'.
   148  type TraceProfileDelReply struct {
   149  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   150  }
   151  
   152  func (m *TraceProfileDelReply) Reset()               { *m = TraceProfileDelReply{} }
   153  func (*TraceProfileDelReply) GetMessageName() string { return "trace_profile_del_reply" }
   154  func (*TraceProfileDelReply) GetCrcString() string   { return "e8d4e804" }
   155  func (*TraceProfileDelReply) GetMessageType() api.MessageType {
   156  	return api.ReplyMessage
   157  }
   158  
   159  func (m *TraceProfileDelReply) Size() (size int) {
   160  	if m == nil {
   161  		return 0
   162  	}
   163  	size += 4 // m.Retval
   164  	return size
   165  }
   166  func (m *TraceProfileDelReply) Marshal(b []byte) ([]byte, error) {
   167  	if b == nil {
   168  		b = make([]byte, m.Size())
   169  	}
   170  	buf := codec.NewBuffer(b)
   171  	buf.EncodeInt32(m.Retval)
   172  	return buf.Bytes(), nil
   173  }
   174  func (m *TraceProfileDelReply) Unmarshal(b []byte) error {
   175  	buf := codec.NewBuffer(b)
   176  	m.Retval = buf.DecodeInt32()
   177  	return nil
   178  }
   179  
   180  // Show trace Profile
   181  // TraceProfileShowConfig defines message 'trace_profile_show_config'.
   182  type TraceProfileShowConfig struct{}
   183  
   184  func (m *TraceProfileShowConfig) Reset()               { *m = TraceProfileShowConfig{} }
   185  func (*TraceProfileShowConfig) GetMessageName() string { return "trace_profile_show_config" }
   186  func (*TraceProfileShowConfig) GetCrcString() string   { return "51077d14" }
   187  func (*TraceProfileShowConfig) GetMessageType() api.MessageType {
   188  	return api.RequestMessage
   189  }
   190  
   191  func (m *TraceProfileShowConfig) Size() (size int) {
   192  	if m == nil {
   193  		return 0
   194  	}
   195  	return size
   196  }
   197  func (m *TraceProfileShowConfig) Marshal(b []byte) ([]byte, error) {
   198  	if b == nil {
   199  		b = make([]byte, m.Size())
   200  	}
   201  	buf := codec.NewBuffer(b)
   202  	return buf.Bytes(), nil
   203  }
   204  func (m *TraceProfileShowConfig) Unmarshal(b []byte) error {
   205  	return nil
   206  }
   207  
   208  // Show trace config response
   209  //   - retval - return value for request
   210  //   - trace_type - Type of trace requested
   211  //   - num_elts - Number of trace elements to be inserted
   212  //   - node_id - Trace Node ID
   213  //   - trace_tsp- Timestamp resolution
   214  //   - app_data - Application specific opaque
   215  //
   216  // TraceProfileShowConfigReply defines message 'trace_profile_show_config_reply'.
   217  type TraceProfileShowConfigReply struct {
   218  	Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   219  	TraceType uint8  `binapi:"u8,name=trace_type" json:"trace_type,omitempty"`
   220  	NumElts   uint8  `binapi:"u8,name=num_elts" json:"num_elts,omitempty"`
   221  	TraceTsp  uint8  `binapi:"u8,name=trace_tsp" json:"trace_tsp,omitempty"`
   222  	NodeID    uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
   223  	AppData   uint32 `binapi:"u32,name=app_data" json:"app_data,omitempty"`
   224  }
   225  
   226  func (m *TraceProfileShowConfigReply) Reset()               { *m = TraceProfileShowConfigReply{} }
   227  func (*TraceProfileShowConfigReply) GetMessageName() string { return "trace_profile_show_config_reply" }
   228  func (*TraceProfileShowConfigReply) GetCrcString() string   { return "0f1d374c" }
   229  func (*TraceProfileShowConfigReply) GetMessageType() api.MessageType {
   230  	return api.ReplyMessage
   231  }
   232  
   233  func (m *TraceProfileShowConfigReply) Size() (size int) {
   234  	if m == nil {
   235  		return 0
   236  	}
   237  	size += 4 // m.Retval
   238  	size += 1 // m.TraceType
   239  	size += 1 // m.NumElts
   240  	size += 1 // m.TraceTsp
   241  	size += 4 // m.NodeID
   242  	size += 4 // m.AppData
   243  	return size
   244  }
   245  func (m *TraceProfileShowConfigReply) Marshal(b []byte) ([]byte, error) {
   246  	if b == nil {
   247  		b = make([]byte, m.Size())
   248  	}
   249  	buf := codec.NewBuffer(b)
   250  	buf.EncodeInt32(m.Retval)
   251  	buf.EncodeUint8(m.TraceType)
   252  	buf.EncodeUint8(m.NumElts)
   253  	buf.EncodeUint8(m.TraceTsp)
   254  	buf.EncodeUint32(m.NodeID)
   255  	buf.EncodeUint32(m.AppData)
   256  	return buf.Bytes(), nil
   257  }
   258  func (m *TraceProfileShowConfigReply) Unmarshal(b []byte) error {
   259  	buf := codec.NewBuffer(b)
   260  	m.Retval = buf.DecodeInt32()
   261  	m.TraceType = buf.DecodeUint8()
   262  	m.NumElts = buf.DecodeUint8()
   263  	m.TraceTsp = buf.DecodeUint8()
   264  	m.NodeID = buf.DecodeUint32()
   265  	m.AppData = buf.DecodeUint32()
   266  	return nil
   267  }
   268  
   269  func init() { file_trace_binapi_init() }
   270  func file_trace_binapi_init() {
   271  	api.RegisterMessage((*TraceProfileAdd)(nil), "trace_profile_add_de08aa6d")
   272  	api.RegisterMessage((*TraceProfileAddReply)(nil), "trace_profile_add_reply_e8d4e804")
   273  	api.RegisterMessage((*TraceProfileDel)(nil), "trace_profile_del_51077d14")
   274  	api.RegisterMessage((*TraceProfileDelReply)(nil), "trace_profile_del_reply_e8d4e804")
   275  	api.RegisterMessage((*TraceProfileShowConfig)(nil), "trace_profile_show_config_51077d14")
   276  	api.RegisterMessage((*TraceProfileShowConfigReply)(nil), "trace_profile_show_config_reply_0f1d374c")
   277  }
   278  
   279  // Messages returns list of all messages in this module.
   280  func AllMessages() []api.Message {
   281  	return []api.Message{
   282  		(*TraceProfileAdd)(nil),
   283  		(*TraceProfileAddReply)(nil),
   284  		(*TraceProfileDel)(nil),
   285  		(*TraceProfileDelReply)(nil),
   286  		(*TraceProfileShowConfig)(nil),
   287  		(*TraceProfileShowConfigReply)(nil),
   288  	}
   289  }