github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/pppoe/pppoe.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.4.0-dev
     4  //  VPP:              23.02-rc0~189-g57127b32a
     5  // source: /usr/share/vpp/api/plugins/pppoe.api.json
     6  
     7  // Package pppoe contains generated bindings for API file pppoe.api.
     8  //
     9  // Contents:
    10  //   6 messages
    11  //
    12  package pppoe
    13  
    14  import (
    15  	api "git.fd.io/govpp.git/api"
    16  	codec "git.fd.io/govpp.git/codec"
    17  	ethernet_types "github.com/edwarnicke/govpp/binapi/ethernet_types"
    18  	interface_types "github.com/edwarnicke/govpp/binapi/interface_types"
    19  	ip_types "github.com/edwarnicke/govpp/binapi/ip_types"
    20  )
    21  
    22  // This is a compile-time assertion to ensure that this generated file
    23  // is compatible with the GoVPP api package it is being compiled against.
    24  // A compilation error at this line likely means your copy of the
    25  // GoVPP api package needs to be updated.
    26  const _ = api.GoVppAPIPackageIsVersion2
    27  
    28  const (
    29  	APIFile    = "pppoe"
    30  	APIVersion = "2.0.0"
    31  	VersionCrc = 0xec9e86bf
    32  )
    33  
    34  // PppoeAddDelCp defines message 'pppoe_add_del_cp'.
    35  type PppoeAddDelCp struct {
    36  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    37  	IsAdd     uint8                          `binapi:"u8,name=is_add" json:"is_add,omitempty"`
    38  }
    39  
    40  func (m *PppoeAddDelCp) Reset()               { *m = PppoeAddDelCp{} }
    41  func (*PppoeAddDelCp) GetMessageName() string { return "pppoe_add_del_cp" }
    42  func (*PppoeAddDelCp) GetCrcString() string   { return "eacd9aaa" }
    43  func (*PppoeAddDelCp) GetMessageType() api.MessageType {
    44  	return api.RequestMessage
    45  }
    46  
    47  func (m *PppoeAddDelCp) Size() (size int) {
    48  	if m == nil {
    49  		return 0
    50  	}
    51  	size += 4 // m.SwIfIndex
    52  	size += 1 // m.IsAdd
    53  	return size
    54  }
    55  func (m *PppoeAddDelCp) Marshal(b []byte) ([]byte, error) {
    56  	if b == nil {
    57  		b = make([]byte, m.Size())
    58  	}
    59  	buf := codec.NewBuffer(b)
    60  	buf.EncodeUint32(uint32(m.SwIfIndex))
    61  	buf.EncodeUint8(m.IsAdd)
    62  	return buf.Bytes(), nil
    63  }
    64  func (m *PppoeAddDelCp) Unmarshal(b []byte) error {
    65  	buf := codec.NewBuffer(b)
    66  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    67  	m.IsAdd = buf.DecodeUint8()
    68  	return nil
    69  }
    70  
    71  // PppoeAddDelCpReply defines message 'pppoe_add_del_cp_reply'.
    72  type PppoeAddDelCpReply struct {
    73  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    74  }
    75  
    76  func (m *PppoeAddDelCpReply) Reset()               { *m = PppoeAddDelCpReply{} }
    77  func (*PppoeAddDelCpReply) GetMessageName() string { return "pppoe_add_del_cp_reply" }
    78  func (*PppoeAddDelCpReply) GetCrcString() string   { return "e8d4e804" }
    79  func (*PppoeAddDelCpReply) GetMessageType() api.MessageType {
    80  	return api.ReplyMessage
    81  }
    82  
    83  func (m *PppoeAddDelCpReply) Size() (size int) {
    84  	if m == nil {
    85  		return 0
    86  	}
    87  	size += 4 // m.Retval
    88  	return size
    89  }
    90  func (m *PppoeAddDelCpReply) Marshal(b []byte) ([]byte, error) {
    91  	if b == nil {
    92  		b = make([]byte, m.Size())
    93  	}
    94  	buf := codec.NewBuffer(b)
    95  	buf.EncodeInt32(m.Retval)
    96  	return buf.Bytes(), nil
    97  }
    98  func (m *PppoeAddDelCpReply) Unmarshal(b []byte) error {
    99  	buf := codec.NewBuffer(b)
   100  	m.Retval = buf.DecodeInt32()
   101  	return nil
   102  }
   103  
   104  // PppoeAddDelSession defines message 'pppoe_add_del_session'.
   105  type PppoeAddDelSession struct {
   106  	IsAdd      bool                      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   107  	SessionID  uint16                    `binapi:"u16,name=session_id" json:"session_id,omitempty"`
   108  	ClientIP   ip_types.Address          `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
   109  	DecapVrfID uint32                    `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
   110  	ClientMac  ethernet_types.MacAddress `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
   111  }
   112  
   113  func (m *PppoeAddDelSession) Reset()               { *m = PppoeAddDelSession{} }
   114  func (*PppoeAddDelSession) GetMessageName() string { return "pppoe_add_del_session" }
   115  func (*PppoeAddDelSession) GetCrcString() string   { return "f6fd759e" }
   116  func (*PppoeAddDelSession) GetMessageType() api.MessageType {
   117  	return api.RequestMessage
   118  }
   119  
   120  func (m *PppoeAddDelSession) Size() (size int) {
   121  	if m == nil {
   122  		return 0
   123  	}
   124  	size += 1      // m.IsAdd
   125  	size += 2      // m.SessionID
   126  	size += 1      // m.ClientIP.Af
   127  	size += 1 * 16 // m.ClientIP.Un
   128  	size += 4      // m.DecapVrfID
   129  	size += 1 * 6  // m.ClientMac
   130  	return size
   131  }
   132  func (m *PppoeAddDelSession) Marshal(b []byte) ([]byte, error) {
   133  	if b == nil {
   134  		b = make([]byte, m.Size())
   135  	}
   136  	buf := codec.NewBuffer(b)
   137  	buf.EncodeBool(m.IsAdd)
   138  	buf.EncodeUint16(m.SessionID)
   139  	buf.EncodeUint8(uint8(m.ClientIP.Af))
   140  	buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
   141  	buf.EncodeUint32(m.DecapVrfID)
   142  	buf.EncodeBytes(m.ClientMac[:], 6)
   143  	return buf.Bytes(), nil
   144  }
   145  func (m *PppoeAddDelSession) Unmarshal(b []byte) error {
   146  	buf := codec.NewBuffer(b)
   147  	m.IsAdd = buf.DecodeBool()
   148  	m.SessionID = buf.DecodeUint16()
   149  	m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
   150  	copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   151  	m.DecapVrfID = buf.DecodeUint32()
   152  	copy(m.ClientMac[:], buf.DecodeBytes(6))
   153  	return nil
   154  }
   155  
   156  // PppoeAddDelSessionReply defines message 'pppoe_add_del_session_reply'.
   157  type PppoeAddDelSessionReply struct {
   158  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   159  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   160  }
   161  
   162  func (m *PppoeAddDelSessionReply) Reset()               { *m = PppoeAddDelSessionReply{} }
   163  func (*PppoeAddDelSessionReply) GetMessageName() string { return "pppoe_add_del_session_reply" }
   164  func (*PppoeAddDelSessionReply) GetCrcString() string   { return "5383d31f" }
   165  func (*PppoeAddDelSessionReply) GetMessageType() api.MessageType {
   166  	return api.ReplyMessage
   167  }
   168  
   169  func (m *PppoeAddDelSessionReply) Size() (size int) {
   170  	if m == nil {
   171  		return 0
   172  	}
   173  	size += 4 // m.Retval
   174  	size += 4 // m.SwIfIndex
   175  	return size
   176  }
   177  func (m *PppoeAddDelSessionReply) Marshal(b []byte) ([]byte, error) {
   178  	if b == nil {
   179  		b = make([]byte, m.Size())
   180  	}
   181  	buf := codec.NewBuffer(b)
   182  	buf.EncodeInt32(m.Retval)
   183  	buf.EncodeUint32(uint32(m.SwIfIndex))
   184  	return buf.Bytes(), nil
   185  }
   186  func (m *PppoeAddDelSessionReply) Unmarshal(b []byte) error {
   187  	buf := codec.NewBuffer(b)
   188  	m.Retval = buf.DecodeInt32()
   189  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   190  	return nil
   191  }
   192  
   193  // PppoeSessionDetails defines message 'pppoe_session_details'.
   194  type PppoeSessionDetails struct {
   195  	SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   196  	SessionID    uint16                         `binapi:"u16,name=session_id" json:"session_id,omitempty"`
   197  	ClientIP     ip_types.Address               `binapi:"address,name=client_ip" json:"client_ip,omitempty"`
   198  	EncapIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=encap_if_index" json:"encap_if_index,omitempty"`
   199  	DecapVrfID   uint32                         `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
   200  	LocalMac     ethernet_types.MacAddress      `binapi:"mac_address,name=local_mac" json:"local_mac,omitempty"`
   201  	ClientMac    ethernet_types.MacAddress      `binapi:"mac_address,name=client_mac" json:"client_mac,omitempty"`
   202  }
   203  
   204  func (m *PppoeSessionDetails) Reset()               { *m = PppoeSessionDetails{} }
   205  func (*PppoeSessionDetails) GetMessageName() string { return "pppoe_session_details" }
   206  func (*PppoeSessionDetails) GetCrcString() string   { return "4b8e8a4a" }
   207  func (*PppoeSessionDetails) GetMessageType() api.MessageType {
   208  	return api.ReplyMessage
   209  }
   210  
   211  func (m *PppoeSessionDetails) Size() (size int) {
   212  	if m == nil {
   213  		return 0
   214  	}
   215  	size += 4      // m.SwIfIndex
   216  	size += 2      // m.SessionID
   217  	size += 1      // m.ClientIP.Af
   218  	size += 1 * 16 // m.ClientIP.Un
   219  	size += 4      // m.EncapIfIndex
   220  	size += 4      // m.DecapVrfID
   221  	size += 1 * 6  // m.LocalMac
   222  	size += 1 * 6  // m.ClientMac
   223  	return size
   224  }
   225  func (m *PppoeSessionDetails) 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  	buf.EncodeUint16(m.SessionID)
   232  	buf.EncodeUint8(uint8(m.ClientIP.Af))
   233  	buf.EncodeBytes(m.ClientIP.Un.XXX_UnionData[:], 16)
   234  	buf.EncodeUint32(uint32(m.EncapIfIndex))
   235  	buf.EncodeUint32(m.DecapVrfID)
   236  	buf.EncodeBytes(m.LocalMac[:], 6)
   237  	buf.EncodeBytes(m.ClientMac[:], 6)
   238  	return buf.Bytes(), nil
   239  }
   240  func (m *PppoeSessionDetails) Unmarshal(b []byte) error {
   241  	buf := codec.NewBuffer(b)
   242  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   243  	m.SessionID = buf.DecodeUint16()
   244  	m.ClientIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
   245  	copy(m.ClientIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   246  	m.EncapIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   247  	m.DecapVrfID = buf.DecodeUint32()
   248  	copy(m.LocalMac[:], buf.DecodeBytes(6))
   249  	copy(m.ClientMac[:], buf.DecodeBytes(6))
   250  	return nil
   251  }
   252  
   253  // PppoeSessionDump defines message 'pppoe_session_dump'.
   254  type PppoeSessionDump struct {
   255  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   256  }
   257  
   258  func (m *PppoeSessionDump) Reset()               { *m = PppoeSessionDump{} }
   259  func (*PppoeSessionDump) GetMessageName() string { return "pppoe_session_dump" }
   260  func (*PppoeSessionDump) GetCrcString() string   { return "f9e6675e" }
   261  func (*PppoeSessionDump) GetMessageType() api.MessageType {
   262  	return api.RequestMessage
   263  }
   264  
   265  func (m *PppoeSessionDump) Size() (size int) {
   266  	if m == nil {
   267  		return 0
   268  	}
   269  	size += 4 // m.SwIfIndex
   270  	return size
   271  }
   272  func (m *PppoeSessionDump) Marshal(b []byte) ([]byte, error) {
   273  	if b == nil {
   274  		b = make([]byte, m.Size())
   275  	}
   276  	buf := codec.NewBuffer(b)
   277  	buf.EncodeUint32(uint32(m.SwIfIndex))
   278  	return buf.Bytes(), nil
   279  }
   280  func (m *PppoeSessionDump) Unmarshal(b []byte) error {
   281  	buf := codec.NewBuffer(b)
   282  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   283  	return nil
   284  }
   285  
   286  func init() { file_pppoe_binapi_init() }
   287  func file_pppoe_binapi_init() {
   288  	api.RegisterMessage((*PppoeAddDelCp)(nil), "pppoe_add_del_cp_eacd9aaa")
   289  	api.RegisterMessage((*PppoeAddDelCpReply)(nil), "pppoe_add_del_cp_reply_e8d4e804")
   290  	api.RegisterMessage((*PppoeAddDelSession)(nil), "pppoe_add_del_session_f6fd759e")
   291  	api.RegisterMessage((*PppoeAddDelSessionReply)(nil), "pppoe_add_del_session_reply_5383d31f")
   292  	api.RegisterMessage((*PppoeSessionDetails)(nil), "pppoe_session_details_4b8e8a4a")
   293  	api.RegisterMessage((*PppoeSessionDump)(nil), "pppoe_session_dump_f9e6675e")
   294  }
   295  
   296  // Messages returns list of all messages in this module.
   297  func AllMessages() []api.Message {
   298  	return []api.Message{
   299  		(*PppoeAddDelCp)(nil),
   300  		(*PppoeAddDelCpReply)(nil),
   301  		(*PppoeAddDelSession)(nil),
   302  		(*PppoeAddDelSessionReply)(nil),
   303  		(*PppoeSessionDetails)(nil),
   304  		(*PppoeSessionDump)(nil),
   305  	}
   306  }