go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2210/vpe/vpe.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  
     3  // Package vpe contains generated bindings for API file vpe.api.
     4  //
     5  // Contents:
     6  // -  6 messages
     7  package vpe
     8  
     9  import (
    10  	api "go.fd.io/govpp/api"
    11  	codec "go.fd.io/govpp/codec"
    12  	vpe_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2210/vpe_types"
    13  )
    14  
    15  // This is a compile-time assertion to ensure that this generated file
    16  // is compatible with the GoVPP api package it is being compiled against.
    17  // A compilation error at this line likely means your copy of the
    18  // GoVPP api package needs to be updated.
    19  const _ = api.GoVppAPIPackageIsVersion2
    20  
    21  const (
    22  	APIFile    = "vpe"
    23  	APIVersion = "1.7.0"
    24  	VersionCrc = 0xbbfa7484
    25  )
    26  
    27  // LogDetails defines message 'log_details'.
    28  type LogDetails struct {
    29  	Timestamp vpe_types.Timestamp `binapi:"timestamp,name=timestamp" json:"timestamp,omitempty"`
    30  	Level     vpe_types.LogLevel  `binapi:"log_level,name=level" json:"level,omitempty"`
    31  	MsgClass  string              `binapi:"string[32],name=msg_class" json:"msg_class,omitempty"`
    32  	Message   string              `binapi:"string[256],name=message" json:"message,omitempty"`
    33  }
    34  
    35  func (m *LogDetails) Reset()               { *m = LogDetails{} }
    36  func (*LogDetails) GetMessageName() string { return "log_details" }
    37  func (*LogDetails) GetCrcString() string   { return "03d61cc0" }
    38  func (*LogDetails) GetMessageType() api.MessageType {
    39  	return api.ReplyMessage
    40  }
    41  
    42  func (m *LogDetails) Size() (size int) {
    43  	if m == nil {
    44  		return 0
    45  	}
    46  	size += 8   // m.Timestamp
    47  	size += 4   // m.Level
    48  	size += 32  // m.MsgClass
    49  	size += 256 // m.Message
    50  	return size
    51  }
    52  func (m *LogDetails) Marshal(b []byte) ([]byte, error) {
    53  	if b == nil {
    54  		b = make([]byte, m.Size())
    55  	}
    56  	buf := codec.NewBuffer(b)
    57  	buf.EncodeFloat64(float64(m.Timestamp))
    58  	buf.EncodeUint32(uint32(m.Level))
    59  	buf.EncodeString(m.MsgClass, 32)
    60  	buf.EncodeString(m.Message, 256)
    61  	return buf.Bytes(), nil
    62  }
    63  func (m *LogDetails) Unmarshal(b []byte) error {
    64  	buf := codec.NewBuffer(b)
    65  	m.Timestamp = vpe_types.Timestamp(buf.DecodeFloat64())
    66  	m.Level = vpe_types.LogLevel(buf.DecodeUint32())
    67  	m.MsgClass = buf.DecodeString(32)
    68  	m.Message = buf.DecodeString(256)
    69  	return nil
    70  }
    71  
    72  // LogDump defines message 'log_dump'.
    73  type LogDump struct {
    74  	StartTimestamp vpe_types.Timestamp `binapi:"timestamp,name=start_timestamp" json:"start_timestamp,omitempty"`
    75  }
    76  
    77  func (m *LogDump) Reset()               { *m = LogDump{} }
    78  func (*LogDump) GetMessageName() string { return "log_dump" }
    79  func (*LogDump) GetCrcString() string   { return "6ab31753" }
    80  func (*LogDump) GetMessageType() api.MessageType {
    81  	return api.RequestMessage
    82  }
    83  
    84  func (m *LogDump) Size() (size int) {
    85  	if m == nil {
    86  		return 0
    87  	}
    88  	size += 8 // m.StartTimestamp
    89  	return size
    90  }
    91  func (m *LogDump) Marshal(b []byte) ([]byte, error) {
    92  	if b == nil {
    93  		b = make([]byte, m.Size())
    94  	}
    95  	buf := codec.NewBuffer(b)
    96  	buf.EncodeFloat64(float64(m.StartTimestamp))
    97  	return buf.Bytes(), nil
    98  }
    99  func (m *LogDump) Unmarshal(b []byte) error {
   100  	buf := codec.NewBuffer(b)
   101  	m.StartTimestamp = vpe_types.Timestamp(buf.DecodeFloat64())
   102  	return nil
   103  }
   104  
   105  // ShowVersion defines message 'show_version'.
   106  type ShowVersion struct{}
   107  
   108  func (m *ShowVersion) Reset()               { *m = ShowVersion{} }
   109  func (*ShowVersion) GetMessageName() string { return "show_version" }
   110  func (*ShowVersion) GetCrcString() string   { return "51077d14" }
   111  func (*ShowVersion) GetMessageType() api.MessageType {
   112  	return api.RequestMessage
   113  }
   114  
   115  func (m *ShowVersion) Size() (size int) {
   116  	if m == nil {
   117  		return 0
   118  	}
   119  	return size
   120  }
   121  func (m *ShowVersion) Marshal(b []byte) ([]byte, error) {
   122  	if b == nil {
   123  		b = make([]byte, m.Size())
   124  	}
   125  	buf := codec.NewBuffer(b)
   126  	return buf.Bytes(), nil
   127  }
   128  func (m *ShowVersion) Unmarshal(b []byte) error {
   129  	return nil
   130  }
   131  
   132  // ShowVersionReply defines message 'show_version_reply'.
   133  type ShowVersionReply struct {
   134  	Retval         int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   135  	Program        string `binapi:"string[32],name=program" json:"program,omitempty"`
   136  	Version        string `binapi:"string[32],name=version" json:"version,omitempty"`
   137  	BuildDate      string `binapi:"string[32],name=build_date" json:"build_date,omitempty"`
   138  	BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty"`
   139  }
   140  
   141  func (m *ShowVersionReply) Reset()               { *m = ShowVersionReply{} }
   142  func (*ShowVersionReply) GetMessageName() string { return "show_version_reply" }
   143  func (*ShowVersionReply) GetCrcString() string   { return "c919bde1" }
   144  func (*ShowVersionReply) GetMessageType() api.MessageType {
   145  	return api.ReplyMessage
   146  }
   147  
   148  func (m *ShowVersionReply) Size() (size int) {
   149  	if m == nil {
   150  		return 0
   151  	}
   152  	size += 4   // m.Retval
   153  	size += 32  // m.Program
   154  	size += 32  // m.Version
   155  	size += 32  // m.BuildDate
   156  	size += 256 // m.BuildDirectory
   157  	return size
   158  }
   159  func (m *ShowVersionReply) Marshal(b []byte) ([]byte, error) {
   160  	if b == nil {
   161  		b = make([]byte, m.Size())
   162  	}
   163  	buf := codec.NewBuffer(b)
   164  	buf.EncodeInt32(m.Retval)
   165  	buf.EncodeString(m.Program, 32)
   166  	buf.EncodeString(m.Version, 32)
   167  	buf.EncodeString(m.BuildDate, 32)
   168  	buf.EncodeString(m.BuildDirectory, 256)
   169  	return buf.Bytes(), nil
   170  }
   171  func (m *ShowVersionReply) Unmarshal(b []byte) error {
   172  	buf := codec.NewBuffer(b)
   173  	m.Retval = buf.DecodeInt32()
   174  	m.Program = buf.DecodeString(32)
   175  	m.Version = buf.DecodeString(32)
   176  	m.BuildDate = buf.DecodeString(32)
   177  	m.BuildDirectory = buf.DecodeString(256)
   178  	return nil
   179  }
   180  
   181  // ShowVpeSystemTime defines message 'show_vpe_system_time'.
   182  type ShowVpeSystemTime struct{}
   183  
   184  func (m *ShowVpeSystemTime) Reset()               { *m = ShowVpeSystemTime{} }
   185  func (*ShowVpeSystemTime) GetMessageName() string { return "show_vpe_system_time" }
   186  func (*ShowVpeSystemTime) GetCrcString() string   { return "51077d14" }
   187  func (*ShowVpeSystemTime) GetMessageType() api.MessageType {
   188  	return api.RequestMessage
   189  }
   190  
   191  func (m *ShowVpeSystemTime) Size() (size int) {
   192  	if m == nil {
   193  		return 0
   194  	}
   195  	return size
   196  }
   197  func (m *ShowVpeSystemTime) 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 *ShowVpeSystemTime) Unmarshal(b []byte) error {
   205  	return nil
   206  }
   207  
   208  // ShowVpeSystemTimeReply defines message 'show_vpe_system_time_reply'.
   209  type ShowVpeSystemTimeReply struct {
   210  	Retval        int32               `binapi:"i32,name=retval" json:"retval,omitempty"`
   211  	VpeSystemTime vpe_types.Timestamp `binapi:"timestamp,name=vpe_system_time" json:"vpe_system_time,omitempty"`
   212  }
   213  
   214  func (m *ShowVpeSystemTimeReply) Reset()               { *m = ShowVpeSystemTimeReply{} }
   215  func (*ShowVpeSystemTimeReply) GetMessageName() string { return "show_vpe_system_time_reply" }
   216  func (*ShowVpeSystemTimeReply) GetCrcString() string   { return "7ffd8193" }
   217  func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType {
   218  	return api.ReplyMessage
   219  }
   220  
   221  func (m *ShowVpeSystemTimeReply) Size() (size int) {
   222  	if m == nil {
   223  		return 0
   224  	}
   225  	size += 4 // m.Retval
   226  	size += 8 // m.VpeSystemTime
   227  	return size
   228  }
   229  func (m *ShowVpeSystemTimeReply) Marshal(b []byte) ([]byte, error) {
   230  	if b == nil {
   231  		b = make([]byte, m.Size())
   232  	}
   233  	buf := codec.NewBuffer(b)
   234  	buf.EncodeInt32(m.Retval)
   235  	buf.EncodeFloat64(float64(m.VpeSystemTime))
   236  	return buf.Bytes(), nil
   237  }
   238  func (m *ShowVpeSystemTimeReply) Unmarshal(b []byte) error {
   239  	buf := codec.NewBuffer(b)
   240  	m.Retval = buf.DecodeInt32()
   241  	m.VpeSystemTime = vpe_types.Timestamp(buf.DecodeFloat64())
   242  	return nil
   243  }
   244  
   245  func init() { file_vpe_binapi_init() }
   246  func file_vpe_binapi_init() {
   247  	api.RegisterMessage((*LogDetails)(nil), "log_details_03d61cc0")
   248  	api.RegisterMessage((*LogDump)(nil), "log_dump_6ab31753")
   249  	api.RegisterMessage((*ShowVersion)(nil), "show_version_51077d14")
   250  	api.RegisterMessage((*ShowVersionReply)(nil), "show_version_reply_c919bde1")
   251  	api.RegisterMessage((*ShowVpeSystemTime)(nil), "show_vpe_system_time_51077d14")
   252  	api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "show_vpe_system_time_reply_7ffd8193")
   253  }
   254  
   255  // Messages returns list of all messages in this module.
   256  func AllMessages() []api.Message {
   257  	return []api.Message{
   258  		(*LogDetails)(nil),
   259  		(*LogDump)(nil),
   260  		(*ShowVersion)(nil),
   261  		(*ShowVersionReply)(nil),
   262  		(*ShowVpeSystemTime)(nil),
   263  		(*ShowVpeSystemTimeReply)(nil),
   264  	}
   265  }