github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/sr_pt/sr_pt.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/sr_pt.api.json
     6  
     7  // Package sr_pt contains generated bindings for API file sr_pt.api.
     8  //
     9  // Contents:
    10  // -  6 messages
    11  package sr_pt
    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    = "sr_pt"
    27  	APIVersion = "1.0.0"
    28  	VersionCrc = 0x1fddedad
    29  )
    30  
    31  // SR PT iface add request
    32  //   - sw_if_index - index of the interface to add to SR PT
    33  //   - id - SR PT interface id
    34  //   - ingress_load - incoming interface load
    35  //   - egress_load - outgoing interface load
    36  //   - tts_template - truncated timestamp template to use
    37  //
    38  // SrPtIfaceAdd defines message 'sr_pt_iface_add'.
    39  type SrPtIfaceAdd struct {
    40  	SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    41  	ID          uint16                         `binapi:"u16,name=id" json:"id,omitempty"`
    42  	IngressLoad uint8                          `binapi:"u8,name=ingress_load" json:"ingress_load,omitempty"`
    43  	EgressLoad  uint8                          `binapi:"u8,name=egress_load" json:"egress_load,omitempty"`
    44  	TtsTemplate uint8                          `binapi:"u8,name=tts_template" json:"tts_template,omitempty"`
    45  }
    46  
    47  func (m *SrPtIfaceAdd) Reset()               { *m = SrPtIfaceAdd{} }
    48  func (*SrPtIfaceAdd) GetMessageName() string { return "sr_pt_iface_add" }
    49  func (*SrPtIfaceAdd) GetCrcString() string   { return "852c0cda" }
    50  func (*SrPtIfaceAdd) GetMessageType() api.MessageType {
    51  	return api.RequestMessage
    52  }
    53  
    54  func (m *SrPtIfaceAdd) Size() (size int) {
    55  	if m == nil {
    56  		return 0
    57  	}
    58  	size += 4 // m.SwIfIndex
    59  	size += 2 // m.ID
    60  	size += 1 // m.IngressLoad
    61  	size += 1 // m.EgressLoad
    62  	size += 1 // m.TtsTemplate
    63  	return size
    64  }
    65  func (m *SrPtIfaceAdd) Marshal(b []byte) ([]byte, error) {
    66  	if b == nil {
    67  		b = make([]byte, m.Size())
    68  	}
    69  	buf := codec.NewBuffer(b)
    70  	buf.EncodeUint32(uint32(m.SwIfIndex))
    71  	buf.EncodeUint16(m.ID)
    72  	buf.EncodeUint8(m.IngressLoad)
    73  	buf.EncodeUint8(m.EgressLoad)
    74  	buf.EncodeUint8(m.TtsTemplate)
    75  	return buf.Bytes(), nil
    76  }
    77  func (m *SrPtIfaceAdd) Unmarshal(b []byte) error {
    78  	buf := codec.NewBuffer(b)
    79  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    80  	m.ID = buf.DecodeUint16()
    81  	m.IngressLoad = buf.DecodeUint8()
    82  	m.EgressLoad = buf.DecodeUint8()
    83  	m.TtsTemplate = buf.DecodeUint8()
    84  	return nil
    85  }
    86  
    87  // SrPtIfaceAddReply defines message 'sr_pt_iface_add_reply'.
    88  type SrPtIfaceAddReply struct {
    89  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    90  }
    91  
    92  func (m *SrPtIfaceAddReply) Reset()               { *m = SrPtIfaceAddReply{} }
    93  func (*SrPtIfaceAddReply) GetMessageName() string { return "sr_pt_iface_add_reply" }
    94  func (*SrPtIfaceAddReply) GetCrcString() string   { return "e8d4e804" }
    95  func (*SrPtIfaceAddReply) GetMessageType() api.MessageType {
    96  	return api.ReplyMessage
    97  }
    98  
    99  func (m *SrPtIfaceAddReply) Size() (size int) {
   100  	if m == nil {
   101  		return 0
   102  	}
   103  	size += 4 // m.Retval
   104  	return size
   105  }
   106  func (m *SrPtIfaceAddReply) Marshal(b []byte) ([]byte, error) {
   107  	if b == nil {
   108  		b = make([]byte, m.Size())
   109  	}
   110  	buf := codec.NewBuffer(b)
   111  	buf.EncodeInt32(m.Retval)
   112  	return buf.Bytes(), nil
   113  }
   114  func (m *SrPtIfaceAddReply) Unmarshal(b []byte) error {
   115  	buf := codec.NewBuffer(b)
   116  	m.Retval = buf.DecodeInt32()
   117  	return nil
   118  }
   119  
   120  // SR PT iface del request
   121  //   - sw_if_index - index of the interface to delete from SR PT
   122  //
   123  // SrPtIfaceDel defines message 'sr_pt_iface_del'.
   124  type SrPtIfaceDel struct {
   125  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   126  }
   127  
   128  func (m *SrPtIfaceDel) Reset()               { *m = SrPtIfaceDel{} }
   129  func (*SrPtIfaceDel) GetMessageName() string { return "sr_pt_iface_del" }
   130  func (*SrPtIfaceDel) GetCrcString() string   { return "f9e6675e" }
   131  func (*SrPtIfaceDel) GetMessageType() api.MessageType {
   132  	return api.RequestMessage
   133  }
   134  
   135  func (m *SrPtIfaceDel) Size() (size int) {
   136  	if m == nil {
   137  		return 0
   138  	}
   139  	size += 4 // m.SwIfIndex
   140  	return size
   141  }
   142  func (m *SrPtIfaceDel) Marshal(b []byte) ([]byte, error) {
   143  	if b == nil {
   144  		b = make([]byte, m.Size())
   145  	}
   146  	buf := codec.NewBuffer(b)
   147  	buf.EncodeUint32(uint32(m.SwIfIndex))
   148  	return buf.Bytes(), nil
   149  }
   150  func (m *SrPtIfaceDel) Unmarshal(b []byte) error {
   151  	buf := codec.NewBuffer(b)
   152  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   153  	return nil
   154  }
   155  
   156  // SrPtIfaceDelReply defines message 'sr_pt_iface_del_reply'.
   157  type SrPtIfaceDelReply struct {
   158  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   159  }
   160  
   161  func (m *SrPtIfaceDelReply) Reset()               { *m = SrPtIfaceDelReply{} }
   162  func (*SrPtIfaceDelReply) GetMessageName() string { return "sr_pt_iface_del_reply" }
   163  func (*SrPtIfaceDelReply) GetCrcString() string   { return "e8d4e804" }
   164  func (*SrPtIfaceDelReply) GetMessageType() api.MessageType {
   165  	return api.ReplyMessage
   166  }
   167  
   168  func (m *SrPtIfaceDelReply) Size() (size int) {
   169  	if m == nil {
   170  		return 0
   171  	}
   172  	size += 4 // m.Retval
   173  	return size
   174  }
   175  func (m *SrPtIfaceDelReply) Marshal(b []byte) ([]byte, error) {
   176  	if b == nil {
   177  		b = make([]byte, m.Size())
   178  	}
   179  	buf := codec.NewBuffer(b)
   180  	buf.EncodeInt32(m.Retval)
   181  	return buf.Bytes(), nil
   182  }
   183  func (m *SrPtIfaceDelReply) Unmarshal(b []byte) error {
   184  	buf := codec.NewBuffer(b)
   185  	m.Retval = buf.DecodeInt32()
   186  	return nil
   187  }
   188  
   189  // SrPtIfaceDetails defines message 'sr_pt_iface_details'.
   190  type SrPtIfaceDetails struct {
   191  	SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   192  	ID          uint16                         `binapi:"u16,name=id" json:"id,omitempty"`
   193  	IngressLoad uint8                          `binapi:"u8,name=ingress_load" json:"ingress_load,omitempty"`
   194  	EgressLoad  uint8                          `binapi:"u8,name=egress_load" json:"egress_load,omitempty"`
   195  	TtsTemplate uint8                          `binapi:"u8,name=tts_template" json:"tts_template,omitempty"`
   196  }
   197  
   198  func (m *SrPtIfaceDetails) Reset()               { *m = SrPtIfaceDetails{} }
   199  func (*SrPtIfaceDetails) GetMessageName() string { return "sr_pt_iface_details" }
   200  func (*SrPtIfaceDetails) GetCrcString() string   { return "1f472f85" }
   201  func (*SrPtIfaceDetails) GetMessageType() api.MessageType {
   202  	return api.ReplyMessage
   203  }
   204  
   205  func (m *SrPtIfaceDetails) Size() (size int) {
   206  	if m == nil {
   207  		return 0
   208  	}
   209  	size += 4 // m.SwIfIndex
   210  	size += 2 // m.ID
   211  	size += 1 // m.IngressLoad
   212  	size += 1 // m.EgressLoad
   213  	size += 1 // m.TtsTemplate
   214  	return size
   215  }
   216  func (m *SrPtIfaceDetails) Marshal(b []byte) ([]byte, error) {
   217  	if b == nil {
   218  		b = make([]byte, m.Size())
   219  	}
   220  	buf := codec.NewBuffer(b)
   221  	buf.EncodeUint32(uint32(m.SwIfIndex))
   222  	buf.EncodeUint16(m.ID)
   223  	buf.EncodeUint8(m.IngressLoad)
   224  	buf.EncodeUint8(m.EgressLoad)
   225  	buf.EncodeUint8(m.TtsTemplate)
   226  	return buf.Bytes(), nil
   227  }
   228  func (m *SrPtIfaceDetails) Unmarshal(b []byte) error {
   229  	buf := codec.NewBuffer(b)
   230  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   231  	m.ID = buf.DecodeUint16()
   232  	m.IngressLoad = buf.DecodeUint8()
   233  	m.EgressLoad = buf.DecodeUint8()
   234  	m.TtsTemplate = buf.DecodeUint8()
   235  	return nil
   236  }
   237  
   238  // SR PT iface dump request
   239  // SrPtIfaceDump defines message 'sr_pt_iface_dump'.
   240  type SrPtIfaceDump struct{}
   241  
   242  func (m *SrPtIfaceDump) Reset()               { *m = SrPtIfaceDump{} }
   243  func (*SrPtIfaceDump) GetMessageName() string { return "sr_pt_iface_dump" }
   244  func (*SrPtIfaceDump) GetCrcString() string   { return "51077d14" }
   245  func (*SrPtIfaceDump) GetMessageType() api.MessageType {
   246  	return api.RequestMessage
   247  }
   248  
   249  func (m *SrPtIfaceDump) Size() (size int) {
   250  	if m == nil {
   251  		return 0
   252  	}
   253  	return size
   254  }
   255  func (m *SrPtIfaceDump) Marshal(b []byte) ([]byte, error) {
   256  	if b == nil {
   257  		b = make([]byte, m.Size())
   258  	}
   259  	buf := codec.NewBuffer(b)
   260  	return buf.Bytes(), nil
   261  }
   262  func (m *SrPtIfaceDump) Unmarshal(b []byte) error {
   263  	return nil
   264  }
   265  
   266  func init() { file_sr_pt_binapi_init() }
   267  func file_sr_pt_binapi_init() {
   268  	api.RegisterMessage((*SrPtIfaceAdd)(nil), "sr_pt_iface_add_852c0cda")
   269  	api.RegisterMessage((*SrPtIfaceAddReply)(nil), "sr_pt_iface_add_reply_e8d4e804")
   270  	api.RegisterMessage((*SrPtIfaceDel)(nil), "sr_pt_iface_del_f9e6675e")
   271  	api.RegisterMessage((*SrPtIfaceDelReply)(nil), "sr_pt_iface_del_reply_e8d4e804")
   272  	api.RegisterMessage((*SrPtIfaceDetails)(nil), "sr_pt_iface_details_1f472f85")
   273  	api.RegisterMessage((*SrPtIfaceDump)(nil), "sr_pt_iface_dump_51077d14")
   274  }
   275  
   276  // Messages returns list of all messages in this module.
   277  func AllMessages() []api.Message {
   278  	return []api.Message{
   279  		(*SrPtIfaceAdd)(nil),
   280  		(*SrPtIfaceAddReply)(nil),
   281  		(*SrPtIfaceDel)(nil),
   282  		(*SrPtIfaceDelReply)(nil),
   283  		(*SrPtIfaceDetails)(nil),
   284  		(*SrPtIfaceDump)(nil),
   285  	}
   286  }