github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/pipe/pipe.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/pipe.api.json
     6  
     7  // Package pipe contains generated bindings for API file pipe.api.
     8  //
     9  // Contents:
    10  // -  6 messages
    11  package pipe
    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    = "pipe"
    27  	APIVersion = "1.0.1"
    28  	VersionCrc = 0xc159134a
    29  )
    30  
    31  // Initialize a new pipe interface with the given parameters
    32  //   - is_specified - if non-0, a specific user_instance is being requested
    33  //   - user_instance - requested instance, ~0 => dynamically allocate
    34  //
    35  // PipeCreate defines message 'pipe_create'.
    36  type PipeCreate struct {
    37  	IsSpecified  bool   `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
    38  	UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
    39  }
    40  
    41  func (m *PipeCreate) Reset()               { *m = PipeCreate{} }
    42  func (*PipeCreate) GetMessageName() string { return "pipe_create" }
    43  func (*PipeCreate) GetCrcString() string   { return "bb263bd3" }
    44  func (*PipeCreate) GetMessageType() api.MessageType {
    45  	return api.RequestMessage
    46  }
    47  
    48  func (m *PipeCreate) Size() (size int) {
    49  	if m == nil {
    50  		return 0
    51  	}
    52  	size += 1 // m.IsSpecified
    53  	size += 4 // m.UserInstance
    54  	return size
    55  }
    56  func (m *PipeCreate) Marshal(b []byte) ([]byte, error) {
    57  	if b == nil {
    58  		b = make([]byte, m.Size())
    59  	}
    60  	buf := codec.NewBuffer(b)
    61  	buf.EncodeBool(m.IsSpecified)
    62  	buf.EncodeUint32(m.UserInstance)
    63  	return buf.Bytes(), nil
    64  }
    65  func (m *PipeCreate) Unmarshal(b []byte) error {
    66  	buf := codec.NewBuffer(b)
    67  	m.IsSpecified = buf.DecodeBool()
    68  	m.UserInstance = buf.DecodeUint32()
    69  	return nil
    70  }
    71  
    72  // Reply for pipe create reply
    73  //   - retval - return code
    74  //   - sw_if_index - software index allocated for the new pipe parent interface
    75  //     Use the parent interface for link up/down and to delete
    76  //   - pipe_sw_if_index - the two SW indicies that form the ends of the pipe.
    77  //
    78  // PipeCreateReply defines message 'pipe_create_reply'.
    79  type PipeCreateReply struct {
    80  	Retval        int32                             `binapi:"i32,name=retval" json:"retval,omitempty"`
    81  	SwIfIndex     interface_types.InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    82  	PipeSwIfIndex [2]interface_types.InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
    83  }
    84  
    85  func (m *PipeCreateReply) Reset()               { *m = PipeCreateReply{} }
    86  func (*PipeCreateReply) GetMessageName() string { return "pipe_create_reply" }
    87  func (*PipeCreateReply) GetCrcString() string   { return "b7ce310c" }
    88  func (*PipeCreateReply) GetMessageType() api.MessageType {
    89  	return api.ReplyMessage
    90  }
    91  
    92  func (m *PipeCreateReply) Size() (size int) {
    93  	if m == nil {
    94  		return 0
    95  	}
    96  	size += 4 // m.Retval
    97  	size += 4 // m.SwIfIndex
    98  	for j1 := 0; j1 < 2; j1++ {
    99  		size += 4 // m.PipeSwIfIndex[j1]
   100  	}
   101  	return size
   102  }
   103  func (m *PipeCreateReply) Marshal(b []byte) ([]byte, error) {
   104  	if b == nil {
   105  		b = make([]byte, m.Size())
   106  	}
   107  	buf := codec.NewBuffer(b)
   108  	buf.EncodeInt32(m.Retval)
   109  	buf.EncodeUint32(uint32(m.SwIfIndex))
   110  	for j0 := 0; j0 < 2; j0++ {
   111  		buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
   112  	}
   113  	return buf.Bytes(), nil
   114  }
   115  func (m *PipeCreateReply) Unmarshal(b []byte) error {
   116  	buf := codec.NewBuffer(b)
   117  	m.Retval = buf.DecodeInt32()
   118  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   119  	for j0 := 0; j0 < 2; j0++ {
   120  		m.PipeSwIfIndex[j0] = interface_types.InterfaceIndex(buf.DecodeUint32())
   121  	}
   122  	return nil
   123  }
   124  
   125  // Delete pipe interface
   126  //   - sw_if_index - interface index of existing parent pipe interface
   127  //
   128  // PipeDelete defines message 'pipe_delete'.
   129  type PipeDelete struct {
   130  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   131  }
   132  
   133  func (m *PipeDelete) Reset()               { *m = PipeDelete{} }
   134  func (*PipeDelete) GetMessageName() string { return "pipe_delete" }
   135  func (*PipeDelete) GetCrcString() string   { return "f9e6675e" }
   136  func (*PipeDelete) GetMessageType() api.MessageType {
   137  	return api.RequestMessage
   138  }
   139  
   140  func (m *PipeDelete) Size() (size int) {
   141  	if m == nil {
   142  		return 0
   143  	}
   144  	size += 4 // m.SwIfIndex
   145  	return size
   146  }
   147  func (m *PipeDelete) Marshal(b []byte) ([]byte, error) {
   148  	if b == nil {
   149  		b = make([]byte, m.Size())
   150  	}
   151  	buf := codec.NewBuffer(b)
   152  	buf.EncodeUint32(uint32(m.SwIfIndex))
   153  	return buf.Bytes(), nil
   154  }
   155  func (m *PipeDelete) Unmarshal(b []byte) error {
   156  	buf := codec.NewBuffer(b)
   157  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   158  	return nil
   159  }
   160  
   161  // PipeDeleteReply defines message 'pipe_delete_reply'.
   162  type PipeDeleteReply struct {
   163  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   164  }
   165  
   166  func (m *PipeDeleteReply) Reset()               { *m = PipeDeleteReply{} }
   167  func (*PipeDeleteReply) GetMessageName() string { return "pipe_delete_reply" }
   168  func (*PipeDeleteReply) GetCrcString() string   { return "e8d4e804" }
   169  func (*PipeDeleteReply) GetMessageType() api.MessageType {
   170  	return api.ReplyMessage
   171  }
   172  
   173  func (m *PipeDeleteReply) Size() (size int) {
   174  	if m == nil {
   175  		return 0
   176  	}
   177  	size += 4 // m.Retval
   178  	return size
   179  }
   180  func (m *PipeDeleteReply) 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 *PipeDeleteReply) Unmarshal(b []byte) error {
   189  	buf := codec.NewBuffer(b)
   190  	m.Retval = buf.DecodeInt32()
   191  	return nil
   192  }
   193  
   194  // Reply for pipe dump request
   195  //   - sw_if_index - software index of pipe interface
   196  //   - sw_if_index - software index allocated for the pipe parent interface
   197  //   - pipe_sw_if_index - the two SW indicies that form the ends of the pipe.
   198  //   - instance - instance allocated
   199  //
   200  // PipeDetails defines message 'pipe_details'.
   201  type PipeDetails struct {
   202  	SwIfIndex     interface_types.InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   203  	PipeSwIfIndex [2]interface_types.InterfaceIndex `binapi:"interface_index[2],name=pipe_sw_if_index" json:"pipe_sw_if_index,omitempty"`
   204  	Instance      uint32                            `binapi:"u32,name=instance" json:"instance,omitempty"`
   205  }
   206  
   207  func (m *PipeDetails) Reset()               { *m = PipeDetails{} }
   208  func (*PipeDetails) GetMessageName() string { return "pipe_details" }
   209  func (*PipeDetails) GetCrcString() string   { return "c52b799d" }
   210  func (*PipeDetails) GetMessageType() api.MessageType {
   211  	return api.ReplyMessage
   212  }
   213  
   214  func (m *PipeDetails) Size() (size int) {
   215  	if m == nil {
   216  		return 0
   217  	}
   218  	size += 4 // m.SwIfIndex
   219  	for j1 := 0; j1 < 2; j1++ {
   220  		size += 4 // m.PipeSwIfIndex[j1]
   221  	}
   222  	size += 4 // m.Instance
   223  	return size
   224  }
   225  func (m *PipeDetails) Marshal(b []byte) ([]byte, error) {
   226  	if b == nil {
   227  		b = make([]byte, m.Size())
   228  	}
   229  	buf := codec.NewBuffer(b)
   230  	buf.EncodeUint32(uint32(m.SwIfIndex))
   231  	for j0 := 0; j0 < 2; j0++ {
   232  		buf.EncodeUint32(uint32(m.PipeSwIfIndex[j0]))
   233  	}
   234  	buf.EncodeUint32(m.Instance)
   235  	return buf.Bytes(), nil
   236  }
   237  func (m *PipeDetails) Unmarshal(b []byte) error {
   238  	buf := codec.NewBuffer(b)
   239  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   240  	for j0 := 0; j0 < 2; j0++ {
   241  		m.PipeSwIfIndex[j0] = interface_types.InterfaceIndex(buf.DecodeUint32())
   242  	}
   243  	m.Instance = buf.DecodeUint32()
   244  	return nil
   245  }
   246  
   247  // Dump pipe interfaces request
   248  // PipeDump defines message 'pipe_dump'.
   249  type PipeDump struct{}
   250  
   251  func (m *PipeDump) Reset()               { *m = PipeDump{} }
   252  func (*PipeDump) GetMessageName() string { return "pipe_dump" }
   253  func (*PipeDump) GetCrcString() string   { return "51077d14" }
   254  func (*PipeDump) GetMessageType() api.MessageType {
   255  	return api.RequestMessage
   256  }
   257  
   258  func (m *PipeDump) Size() (size int) {
   259  	if m == nil {
   260  		return 0
   261  	}
   262  	return size
   263  }
   264  func (m *PipeDump) Marshal(b []byte) ([]byte, error) {
   265  	if b == nil {
   266  		b = make([]byte, m.Size())
   267  	}
   268  	buf := codec.NewBuffer(b)
   269  	return buf.Bytes(), nil
   270  }
   271  func (m *PipeDump) Unmarshal(b []byte) error {
   272  	return nil
   273  }
   274  
   275  func init() { file_pipe_binapi_init() }
   276  func file_pipe_binapi_init() {
   277  	api.RegisterMessage((*PipeCreate)(nil), "pipe_create_bb263bd3")
   278  	api.RegisterMessage((*PipeCreateReply)(nil), "pipe_create_reply_b7ce310c")
   279  	api.RegisterMessage((*PipeDelete)(nil), "pipe_delete_f9e6675e")
   280  	api.RegisterMessage((*PipeDeleteReply)(nil), "pipe_delete_reply_e8d4e804")
   281  	api.RegisterMessage((*PipeDetails)(nil), "pipe_details_c52b799d")
   282  	api.RegisterMessage((*PipeDump)(nil), "pipe_dump_51077d14")
   283  }
   284  
   285  // Messages returns list of all messages in this module.
   286  func AllMessages() []api.Message {
   287  	return []api.Message{
   288  		(*PipeCreate)(nil),
   289  		(*PipeCreateReply)(nil),
   290  		(*PipeDelete)(nil),
   291  		(*PipeDeleteReply)(nil),
   292  		(*PipeDetails)(nil),
   293  		(*PipeDump)(nil),
   294  	}
   295  }