github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/sr/sr.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/core/sr.api.json
     6  
     7  // Package sr contains generated bindings for API file sr.api.
     8  //
     9  // Contents:
    10  //   2 structs
    11  //  24 messages
    12  //
    13  package sr
    14  
    15  import (
    16  	api "git.fd.io/govpp.git/api"
    17  	codec "git.fd.io/govpp.git/codec"
    18  	interface_types "github.com/edwarnicke/govpp/binapi/interface_types"
    19  	ip_types "github.com/edwarnicke/govpp/binapi/ip_types"
    20  	sr_types "github.com/edwarnicke/govpp/binapi/sr_types"
    21  )
    22  
    23  // This is a compile-time assertion to ensure that this generated file
    24  // is compatible with the GoVPP api package it is being compiled against.
    25  // A compilation error at this line likely means your copy of the
    26  // GoVPP api package needs to be updated.
    27  const _ = api.GoVppAPIPackageIsVersion2
    28  
    29  const (
    30  	APIFile    = "sr"
    31  	APIVersion = "2.0.0"
    32  	VersionCrc = 0x66d92d1b
    33  )
    34  
    35  // Srv6SidList defines type 'srv6_sid_list'.
    36  type Srv6SidList struct {
    37  	NumSids uint8                   `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
    38  	Weight  uint32                  `binapi:"u32,name=weight" json:"weight,omitempty"`
    39  	Sids    [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
    40  }
    41  
    42  // Srv6SidListWithSlIndex defines type 'srv6_sid_list_with_sl_index'.
    43  type Srv6SidListWithSlIndex struct {
    44  	NumSids uint8                   `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
    45  	Weight  uint32                  `binapi:"u32,name=weight" json:"weight,omitempty"`
    46  	SlIndex uint32                  `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
    47  	Sids    [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
    48  }
    49  
    50  // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
    51  type SrLocalsidAddDel struct {
    52  	IsDel     bool                           `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
    53  	Localsid  ip_types.IP6Address            `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
    54  	EndPsp    bool                           `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
    55  	Behavior  sr_types.SrBehavior            `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
    56  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
    57  	VlanIndex uint32                         `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
    58  	FibTable  uint32                         `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
    59  	NhAddr    ip_types.Address               `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
    60  }
    61  
    62  func (m *SrLocalsidAddDel) Reset()               { *m = SrLocalsidAddDel{} }
    63  func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
    64  func (*SrLocalsidAddDel) GetCrcString() string   { return "5a36c324" }
    65  func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
    66  	return api.RequestMessage
    67  }
    68  
    69  func (m *SrLocalsidAddDel) Size() (size int) {
    70  	if m == nil {
    71  		return 0
    72  	}
    73  	size += 1      // m.IsDel
    74  	size += 1 * 16 // m.Localsid
    75  	size += 1      // m.EndPsp
    76  	size += 1      // m.Behavior
    77  	size += 4      // m.SwIfIndex
    78  	size += 4      // m.VlanIndex
    79  	size += 4      // m.FibTable
    80  	size += 1      // m.NhAddr.Af
    81  	size += 1 * 16 // m.NhAddr.Un
    82  	return size
    83  }
    84  func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
    85  	if b == nil {
    86  		b = make([]byte, m.Size())
    87  	}
    88  	buf := codec.NewBuffer(b)
    89  	buf.EncodeBool(m.IsDel)
    90  	buf.EncodeBytes(m.Localsid[:], 16)
    91  	buf.EncodeBool(m.EndPsp)
    92  	buf.EncodeUint8(uint8(m.Behavior))
    93  	buf.EncodeUint32(uint32(m.SwIfIndex))
    94  	buf.EncodeUint32(m.VlanIndex)
    95  	buf.EncodeUint32(m.FibTable)
    96  	buf.EncodeUint8(uint8(m.NhAddr.Af))
    97  	buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16)
    98  	return buf.Bytes(), nil
    99  }
   100  func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
   101  	buf := codec.NewBuffer(b)
   102  	m.IsDel = buf.DecodeBool()
   103  	copy(m.Localsid[:], buf.DecodeBytes(16))
   104  	m.EndPsp = buf.DecodeBool()
   105  	m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
   106  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   107  	m.VlanIndex = buf.DecodeUint32()
   108  	m.FibTable = buf.DecodeUint32()
   109  	m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   110  	copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   111  	return nil
   112  }
   113  
   114  // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
   115  type SrLocalsidAddDelReply struct {
   116  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   117  }
   118  
   119  func (m *SrLocalsidAddDelReply) Reset()               { *m = SrLocalsidAddDelReply{} }
   120  func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
   121  func (*SrLocalsidAddDelReply) GetCrcString() string   { return "e8d4e804" }
   122  func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
   123  	return api.ReplyMessage
   124  }
   125  
   126  func (m *SrLocalsidAddDelReply) Size() (size int) {
   127  	if m == nil {
   128  		return 0
   129  	}
   130  	size += 4 // m.Retval
   131  	return size
   132  }
   133  func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
   134  	if b == nil {
   135  		b = make([]byte, m.Size())
   136  	}
   137  	buf := codec.NewBuffer(b)
   138  	buf.EncodeInt32(m.Retval)
   139  	return buf.Bytes(), nil
   140  }
   141  func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
   142  	buf := codec.NewBuffer(b)
   143  	m.Retval = buf.DecodeInt32()
   144  	return nil
   145  }
   146  
   147  // SrLocalsidsDetails defines message 'sr_localsids_details'.
   148  type SrLocalsidsDetails struct {
   149  	Addr                    ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
   150  	EndPsp                  bool                `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
   151  	Behavior                sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
   152  	FibTable                uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
   153  	VlanIndex               uint32              `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
   154  	XconnectNhAddr          ip_types.Address    `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
   155  	XconnectIfaceOrVrfTable uint32              `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
   156  }
   157  
   158  func (m *SrLocalsidsDetails) Reset()               { *m = SrLocalsidsDetails{} }
   159  func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
   160  func (*SrLocalsidsDetails) GetCrcString() string   { return "2e9221b9" }
   161  func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
   162  	return api.ReplyMessage
   163  }
   164  
   165  func (m *SrLocalsidsDetails) Size() (size int) {
   166  	if m == nil {
   167  		return 0
   168  	}
   169  	size += 1 * 16 // m.Addr
   170  	size += 1      // m.EndPsp
   171  	size += 1      // m.Behavior
   172  	size += 4      // m.FibTable
   173  	size += 4      // m.VlanIndex
   174  	size += 1      // m.XconnectNhAddr.Af
   175  	size += 1 * 16 // m.XconnectNhAddr.Un
   176  	size += 4      // m.XconnectIfaceOrVrfTable
   177  	return size
   178  }
   179  func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
   180  	if b == nil {
   181  		b = make([]byte, m.Size())
   182  	}
   183  	buf := codec.NewBuffer(b)
   184  	buf.EncodeBytes(m.Addr[:], 16)
   185  	buf.EncodeBool(m.EndPsp)
   186  	buf.EncodeUint8(uint8(m.Behavior))
   187  	buf.EncodeUint32(m.FibTable)
   188  	buf.EncodeUint32(m.VlanIndex)
   189  	buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
   190  	buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16)
   191  	buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
   192  	return buf.Bytes(), nil
   193  }
   194  func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
   195  	buf := codec.NewBuffer(b)
   196  	copy(m.Addr[:], buf.DecodeBytes(16))
   197  	m.EndPsp = buf.DecodeBool()
   198  	m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
   199  	m.FibTable = buf.DecodeUint32()
   200  	m.VlanIndex = buf.DecodeUint32()
   201  	m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   202  	copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   203  	m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
   204  	return nil
   205  }
   206  
   207  // SrLocalsidsDump defines message 'sr_localsids_dump'.
   208  type SrLocalsidsDump struct{}
   209  
   210  func (m *SrLocalsidsDump) Reset()               { *m = SrLocalsidsDump{} }
   211  func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
   212  func (*SrLocalsidsDump) GetCrcString() string   { return "51077d14" }
   213  func (*SrLocalsidsDump) GetMessageType() api.MessageType {
   214  	return api.RequestMessage
   215  }
   216  
   217  func (m *SrLocalsidsDump) Size() (size int) {
   218  	if m == nil {
   219  		return 0
   220  	}
   221  	return size
   222  }
   223  func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
   224  	if b == nil {
   225  		b = make([]byte, m.Size())
   226  	}
   227  	buf := codec.NewBuffer(b)
   228  	return buf.Bytes(), nil
   229  }
   230  func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
   231  	return nil
   232  }
   233  
   234  // SrLocalsidsWithPacketStatsDetails defines message 'sr_localsids_with_packet_stats_details'.
   235  // InProgress: the message form may change in the future versions
   236  type SrLocalsidsWithPacketStatsDetails struct {
   237  	Addr                    ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
   238  	EndPsp                  bool                `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
   239  	Behavior                sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
   240  	FibTable                uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
   241  	VlanIndex               uint32              `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
   242  	XconnectNhAddr          ip_types.Address    `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
   243  	XconnectIfaceOrVrfTable uint32              `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
   244  	GoodTrafficBytes        uint64              `binapi:"u64,name=good_traffic_bytes" json:"good_traffic_bytes,omitempty"`
   245  	GoodTrafficPktCount     uint64              `binapi:"u64,name=good_traffic_pkt_count" json:"good_traffic_pkt_count,omitempty"`
   246  	BadTrafficBytes         uint64              `binapi:"u64,name=bad_traffic_bytes" json:"bad_traffic_bytes,omitempty"`
   247  	BadTrafficPktCount      uint64              `binapi:"u64,name=bad_traffic_pkt_count" json:"bad_traffic_pkt_count,omitempty"`
   248  }
   249  
   250  func (m *SrLocalsidsWithPacketStatsDetails) Reset() { *m = SrLocalsidsWithPacketStatsDetails{} }
   251  func (*SrLocalsidsWithPacketStatsDetails) GetMessageName() string {
   252  	return "sr_localsids_with_packet_stats_details"
   253  }
   254  func (*SrLocalsidsWithPacketStatsDetails) GetCrcString() string { return "ce0b1ce0" }
   255  func (*SrLocalsidsWithPacketStatsDetails) GetMessageType() api.MessageType {
   256  	return api.ReplyMessage
   257  }
   258  
   259  func (m *SrLocalsidsWithPacketStatsDetails) Size() (size int) {
   260  	if m == nil {
   261  		return 0
   262  	}
   263  	size += 1 * 16 // m.Addr
   264  	size += 1      // m.EndPsp
   265  	size += 1      // m.Behavior
   266  	size += 4      // m.FibTable
   267  	size += 4      // m.VlanIndex
   268  	size += 1      // m.XconnectNhAddr.Af
   269  	size += 1 * 16 // m.XconnectNhAddr.Un
   270  	size += 4      // m.XconnectIfaceOrVrfTable
   271  	size += 8      // m.GoodTrafficBytes
   272  	size += 8      // m.GoodTrafficPktCount
   273  	size += 8      // m.BadTrafficBytes
   274  	size += 8      // m.BadTrafficPktCount
   275  	return size
   276  }
   277  func (m *SrLocalsidsWithPacketStatsDetails) Marshal(b []byte) ([]byte, error) {
   278  	if b == nil {
   279  		b = make([]byte, m.Size())
   280  	}
   281  	buf := codec.NewBuffer(b)
   282  	buf.EncodeBytes(m.Addr[:], 16)
   283  	buf.EncodeBool(m.EndPsp)
   284  	buf.EncodeUint8(uint8(m.Behavior))
   285  	buf.EncodeUint32(m.FibTable)
   286  	buf.EncodeUint32(m.VlanIndex)
   287  	buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
   288  	buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16)
   289  	buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
   290  	buf.EncodeUint64(m.GoodTrafficBytes)
   291  	buf.EncodeUint64(m.GoodTrafficPktCount)
   292  	buf.EncodeUint64(m.BadTrafficBytes)
   293  	buf.EncodeUint64(m.BadTrafficPktCount)
   294  	return buf.Bytes(), nil
   295  }
   296  func (m *SrLocalsidsWithPacketStatsDetails) Unmarshal(b []byte) error {
   297  	buf := codec.NewBuffer(b)
   298  	copy(m.Addr[:], buf.DecodeBytes(16))
   299  	m.EndPsp = buf.DecodeBool()
   300  	m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
   301  	m.FibTable = buf.DecodeUint32()
   302  	m.VlanIndex = buf.DecodeUint32()
   303  	m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
   304  	copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
   305  	m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
   306  	m.GoodTrafficBytes = buf.DecodeUint64()
   307  	m.GoodTrafficPktCount = buf.DecodeUint64()
   308  	m.BadTrafficBytes = buf.DecodeUint64()
   309  	m.BadTrafficPktCount = buf.DecodeUint64()
   310  	return nil
   311  }
   312  
   313  // SrLocalsidsWithPacketStatsDump defines message 'sr_localsids_with_packet_stats_dump'.
   314  // InProgress: the message form may change in the future versions
   315  type SrLocalsidsWithPacketStatsDump struct{}
   316  
   317  func (m *SrLocalsidsWithPacketStatsDump) Reset() { *m = SrLocalsidsWithPacketStatsDump{} }
   318  func (*SrLocalsidsWithPacketStatsDump) GetMessageName() string {
   319  	return "sr_localsids_with_packet_stats_dump"
   320  }
   321  func (*SrLocalsidsWithPacketStatsDump) GetCrcString() string { return "51077d14" }
   322  func (*SrLocalsidsWithPacketStatsDump) GetMessageType() api.MessageType {
   323  	return api.RequestMessage
   324  }
   325  
   326  func (m *SrLocalsidsWithPacketStatsDump) Size() (size int) {
   327  	if m == nil {
   328  		return 0
   329  	}
   330  	return size
   331  }
   332  func (m *SrLocalsidsWithPacketStatsDump) Marshal(b []byte) ([]byte, error) {
   333  	if b == nil {
   334  		b = make([]byte, m.Size())
   335  	}
   336  	buf := codec.NewBuffer(b)
   337  	return buf.Bytes(), nil
   338  }
   339  func (m *SrLocalsidsWithPacketStatsDump) Unmarshal(b []byte) error {
   340  	return nil
   341  }
   342  
   343  // SrPoliciesDetails defines message 'sr_policies_details'.
   344  type SrPoliciesDetails struct {
   345  	Bsid        ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
   346  	IsSpray     bool                `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
   347  	IsEncap     bool                `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
   348  	FibTable    uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
   349  	NumSidLists uint8               `binapi:"u8,name=num_sid_lists" json:"-"`
   350  	SidLists    []Srv6SidList       `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
   351  }
   352  
   353  func (m *SrPoliciesDetails) Reset()               { *m = SrPoliciesDetails{} }
   354  func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
   355  func (*SrPoliciesDetails) GetCrcString() string   { return "db6ff2a1" }
   356  func (*SrPoliciesDetails) GetMessageType() api.MessageType {
   357  	return api.ReplyMessage
   358  }
   359  
   360  func (m *SrPoliciesDetails) Size() (size int) {
   361  	if m == nil {
   362  		return 0
   363  	}
   364  	size += 1 * 16 // m.Bsid
   365  	size += 1      // m.IsSpray
   366  	size += 1      // m.IsEncap
   367  	size += 4      // m.FibTable
   368  	size += 1      // m.NumSidLists
   369  	for j1 := 0; j1 < len(m.SidLists); j1++ {
   370  		var s1 Srv6SidList
   371  		_ = s1
   372  		if j1 < len(m.SidLists) {
   373  			s1 = m.SidLists[j1]
   374  		}
   375  		size += 1 // s1.NumSids
   376  		size += 4 // s1.Weight
   377  		for j2 := 0; j2 < 16; j2++ {
   378  			size += 1 * 16 // s1.Sids[j2]
   379  		}
   380  	}
   381  	return size
   382  }
   383  func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
   384  	if b == nil {
   385  		b = make([]byte, m.Size())
   386  	}
   387  	buf := codec.NewBuffer(b)
   388  	buf.EncodeBytes(m.Bsid[:], 16)
   389  	buf.EncodeBool(m.IsSpray)
   390  	buf.EncodeBool(m.IsEncap)
   391  	buf.EncodeUint32(m.FibTable)
   392  	buf.EncodeUint8(uint8(len(m.SidLists)))
   393  	for j0 := 0; j0 < len(m.SidLists); j0++ {
   394  		var v0 Srv6SidList // SidLists
   395  		if j0 < len(m.SidLists) {
   396  			v0 = m.SidLists[j0]
   397  		}
   398  		buf.EncodeUint8(v0.NumSids)
   399  		buf.EncodeUint32(v0.Weight)
   400  		for j1 := 0; j1 < 16; j1++ {
   401  			buf.EncodeBytes(v0.Sids[j1][:], 16)
   402  		}
   403  	}
   404  	return buf.Bytes(), nil
   405  }
   406  func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
   407  	buf := codec.NewBuffer(b)
   408  	copy(m.Bsid[:], buf.DecodeBytes(16))
   409  	m.IsSpray = buf.DecodeBool()
   410  	m.IsEncap = buf.DecodeBool()
   411  	m.FibTable = buf.DecodeUint32()
   412  	m.NumSidLists = buf.DecodeUint8()
   413  	m.SidLists = make([]Srv6SidList, m.NumSidLists)
   414  	for j0 := 0; j0 < len(m.SidLists); j0++ {
   415  		m.SidLists[j0].NumSids = buf.DecodeUint8()
   416  		m.SidLists[j0].Weight = buf.DecodeUint32()
   417  		for j1 := 0; j1 < 16; j1++ {
   418  			copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
   419  		}
   420  	}
   421  	return nil
   422  }
   423  
   424  // SrPoliciesDump defines message 'sr_policies_dump'.
   425  type SrPoliciesDump struct{}
   426  
   427  func (m *SrPoliciesDump) Reset()               { *m = SrPoliciesDump{} }
   428  func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
   429  func (*SrPoliciesDump) GetCrcString() string   { return "51077d14" }
   430  func (*SrPoliciesDump) GetMessageType() api.MessageType {
   431  	return api.RequestMessage
   432  }
   433  
   434  func (m *SrPoliciesDump) Size() (size int) {
   435  	if m == nil {
   436  		return 0
   437  	}
   438  	return size
   439  }
   440  func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
   441  	if b == nil {
   442  		b = make([]byte, m.Size())
   443  	}
   444  	buf := codec.NewBuffer(b)
   445  	return buf.Bytes(), nil
   446  }
   447  func (m *SrPoliciesDump) Unmarshal(b []byte) error {
   448  	return nil
   449  }
   450  
   451  // SrPoliciesWithSlIndexDetails defines message 'sr_policies_with_sl_index_details'.
   452  // InProgress: the message form may change in the future versions
   453  type SrPoliciesWithSlIndexDetails struct {
   454  	Bsid        ip_types.IP6Address      `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
   455  	IsSpray     bool                     `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
   456  	IsEncap     bool                     `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
   457  	FibTable    uint32                   `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
   458  	NumSidLists uint8                    `binapi:"u8,name=num_sid_lists" json:"-"`
   459  	SidLists    []Srv6SidListWithSlIndex `binapi:"srv6_sid_list_with_sl_index[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
   460  }
   461  
   462  func (m *SrPoliciesWithSlIndexDetails) Reset() { *m = SrPoliciesWithSlIndexDetails{} }
   463  func (*SrPoliciesWithSlIndexDetails) GetMessageName() string {
   464  	return "sr_policies_with_sl_index_details"
   465  }
   466  func (*SrPoliciesWithSlIndexDetails) GetCrcString() string { return "ca2e9bc8" }
   467  func (*SrPoliciesWithSlIndexDetails) GetMessageType() api.MessageType {
   468  	return api.ReplyMessage
   469  }
   470  
   471  func (m *SrPoliciesWithSlIndexDetails) Size() (size int) {
   472  	if m == nil {
   473  		return 0
   474  	}
   475  	size += 1 * 16 // m.Bsid
   476  	size += 1      // m.IsSpray
   477  	size += 1      // m.IsEncap
   478  	size += 4      // m.FibTable
   479  	size += 1      // m.NumSidLists
   480  	for j1 := 0; j1 < len(m.SidLists); j1++ {
   481  		var s1 Srv6SidListWithSlIndex
   482  		_ = s1
   483  		if j1 < len(m.SidLists) {
   484  			s1 = m.SidLists[j1]
   485  		}
   486  		size += 1 // s1.NumSids
   487  		size += 4 // s1.Weight
   488  		size += 4 // s1.SlIndex
   489  		for j2 := 0; j2 < 16; j2++ {
   490  			size += 1 * 16 // s1.Sids[j2]
   491  		}
   492  	}
   493  	return size
   494  }
   495  func (m *SrPoliciesWithSlIndexDetails) Marshal(b []byte) ([]byte, error) {
   496  	if b == nil {
   497  		b = make([]byte, m.Size())
   498  	}
   499  	buf := codec.NewBuffer(b)
   500  	buf.EncodeBytes(m.Bsid[:], 16)
   501  	buf.EncodeBool(m.IsSpray)
   502  	buf.EncodeBool(m.IsEncap)
   503  	buf.EncodeUint32(m.FibTable)
   504  	buf.EncodeUint8(uint8(len(m.SidLists)))
   505  	for j0 := 0; j0 < len(m.SidLists); j0++ {
   506  		var v0 Srv6SidListWithSlIndex // SidLists
   507  		if j0 < len(m.SidLists) {
   508  			v0 = m.SidLists[j0]
   509  		}
   510  		buf.EncodeUint8(v0.NumSids)
   511  		buf.EncodeUint32(v0.Weight)
   512  		buf.EncodeUint32(v0.SlIndex)
   513  		for j1 := 0; j1 < 16; j1++ {
   514  			buf.EncodeBytes(v0.Sids[j1][:], 16)
   515  		}
   516  	}
   517  	return buf.Bytes(), nil
   518  }
   519  func (m *SrPoliciesWithSlIndexDetails) Unmarshal(b []byte) error {
   520  	buf := codec.NewBuffer(b)
   521  	copy(m.Bsid[:], buf.DecodeBytes(16))
   522  	m.IsSpray = buf.DecodeBool()
   523  	m.IsEncap = buf.DecodeBool()
   524  	m.FibTable = buf.DecodeUint32()
   525  	m.NumSidLists = buf.DecodeUint8()
   526  	m.SidLists = make([]Srv6SidListWithSlIndex, m.NumSidLists)
   527  	for j0 := 0; j0 < len(m.SidLists); j0++ {
   528  		m.SidLists[j0].NumSids = buf.DecodeUint8()
   529  		m.SidLists[j0].Weight = buf.DecodeUint32()
   530  		m.SidLists[j0].SlIndex = buf.DecodeUint32()
   531  		for j1 := 0; j1 < 16; j1++ {
   532  			copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
   533  		}
   534  	}
   535  	return nil
   536  }
   537  
   538  // SrPoliciesWithSlIndexDump defines message 'sr_policies_with_sl_index_dump'.
   539  // InProgress: the message form may change in the future versions
   540  type SrPoliciesWithSlIndexDump struct{}
   541  
   542  func (m *SrPoliciesWithSlIndexDump) Reset()               { *m = SrPoliciesWithSlIndexDump{} }
   543  func (*SrPoliciesWithSlIndexDump) GetMessageName() string { return "sr_policies_with_sl_index_dump" }
   544  func (*SrPoliciesWithSlIndexDump) GetCrcString() string   { return "51077d14" }
   545  func (*SrPoliciesWithSlIndexDump) GetMessageType() api.MessageType {
   546  	return api.RequestMessage
   547  }
   548  
   549  func (m *SrPoliciesWithSlIndexDump) Size() (size int) {
   550  	if m == nil {
   551  		return 0
   552  	}
   553  	return size
   554  }
   555  func (m *SrPoliciesWithSlIndexDump) Marshal(b []byte) ([]byte, error) {
   556  	if b == nil {
   557  		b = make([]byte, m.Size())
   558  	}
   559  	buf := codec.NewBuffer(b)
   560  	return buf.Bytes(), nil
   561  }
   562  func (m *SrPoliciesWithSlIndexDump) Unmarshal(b []byte) error {
   563  	return nil
   564  }
   565  
   566  // SrPolicyAdd defines message 'sr_policy_add'.
   567  type SrPolicyAdd struct {
   568  	BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
   569  	Weight   uint32              `binapi:"u32,name=weight" json:"weight,omitempty"`
   570  	IsEncap  bool                `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
   571  	IsSpray  bool                `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
   572  	FibTable uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
   573  	Sids     Srv6SidList         `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
   574  }
   575  
   576  func (m *SrPolicyAdd) Reset()               { *m = SrPolicyAdd{} }
   577  func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
   578  func (*SrPolicyAdd) GetCrcString() string   { return "44ac92e8" }
   579  func (*SrPolicyAdd) GetMessageType() api.MessageType {
   580  	return api.RequestMessage
   581  }
   582  
   583  func (m *SrPolicyAdd) Size() (size int) {
   584  	if m == nil {
   585  		return 0
   586  	}
   587  	size += 1 * 16 // m.BsidAddr
   588  	size += 4      // m.Weight
   589  	size += 1      // m.IsEncap
   590  	size += 1      // m.IsSpray
   591  	size += 4      // m.FibTable
   592  	size += 1      // m.Sids.NumSids
   593  	size += 4      // m.Sids.Weight
   594  	for j2 := 0; j2 < 16; j2++ {
   595  		size += 1 * 16 // m.Sids.Sids[j2]
   596  	}
   597  	return size
   598  }
   599  func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
   600  	if b == nil {
   601  		b = make([]byte, m.Size())
   602  	}
   603  	buf := codec.NewBuffer(b)
   604  	buf.EncodeBytes(m.BsidAddr[:], 16)
   605  	buf.EncodeUint32(m.Weight)
   606  	buf.EncodeBool(m.IsEncap)
   607  	buf.EncodeBool(m.IsSpray)
   608  	buf.EncodeUint32(m.FibTable)
   609  	buf.EncodeUint8(m.Sids.NumSids)
   610  	buf.EncodeUint32(m.Sids.Weight)
   611  	for j1 := 0; j1 < 16; j1++ {
   612  		buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
   613  	}
   614  	return buf.Bytes(), nil
   615  }
   616  func (m *SrPolicyAdd) Unmarshal(b []byte) error {
   617  	buf := codec.NewBuffer(b)
   618  	copy(m.BsidAddr[:], buf.DecodeBytes(16))
   619  	m.Weight = buf.DecodeUint32()
   620  	m.IsEncap = buf.DecodeBool()
   621  	m.IsSpray = buf.DecodeBool()
   622  	m.FibTable = buf.DecodeUint32()
   623  	m.Sids.NumSids = buf.DecodeUint8()
   624  	m.Sids.Weight = buf.DecodeUint32()
   625  	for j1 := 0; j1 < 16; j1++ {
   626  		copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
   627  	}
   628  	return nil
   629  }
   630  
   631  // SrPolicyAddReply defines message 'sr_policy_add_reply'.
   632  type SrPolicyAddReply struct {
   633  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   634  }
   635  
   636  func (m *SrPolicyAddReply) Reset()               { *m = SrPolicyAddReply{} }
   637  func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
   638  func (*SrPolicyAddReply) GetCrcString() string   { return "e8d4e804" }
   639  func (*SrPolicyAddReply) GetMessageType() api.MessageType {
   640  	return api.ReplyMessage
   641  }
   642  
   643  func (m *SrPolicyAddReply) Size() (size int) {
   644  	if m == nil {
   645  		return 0
   646  	}
   647  	size += 4 // m.Retval
   648  	return size
   649  }
   650  func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
   651  	if b == nil {
   652  		b = make([]byte, m.Size())
   653  	}
   654  	buf := codec.NewBuffer(b)
   655  	buf.EncodeInt32(m.Retval)
   656  	return buf.Bytes(), nil
   657  }
   658  func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
   659  	buf := codec.NewBuffer(b)
   660  	m.Retval = buf.DecodeInt32()
   661  	return nil
   662  }
   663  
   664  // SrPolicyDel defines message 'sr_policy_del'.
   665  type SrPolicyDel struct {
   666  	BsidAddr      ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
   667  	SrPolicyIndex uint32              `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
   668  }
   669  
   670  func (m *SrPolicyDel) Reset()               { *m = SrPolicyDel{} }
   671  func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
   672  func (*SrPolicyDel) GetCrcString() string   { return "cb4d48d5" }
   673  func (*SrPolicyDel) GetMessageType() api.MessageType {
   674  	return api.RequestMessage
   675  }
   676  
   677  func (m *SrPolicyDel) Size() (size int) {
   678  	if m == nil {
   679  		return 0
   680  	}
   681  	size += 1 * 16 // m.BsidAddr
   682  	size += 4      // m.SrPolicyIndex
   683  	return size
   684  }
   685  func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
   686  	if b == nil {
   687  		b = make([]byte, m.Size())
   688  	}
   689  	buf := codec.NewBuffer(b)
   690  	buf.EncodeBytes(m.BsidAddr[:], 16)
   691  	buf.EncodeUint32(m.SrPolicyIndex)
   692  	return buf.Bytes(), nil
   693  }
   694  func (m *SrPolicyDel) Unmarshal(b []byte) error {
   695  	buf := codec.NewBuffer(b)
   696  	copy(m.BsidAddr[:], buf.DecodeBytes(16))
   697  	m.SrPolicyIndex = buf.DecodeUint32()
   698  	return nil
   699  }
   700  
   701  // SrPolicyDelReply defines message 'sr_policy_del_reply'.
   702  type SrPolicyDelReply struct {
   703  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   704  }
   705  
   706  func (m *SrPolicyDelReply) Reset()               { *m = SrPolicyDelReply{} }
   707  func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
   708  func (*SrPolicyDelReply) GetCrcString() string   { return "e8d4e804" }
   709  func (*SrPolicyDelReply) GetMessageType() api.MessageType {
   710  	return api.ReplyMessage
   711  }
   712  
   713  func (m *SrPolicyDelReply) Size() (size int) {
   714  	if m == nil {
   715  		return 0
   716  	}
   717  	size += 4 // m.Retval
   718  	return size
   719  }
   720  func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
   721  	if b == nil {
   722  		b = make([]byte, m.Size())
   723  	}
   724  	buf := codec.NewBuffer(b)
   725  	buf.EncodeInt32(m.Retval)
   726  	return buf.Bytes(), nil
   727  }
   728  func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
   729  	buf := codec.NewBuffer(b)
   730  	m.Retval = buf.DecodeInt32()
   731  	return nil
   732  }
   733  
   734  // SrPolicyMod defines message 'sr_policy_mod'.
   735  type SrPolicyMod struct {
   736  	BsidAddr      ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
   737  	SrPolicyIndex uint32              `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
   738  	FibTable      uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
   739  	Operation     sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
   740  	SlIndex       uint32              `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
   741  	Weight        uint32              `binapi:"u32,name=weight" json:"weight,omitempty"`
   742  	Sids          Srv6SidList         `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
   743  }
   744  
   745  func (m *SrPolicyMod) Reset()               { *m = SrPolicyMod{} }
   746  func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
   747  func (*SrPolicyMod) GetCrcString() string   { return "b97bb56e" }
   748  func (*SrPolicyMod) GetMessageType() api.MessageType {
   749  	return api.RequestMessage
   750  }
   751  
   752  func (m *SrPolicyMod) Size() (size int) {
   753  	if m == nil {
   754  		return 0
   755  	}
   756  	size += 1 * 16 // m.BsidAddr
   757  	size += 4      // m.SrPolicyIndex
   758  	size += 4      // m.FibTable
   759  	size += 1      // m.Operation
   760  	size += 4      // m.SlIndex
   761  	size += 4      // m.Weight
   762  	size += 1      // m.Sids.NumSids
   763  	size += 4      // m.Sids.Weight
   764  	for j2 := 0; j2 < 16; j2++ {
   765  		size += 1 * 16 // m.Sids.Sids[j2]
   766  	}
   767  	return size
   768  }
   769  func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
   770  	if b == nil {
   771  		b = make([]byte, m.Size())
   772  	}
   773  	buf := codec.NewBuffer(b)
   774  	buf.EncodeBytes(m.BsidAddr[:], 16)
   775  	buf.EncodeUint32(m.SrPolicyIndex)
   776  	buf.EncodeUint32(m.FibTable)
   777  	buf.EncodeUint8(uint8(m.Operation))
   778  	buf.EncodeUint32(m.SlIndex)
   779  	buf.EncodeUint32(m.Weight)
   780  	buf.EncodeUint8(m.Sids.NumSids)
   781  	buf.EncodeUint32(m.Sids.Weight)
   782  	for j1 := 0; j1 < 16; j1++ {
   783  		buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
   784  	}
   785  	return buf.Bytes(), nil
   786  }
   787  func (m *SrPolicyMod) Unmarshal(b []byte) error {
   788  	buf := codec.NewBuffer(b)
   789  	copy(m.BsidAddr[:], buf.DecodeBytes(16))
   790  	m.SrPolicyIndex = buf.DecodeUint32()
   791  	m.FibTable = buf.DecodeUint32()
   792  	m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
   793  	m.SlIndex = buf.DecodeUint32()
   794  	m.Weight = buf.DecodeUint32()
   795  	m.Sids.NumSids = buf.DecodeUint8()
   796  	m.Sids.Weight = buf.DecodeUint32()
   797  	for j1 := 0; j1 < 16; j1++ {
   798  		copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
   799  	}
   800  	return nil
   801  }
   802  
   803  // SrPolicyModReply defines message 'sr_policy_mod_reply'.
   804  type SrPolicyModReply struct {
   805  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   806  }
   807  
   808  func (m *SrPolicyModReply) Reset()               { *m = SrPolicyModReply{} }
   809  func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
   810  func (*SrPolicyModReply) GetCrcString() string   { return "e8d4e804" }
   811  func (*SrPolicyModReply) GetMessageType() api.MessageType {
   812  	return api.ReplyMessage
   813  }
   814  
   815  func (m *SrPolicyModReply) Size() (size int) {
   816  	if m == nil {
   817  		return 0
   818  	}
   819  	size += 4 // m.Retval
   820  	return size
   821  }
   822  func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
   823  	if b == nil {
   824  		b = make([]byte, m.Size())
   825  	}
   826  	buf := codec.NewBuffer(b)
   827  	buf.EncodeInt32(m.Retval)
   828  	return buf.Bytes(), nil
   829  }
   830  func (m *SrPolicyModReply) Unmarshal(b []byte) error {
   831  	buf := codec.NewBuffer(b)
   832  	m.Retval = buf.DecodeInt32()
   833  	return nil
   834  }
   835  
   836  // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
   837  type SrSetEncapHopLimit struct {
   838  	HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
   839  }
   840  
   841  func (m *SrSetEncapHopLimit) Reset()               { *m = SrSetEncapHopLimit{} }
   842  func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
   843  func (*SrSetEncapHopLimit) GetCrcString() string   { return "aa75d7d0" }
   844  func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
   845  	return api.RequestMessage
   846  }
   847  
   848  func (m *SrSetEncapHopLimit) Size() (size int) {
   849  	if m == nil {
   850  		return 0
   851  	}
   852  	size += 1 // m.HopLimit
   853  	return size
   854  }
   855  func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
   856  	if b == nil {
   857  		b = make([]byte, m.Size())
   858  	}
   859  	buf := codec.NewBuffer(b)
   860  	buf.EncodeUint8(m.HopLimit)
   861  	return buf.Bytes(), nil
   862  }
   863  func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
   864  	buf := codec.NewBuffer(b)
   865  	m.HopLimit = buf.DecodeUint8()
   866  	return nil
   867  }
   868  
   869  // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
   870  type SrSetEncapHopLimitReply struct {
   871  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   872  }
   873  
   874  func (m *SrSetEncapHopLimitReply) Reset()               { *m = SrSetEncapHopLimitReply{} }
   875  func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
   876  func (*SrSetEncapHopLimitReply) GetCrcString() string   { return "e8d4e804" }
   877  func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
   878  	return api.ReplyMessage
   879  }
   880  
   881  func (m *SrSetEncapHopLimitReply) Size() (size int) {
   882  	if m == nil {
   883  		return 0
   884  	}
   885  	size += 4 // m.Retval
   886  	return size
   887  }
   888  func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
   889  	if b == nil {
   890  		b = make([]byte, m.Size())
   891  	}
   892  	buf := codec.NewBuffer(b)
   893  	buf.EncodeInt32(m.Retval)
   894  	return buf.Bytes(), nil
   895  }
   896  func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
   897  	buf := codec.NewBuffer(b)
   898  	m.Retval = buf.DecodeInt32()
   899  	return nil
   900  }
   901  
   902  // SrSetEncapSource defines message 'sr_set_encap_source'.
   903  type SrSetEncapSource struct {
   904  	EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
   905  }
   906  
   907  func (m *SrSetEncapSource) Reset()               { *m = SrSetEncapSource{} }
   908  func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
   909  func (*SrSetEncapSource) GetCrcString() string   { return "d3bad5e1" }
   910  func (*SrSetEncapSource) GetMessageType() api.MessageType {
   911  	return api.RequestMessage
   912  }
   913  
   914  func (m *SrSetEncapSource) Size() (size int) {
   915  	if m == nil {
   916  		return 0
   917  	}
   918  	size += 1 * 16 // m.EncapsSource
   919  	return size
   920  }
   921  func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
   922  	if b == nil {
   923  		b = make([]byte, m.Size())
   924  	}
   925  	buf := codec.NewBuffer(b)
   926  	buf.EncodeBytes(m.EncapsSource[:], 16)
   927  	return buf.Bytes(), nil
   928  }
   929  func (m *SrSetEncapSource) Unmarshal(b []byte) error {
   930  	buf := codec.NewBuffer(b)
   931  	copy(m.EncapsSource[:], buf.DecodeBytes(16))
   932  	return nil
   933  }
   934  
   935  // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
   936  type SrSetEncapSourceReply struct {
   937  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   938  }
   939  
   940  func (m *SrSetEncapSourceReply) Reset()               { *m = SrSetEncapSourceReply{} }
   941  func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
   942  func (*SrSetEncapSourceReply) GetCrcString() string   { return "e8d4e804" }
   943  func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
   944  	return api.ReplyMessage
   945  }
   946  
   947  func (m *SrSetEncapSourceReply) Size() (size int) {
   948  	if m == nil {
   949  		return 0
   950  	}
   951  	size += 4 // m.Retval
   952  	return size
   953  }
   954  func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
   955  	if b == nil {
   956  		b = make([]byte, m.Size())
   957  	}
   958  	buf := codec.NewBuffer(b)
   959  	buf.EncodeInt32(m.Retval)
   960  	return buf.Bytes(), nil
   961  }
   962  func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
   963  	buf := codec.NewBuffer(b)
   964  	m.Retval = buf.DecodeInt32()
   965  	return nil
   966  }
   967  
   968  // SrSteeringAddDel defines message 'sr_steering_add_del'.
   969  type SrSteeringAddDel struct {
   970  	IsDel         bool                           `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
   971  	BsidAddr      ip_types.IP6Address            `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
   972  	SrPolicyIndex uint32                         `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
   973  	TableID       uint32                         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
   974  	Prefix        ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
   975  	SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   976  	TrafficType   sr_types.SrSteer               `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
   977  }
   978  
   979  func (m *SrSteeringAddDel) Reset()               { *m = SrSteeringAddDel{} }
   980  func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
   981  func (*SrSteeringAddDel) GetCrcString() string   { return "e46b0a0f" }
   982  func (*SrSteeringAddDel) GetMessageType() api.MessageType {
   983  	return api.RequestMessage
   984  }
   985  
   986  func (m *SrSteeringAddDel) Size() (size int) {
   987  	if m == nil {
   988  		return 0
   989  	}
   990  	size += 1      // m.IsDel
   991  	size += 1 * 16 // m.BsidAddr
   992  	size += 4      // m.SrPolicyIndex
   993  	size += 4      // m.TableID
   994  	size += 1      // m.Prefix.Address.Af
   995  	size += 1 * 16 // m.Prefix.Address.Un
   996  	size += 1      // m.Prefix.Len
   997  	size += 4      // m.SwIfIndex
   998  	size += 1      // m.TrafficType
   999  	return size
  1000  }
  1001  func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
  1002  	if b == nil {
  1003  		b = make([]byte, m.Size())
  1004  	}
  1005  	buf := codec.NewBuffer(b)
  1006  	buf.EncodeBool(m.IsDel)
  1007  	buf.EncodeBytes(m.BsidAddr[:], 16)
  1008  	buf.EncodeUint32(m.SrPolicyIndex)
  1009  	buf.EncodeUint32(m.TableID)
  1010  	buf.EncodeUint8(uint8(m.Prefix.Address.Af))
  1011  	buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
  1012  	buf.EncodeUint8(m.Prefix.Len)
  1013  	buf.EncodeUint32(uint32(m.SwIfIndex))
  1014  	buf.EncodeUint8(uint8(m.TrafficType))
  1015  	return buf.Bytes(), nil
  1016  }
  1017  func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
  1018  	buf := codec.NewBuffer(b)
  1019  	m.IsDel = buf.DecodeBool()
  1020  	copy(m.BsidAddr[:], buf.DecodeBytes(16))
  1021  	m.SrPolicyIndex = buf.DecodeUint32()
  1022  	m.TableID = buf.DecodeUint32()
  1023  	m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
  1024  	copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  1025  	m.Prefix.Len = buf.DecodeUint8()
  1026  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
  1027  	m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
  1028  	return nil
  1029  }
  1030  
  1031  // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
  1032  type SrSteeringAddDelReply struct {
  1033  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1034  }
  1035  
  1036  func (m *SrSteeringAddDelReply) Reset()               { *m = SrSteeringAddDelReply{} }
  1037  func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
  1038  func (*SrSteeringAddDelReply) GetCrcString() string   { return "e8d4e804" }
  1039  func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
  1040  	return api.ReplyMessage
  1041  }
  1042  
  1043  func (m *SrSteeringAddDelReply) Size() (size int) {
  1044  	if m == nil {
  1045  		return 0
  1046  	}
  1047  	size += 4 // m.Retval
  1048  	return size
  1049  }
  1050  func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
  1051  	if b == nil {
  1052  		b = make([]byte, m.Size())
  1053  	}
  1054  	buf := codec.NewBuffer(b)
  1055  	buf.EncodeInt32(m.Retval)
  1056  	return buf.Bytes(), nil
  1057  }
  1058  func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
  1059  	buf := codec.NewBuffer(b)
  1060  	m.Retval = buf.DecodeInt32()
  1061  	return nil
  1062  }
  1063  
  1064  // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
  1065  type SrSteeringPolDetails struct {
  1066  	TrafficType sr_types.SrSteer               `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
  1067  	FibTable    uint32                         `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
  1068  	Prefix      ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
  1069  	SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
  1070  	Bsid        ip_types.IP6Address            `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
  1071  }
  1072  
  1073  func (m *SrSteeringPolDetails) Reset()               { *m = SrSteeringPolDetails{} }
  1074  func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
  1075  func (*SrSteeringPolDetails) GetCrcString() string   { return "d41258c9" }
  1076  func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
  1077  	return api.ReplyMessage
  1078  }
  1079  
  1080  func (m *SrSteeringPolDetails) Size() (size int) {
  1081  	if m == nil {
  1082  		return 0
  1083  	}
  1084  	size += 1      // m.TrafficType
  1085  	size += 4      // m.FibTable
  1086  	size += 1      // m.Prefix.Address.Af
  1087  	size += 1 * 16 // m.Prefix.Address.Un
  1088  	size += 1      // m.Prefix.Len
  1089  	size += 4      // m.SwIfIndex
  1090  	size += 1 * 16 // m.Bsid
  1091  	return size
  1092  }
  1093  func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
  1094  	if b == nil {
  1095  		b = make([]byte, m.Size())
  1096  	}
  1097  	buf := codec.NewBuffer(b)
  1098  	buf.EncodeUint8(uint8(m.TrafficType))
  1099  	buf.EncodeUint32(m.FibTable)
  1100  	buf.EncodeUint8(uint8(m.Prefix.Address.Af))
  1101  	buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
  1102  	buf.EncodeUint8(m.Prefix.Len)
  1103  	buf.EncodeUint32(uint32(m.SwIfIndex))
  1104  	buf.EncodeBytes(m.Bsid[:], 16)
  1105  	return buf.Bytes(), nil
  1106  }
  1107  func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
  1108  	buf := codec.NewBuffer(b)
  1109  	m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
  1110  	m.FibTable = buf.DecodeUint32()
  1111  	m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
  1112  	copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
  1113  	m.Prefix.Len = buf.DecodeUint8()
  1114  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
  1115  	copy(m.Bsid[:], buf.DecodeBytes(16))
  1116  	return nil
  1117  }
  1118  
  1119  // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
  1120  type SrSteeringPolDump struct{}
  1121  
  1122  func (m *SrSteeringPolDump) Reset()               { *m = SrSteeringPolDump{} }
  1123  func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
  1124  func (*SrSteeringPolDump) GetCrcString() string   { return "51077d14" }
  1125  func (*SrSteeringPolDump) GetMessageType() api.MessageType {
  1126  	return api.RequestMessage
  1127  }
  1128  
  1129  func (m *SrSteeringPolDump) Size() (size int) {
  1130  	if m == nil {
  1131  		return 0
  1132  	}
  1133  	return size
  1134  }
  1135  func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
  1136  	if b == nil {
  1137  		b = make([]byte, m.Size())
  1138  	}
  1139  	buf := codec.NewBuffer(b)
  1140  	return buf.Bytes(), nil
  1141  }
  1142  func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
  1143  	return nil
  1144  }
  1145  
  1146  func init() { file_sr_binapi_init() }
  1147  func file_sr_binapi_init() {
  1148  	api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_5a36c324")
  1149  	api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
  1150  	api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_2e9221b9")
  1151  	api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
  1152  	api.RegisterMessage((*SrLocalsidsWithPacketStatsDetails)(nil), "sr_localsids_with_packet_stats_details_ce0b1ce0")
  1153  	api.RegisterMessage((*SrLocalsidsWithPacketStatsDump)(nil), "sr_localsids_with_packet_stats_dump_51077d14")
  1154  	api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_db6ff2a1")
  1155  	api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
  1156  	api.RegisterMessage((*SrPoliciesWithSlIndexDetails)(nil), "sr_policies_with_sl_index_details_ca2e9bc8")
  1157  	api.RegisterMessage((*SrPoliciesWithSlIndexDump)(nil), "sr_policies_with_sl_index_dump_51077d14")
  1158  	api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_44ac92e8")
  1159  	api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
  1160  	api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5")
  1161  	api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
  1162  	api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_b97bb56e")
  1163  	api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
  1164  	api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
  1165  	api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
  1166  	api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1")
  1167  	api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
  1168  	api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_e46b0a0f")
  1169  	api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
  1170  	api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_d41258c9")
  1171  	api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
  1172  }
  1173  
  1174  // Messages returns list of all messages in this module.
  1175  func AllMessages() []api.Message {
  1176  	return []api.Message{
  1177  		(*SrLocalsidAddDel)(nil),
  1178  		(*SrLocalsidAddDelReply)(nil),
  1179  		(*SrLocalsidsDetails)(nil),
  1180  		(*SrLocalsidsDump)(nil),
  1181  		(*SrLocalsidsWithPacketStatsDetails)(nil),
  1182  		(*SrLocalsidsWithPacketStatsDump)(nil),
  1183  		(*SrPoliciesDetails)(nil),
  1184  		(*SrPoliciesDump)(nil),
  1185  		(*SrPoliciesWithSlIndexDetails)(nil),
  1186  		(*SrPoliciesWithSlIndexDump)(nil),
  1187  		(*SrPolicyAdd)(nil),
  1188  		(*SrPolicyAddReply)(nil),
  1189  		(*SrPolicyDel)(nil),
  1190  		(*SrPolicyDelReply)(nil),
  1191  		(*SrPolicyMod)(nil),
  1192  		(*SrPolicyModReply)(nil),
  1193  		(*SrSetEncapHopLimit)(nil),
  1194  		(*SrSetEncapHopLimitReply)(nil),
  1195  		(*SrSetEncapSource)(nil),
  1196  		(*SrSetEncapSourceReply)(nil),
  1197  		(*SrSteeringAddDel)(nil),
  1198  		(*SrSteeringAddDelReply)(nil),
  1199  		(*SrSteeringPolDetails)(nil),
  1200  		(*SrSteeringPolDump)(nil),
  1201  	}
  1202  }