github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/vpe/vpe.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/vpe.api.json
     6  
     7  // Package vpe contains generated bindings for API file vpe.api.
     8  //
     9  // Contents:
    10  // -  6 messages
    11  package vpe
    12  
    13  import (
    14  	vpe_types "github.com/networkservicemesh/govpp/binapi/vpe_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    = "vpe"
    27  	APIVersion = "1.7.0"
    28  	VersionCrc = 0xbbfa7484
    29  )
    30  
    31  // LogDetails defines message 'log_details'.
    32  type LogDetails struct {
    33  	Timestamp vpe_types.Timestamp `binapi:"timestamp,name=timestamp" json:"timestamp,omitempty"`
    34  	Level     vpe_types.LogLevel  `binapi:"log_level,name=level" json:"level,omitempty"`
    35  	MsgClass  string              `binapi:"string[32],name=msg_class" json:"msg_class,omitempty"`
    36  	Message   string              `binapi:"string[256],name=message" json:"message,omitempty"`
    37  }
    38  
    39  func (m *LogDetails) Reset()               { *m = LogDetails{} }
    40  func (*LogDetails) GetMessageName() string { return "log_details" }
    41  func (*LogDetails) GetCrcString() string   { return "03d61cc0" }
    42  func (*LogDetails) GetMessageType() api.MessageType {
    43  	return api.ReplyMessage
    44  }
    45  
    46  func (m *LogDetails) Size() (size int) {
    47  	if m == nil {
    48  		return 0
    49  	}
    50  	size += 8   // m.Timestamp
    51  	size += 4   // m.Level
    52  	size += 32  // m.MsgClass
    53  	size += 256 // m.Message
    54  	return size
    55  }
    56  func (m *LogDetails) Marshal(b []byte) ([]byte, error) {
    57  	if b == nil {
    58  		b = make([]byte, m.Size())
    59  	}
    60  	buf := codec.NewBuffer(b)
    61  	buf.EncodeFloat64(float64(m.Timestamp))
    62  	buf.EncodeUint32(uint32(m.Level))
    63  	buf.EncodeString(m.MsgClass, 32)
    64  	buf.EncodeString(m.Message, 256)
    65  	return buf.Bytes(), nil
    66  }
    67  func (m *LogDetails) Unmarshal(b []byte) error {
    68  	buf := codec.NewBuffer(b)
    69  	m.Timestamp = vpe_types.Timestamp(buf.DecodeFloat64())
    70  	m.Level = vpe_types.LogLevel(buf.DecodeUint32())
    71  	m.MsgClass = buf.DecodeString(32)
    72  	m.Message = buf.DecodeString(256)
    73  	return nil
    74  }
    75  
    76  // LogDump defines message 'log_dump'.
    77  type LogDump struct {
    78  	StartTimestamp vpe_types.Timestamp `binapi:"timestamp,name=start_timestamp" json:"start_timestamp,omitempty"`
    79  }
    80  
    81  func (m *LogDump) Reset()               { *m = LogDump{} }
    82  func (*LogDump) GetMessageName() string { return "log_dump" }
    83  func (*LogDump) GetCrcString() string   { return "6ab31753" }
    84  func (*LogDump) GetMessageType() api.MessageType {
    85  	return api.RequestMessage
    86  }
    87  
    88  func (m *LogDump) Size() (size int) {
    89  	if m == nil {
    90  		return 0
    91  	}
    92  	size += 8 // m.StartTimestamp
    93  	return size
    94  }
    95  func (m *LogDump) Marshal(b []byte) ([]byte, error) {
    96  	if b == nil {
    97  		b = make([]byte, m.Size())
    98  	}
    99  	buf := codec.NewBuffer(b)
   100  	buf.EncodeFloat64(float64(m.StartTimestamp))
   101  	return buf.Bytes(), nil
   102  }
   103  func (m *LogDump) Unmarshal(b []byte) error {
   104  	buf := codec.NewBuffer(b)
   105  	m.StartTimestamp = vpe_types.Timestamp(buf.DecodeFloat64())
   106  	return nil
   107  }
   108  
   109  // show version
   110  // ShowVersion defines message 'show_version'.
   111  type ShowVersion struct{}
   112  
   113  func (m *ShowVersion) Reset()               { *m = ShowVersion{} }
   114  func (*ShowVersion) GetMessageName() string { return "show_version" }
   115  func (*ShowVersion) GetCrcString() string   { return "51077d14" }
   116  func (*ShowVersion) GetMessageType() api.MessageType {
   117  	return api.RequestMessage
   118  }
   119  
   120  func (m *ShowVersion) Size() (size int) {
   121  	if m == nil {
   122  		return 0
   123  	}
   124  	return size
   125  }
   126  func (m *ShowVersion) Marshal(b []byte) ([]byte, error) {
   127  	if b == nil {
   128  		b = make([]byte, m.Size())
   129  	}
   130  	buf := codec.NewBuffer(b)
   131  	return buf.Bytes(), nil
   132  }
   133  func (m *ShowVersion) Unmarshal(b []byte) error {
   134  	return nil
   135  }
   136  
   137  // show version response
   138  //   - retval - return code for the request
   139  //   - program - name of the program (vpe)
   140  //   - version  - version of the program
   141  //   - build_directory - root of the workspace where the program was built
   142  //
   143  // ShowVersionReply defines message 'show_version_reply'.
   144  type ShowVersionReply struct {
   145  	Retval         int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   146  	Program        string `binapi:"string[32],name=program" json:"program,omitempty"`
   147  	Version        string `binapi:"string[32],name=version" json:"version,omitempty"`
   148  	BuildDate      string `binapi:"string[32],name=build_date" json:"build_date,omitempty"`
   149  	BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty"`
   150  }
   151  
   152  func (m *ShowVersionReply) Reset()               { *m = ShowVersionReply{} }
   153  func (*ShowVersionReply) GetMessageName() string { return "show_version_reply" }
   154  func (*ShowVersionReply) GetCrcString() string   { return "c919bde1" }
   155  func (*ShowVersionReply) GetMessageType() api.MessageType {
   156  	return api.ReplyMessage
   157  }
   158  
   159  func (m *ShowVersionReply) Size() (size int) {
   160  	if m == nil {
   161  		return 0
   162  	}
   163  	size += 4   // m.Retval
   164  	size += 32  // m.Program
   165  	size += 32  // m.Version
   166  	size += 32  // m.BuildDate
   167  	size += 256 // m.BuildDirectory
   168  	return size
   169  }
   170  func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) {
   171  	if b == nil {
   172  		b = make([]byte, m.Size())
   173  	}
   174  	buf := codec.NewBuffer(b)
   175  	buf.EncodeInt32(m.Retval)
   176  	buf.EncodeString(m.Program, 32)
   177  	buf.EncodeString(m.Version, 32)
   178  	buf.EncodeString(m.BuildDate, 32)
   179  	buf.EncodeString(m.BuildDirectory, 256)
   180  	return buf.Bytes(), nil
   181  }
   182  func (m *ShowVersionReply) Unmarshal(b []byte) error {
   183  	buf := codec.NewBuffer(b)
   184  	m.Retval = buf.DecodeInt32()
   185  	m.Program = buf.DecodeString(32)
   186  	m.Version = buf.DecodeString(32)
   187  	m.BuildDate = buf.DecodeString(32)
   188  	m.BuildDirectory = buf.DecodeString(256)
   189  	return nil
   190  }
   191  
   192  // Show the current system timestamp.
   193  // ShowVpeSystemTime defines message 'show_vpe_system_time'.
   194  type ShowVpeSystemTime struct{}
   195  
   196  func (m *ShowVpeSystemTime) Reset()               { *m = ShowVpeSystemTime{} }
   197  func (*ShowVpeSystemTime) GetMessageName() string { return "show_vpe_system_time" }
   198  func (*ShowVpeSystemTime) GetCrcString() string   { return "51077d14" }
   199  func (*ShowVpeSystemTime) GetMessageType() api.MessageType {
   200  	return api.RequestMessage
   201  }
   202  
   203  func (m *ShowVpeSystemTime) Size() (size int) {
   204  	if m == nil {
   205  		return 0
   206  	}
   207  	return size
   208  }
   209  func (m *ShowVpeSystemTime) Marshal(b []byte) ([]byte, error) {
   210  	if b == nil {
   211  		b = make([]byte, m.Size())
   212  	}
   213  	buf := codec.NewBuffer(b)
   214  	return buf.Bytes(), nil
   215  }
   216  func (m *ShowVpeSystemTime) Unmarshal(b []byte) error {
   217  	return nil
   218  }
   219  
   220  // Reply for show vpe system time.
   221  //   - retval - return value
   222  //   - vpe_system_time - the time in seconds since epoch of the host system.
   223  //
   224  // ShowVpeSystemTimeReply defines message 'show_vpe_system_time_reply'.
   225  type ShowVpeSystemTimeReply struct {
   226  	Retval        int32               `binapi:"i32,name=retval" json:"retval,omitempty"`
   227  	VpeSystemTime vpe_types.Timestamp `binapi:"timestamp,name=vpe_system_time" json:"vpe_system_time,omitempty"`
   228  }
   229  
   230  func (m *ShowVpeSystemTimeReply) Reset()               { *m = ShowVpeSystemTimeReply{} }
   231  func (*ShowVpeSystemTimeReply) GetMessageName() string { return "show_vpe_system_time_reply" }
   232  func (*ShowVpeSystemTimeReply) GetCrcString() string   { return "7ffd8193" }
   233  func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType {
   234  	return api.ReplyMessage
   235  }
   236  
   237  func (m *ShowVpeSystemTimeReply) Size() (size int) {
   238  	if m == nil {
   239  		return 0
   240  	}
   241  	size += 4 // m.Retval
   242  	size += 8 // m.VpeSystemTime
   243  	return size
   244  }
   245  func (m *ShowVpeSystemTimeReply) 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.EncodeFloat64(float64(m.VpeSystemTime))
   252  	return buf.Bytes(), nil
   253  }
   254  func (m *ShowVpeSystemTimeReply) Unmarshal(b []byte) error {
   255  	buf := codec.NewBuffer(b)
   256  	m.Retval = buf.DecodeInt32()
   257  	m.VpeSystemTime = vpe_types.Timestamp(buf.DecodeFloat64())
   258  	return nil
   259  }
   260  
   261  func init() { file_vpe_binapi_init() }
   262  func file_vpe_binapi_init() {
   263  	api.RegisterMessage((*LogDetails)(nil), "log_details_03d61cc0")
   264  	api.RegisterMessage((*LogDump)(nil), "log_dump_6ab31753")
   265  	api.RegisterMessage((*ShowVersion)(nil), "show_version_51077d14")
   266  	api.RegisterMessage((*ShowVersionReply)(nil), "show_version_reply_c919bde1")
   267  	api.RegisterMessage((*ShowVpeSystemTime)(nil), "show_vpe_system_time_51077d14")
   268  	api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "show_vpe_system_time_reply_7ffd8193")
   269  }
   270  
   271  // Messages returns list of all messages in this module.
   272  func AllMessages() []api.Message {
   273  	return []api.Message{
   274  		(*LogDetails)(nil),
   275  		(*LogDump)(nil),
   276  		(*ShowVersion)(nil),
   277  		(*ShowVersionReply)(nil),
   278  		(*ShowVpeSystemTime)(nil),
   279  		(*ShowVpeSystemTimeReply)(nil),
   280  	}
   281  }