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

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  
     3  // Package abf contains generated bindings for API file abf.api.
     4  //
     5  // Contents:
     6  // -  2 structs
     7  // - 10 messages
     8  package abf
     9  
    10  import (
    11  	api "go.fd.io/govpp/api"
    12  	codec "go.fd.io/govpp/codec"
    13  	fib_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/fib_types"
    14  	interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/interface_types"
    15  	_ "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2106/ip_types"
    16  )
    17  
    18  // This is a compile-time assertion to ensure that this generated file
    19  // is compatible with the GoVPP api package it is being compiled against.
    20  // A compilation error at this line likely means your copy of the
    21  // GoVPP api package needs to be updated.
    22  const _ = api.GoVppAPIPackageIsVersion2
    23  
    24  const (
    25  	APIFile    = "abf"
    26  	APIVersion = "1.0.0"
    27  	VersionCrc = 0xf2367b47
    28  )
    29  
    30  // AbfItfAttach defines type 'abf_itf_attach'.
    31  type AbfItfAttach struct {
    32  	PolicyID  uint32                         `binapi:"u32,name=policy_id" json:"policy_id,omitempty"`
    33  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    34  	Priority  uint32                         `binapi:"u32,name=priority" json:"priority,omitempty"`
    35  	IsIPv6    bool                           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
    36  }
    37  
    38  // AbfPolicy defines type 'abf_policy'.
    39  type AbfPolicy struct {
    40  	PolicyID uint32              `binapi:"u32,name=policy_id" json:"policy_id,omitempty"`
    41  	ACLIndex uint32              `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
    42  	NPaths   uint8               `binapi:"u8,name=n_paths" json:"-"`
    43  	Paths    []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
    44  }
    45  
    46  // AbfItfAttachAddDel defines message 'abf_itf_attach_add_del'.
    47  // InProgress: the message form may change in the future versions
    48  type AbfItfAttachAddDel struct {
    49  	IsAdd  bool         `binapi:"bool,name=is_add" json:"is_add,omitempty"`
    50  	Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"`
    51  }
    52  
    53  func (m *AbfItfAttachAddDel) Reset()               { *m = AbfItfAttachAddDel{} }
    54  func (*AbfItfAttachAddDel) GetMessageName() string { return "abf_itf_attach_add_del" }
    55  func (*AbfItfAttachAddDel) GetCrcString() string   { return "25c8621b" }
    56  func (*AbfItfAttachAddDel) GetMessageType() api.MessageType {
    57  	return api.RequestMessage
    58  }
    59  
    60  func (m *AbfItfAttachAddDel) Size() (size int) {
    61  	if m == nil {
    62  		return 0
    63  	}
    64  	size += 1 // m.IsAdd
    65  	size += 4 // m.Attach.PolicyID
    66  	size += 4 // m.Attach.SwIfIndex
    67  	size += 4 // m.Attach.Priority
    68  	size += 1 // m.Attach.IsIPv6
    69  	return size
    70  }
    71  func (m *AbfItfAttachAddDel) Marshal(b []byte) ([]byte, error) {
    72  	if b == nil {
    73  		b = make([]byte, m.Size())
    74  	}
    75  	buf := codec.NewBuffer(b)
    76  	buf.EncodeBool(m.IsAdd)
    77  	buf.EncodeUint32(m.Attach.PolicyID)
    78  	buf.EncodeUint32(uint32(m.Attach.SwIfIndex))
    79  	buf.EncodeUint32(m.Attach.Priority)
    80  	buf.EncodeBool(m.Attach.IsIPv6)
    81  	return buf.Bytes(), nil
    82  }
    83  func (m *AbfItfAttachAddDel) Unmarshal(b []byte) error {
    84  	buf := codec.NewBuffer(b)
    85  	m.IsAdd = buf.DecodeBool()
    86  	m.Attach.PolicyID = buf.DecodeUint32()
    87  	m.Attach.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
    88  	m.Attach.Priority = buf.DecodeUint32()
    89  	m.Attach.IsIPv6 = buf.DecodeBool()
    90  	return nil
    91  }
    92  
    93  // AbfItfAttachAddDelReply defines message 'abf_itf_attach_add_del_reply'.
    94  // InProgress: the message form may change in the future versions
    95  type AbfItfAttachAddDelReply struct {
    96  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
    97  }
    98  
    99  func (m *AbfItfAttachAddDelReply) Reset()               { *m = AbfItfAttachAddDelReply{} }
   100  func (*AbfItfAttachAddDelReply) GetMessageName() string { return "abf_itf_attach_add_del_reply" }
   101  func (*AbfItfAttachAddDelReply) GetCrcString() string   { return "e8d4e804" }
   102  func (*AbfItfAttachAddDelReply) GetMessageType() api.MessageType {
   103  	return api.ReplyMessage
   104  }
   105  
   106  func (m *AbfItfAttachAddDelReply) Size() (size int) {
   107  	if m == nil {
   108  		return 0
   109  	}
   110  	size += 4 // m.Retval
   111  	return size
   112  }
   113  func (m *AbfItfAttachAddDelReply) Marshal(b []byte) ([]byte, error) {
   114  	if b == nil {
   115  		b = make([]byte, m.Size())
   116  	}
   117  	buf := codec.NewBuffer(b)
   118  	buf.EncodeInt32(m.Retval)
   119  	return buf.Bytes(), nil
   120  }
   121  func (m *AbfItfAttachAddDelReply) Unmarshal(b []byte) error {
   122  	buf := codec.NewBuffer(b)
   123  	m.Retval = buf.DecodeInt32()
   124  	return nil
   125  }
   126  
   127  // AbfItfAttachDetails defines message 'abf_itf_attach_details'.
   128  // InProgress: the message form may change in the future versions
   129  type AbfItfAttachDetails struct {
   130  	Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"`
   131  }
   132  
   133  func (m *AbfItfAttachDetails) Reset()               { *m = AbfItfAttachDetails{} }
   134  func (*AbfItfAttachDetails) GetMessageName() string { return "abf_itf_attach_details" }
   135  func (*AbfItfAttachDetails) GetCrcString() string   { return "7819523e" }
   136  func (*AbfItfAttachDetails) GetMessageType() api.MessageType {
   137  	return api.ReplyMessage
   138  }
   139  
   140  func (m *AbfItfAttachDetails) Size() (size int) {
   141  	if m == nil {
   142  		return 0
   143  	}
   144  	size += 4 // m.Attach.PolicyID
   145  	size += 4 // m.Attach.SwIfIndex
   146  	size += 4 // m.Attach.Priority
   147  	size += 1 // m.Attach.IsIPv6
   148  	return size
   149  }
   150  func (m *AbfItfAttachDetails) Marshal(b []byte) ([]byte, error) {
   151  	if b == nil {
   152  		b = make([]byte, m.Size())
   153  	}
   154  	buf := codec.NewBuffer(b)
   155  	buf.EncodeUint32(m.Attach.PolicyID)
   156  	buf.EncodeUint32(uint32(m.Attach.SwIfIndex))
   157  	buf.EncodeUint32(m.Attach.Priority)
   158  	buf.EncodeBool(m.Attach.IsIPv6)
   159  	return buf.Bytes(), nil
   160  }
   161  func (m *AbfItfAttachDetails) Unmarshal(b []byte) error {
   162  	buf := codec.NewBuffer(b)
   163  	m.Attach.PolicyID = buf.DecodeUint32()
   164  	m.Attach.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   165  	m.Attach.Priority = buf.DecodeUint32()
   166  	m.Attach.IsIPv6 = buf.DecodeBool()
   167  	return nil
   168  }
   169  
   170  // AbfItfAttachDump defines message 'abf_itf_attach_dump'.
   171  // InProgress: the message form may change in the future versions
   172  type AbfItfAttachDump struct{}
   173  
   174  func (m *AbfItfAttachDump) Reset()               { *m = AbfItfAttachDump{} }
   175  func (*AbfItfAttachDump) GetMessageName() string { return "abf_itf_attach_dump" }
   176  func (*AbfItfAttachDump) GetCrcString() string   { return "51077d14" }
   177  func (*AbfItfAttachDump) GetMessageType() api.MessageType {
   178  	return api.RequestMessage
   179  }
   180  
   181  func (m *AbfItfAttachDump) Size() (size int) {
   182  	if m == nil {
   183  		return 0
   184  	}
   185  	return size
   186  }
   187  func (m *AbfItfAttachDump) Marshal(b []byte) ([]byte, error) {
   188  	if b == nil {
   189  		b = make([]byte, m.Size())
   190  	}
   191  	buf := codec.NewBuffer(b)
   192  	return buf.Bytes(), nil
   193  }
   194  func (m *AbfItfAttachDump) Unmarshal(b []byte) error {
   195  	return nil
   196  }
   197  
   198  // AbfPluginGetVersion defines message 'abf_plugin_get_version'.
   199  // InProgress: the message form may change in the future versions
   200  type AbfPluginGetVersion struct{}
   201  
   202  func (m *AbfPluginGetVersion) Reset()               { *m = AbfPluginGetVersion{} }
   203  func (*AbfPluginGetVersion) GetMessageName() string { return "abf_plugin_get_version" }
   204  func (*AbfPluginGetVersion) GetCrcString() string   { return "51077d14" }
   205  func (*AbfPluginGetVersion) GetMessageType() api.MessageType {
   206  	return api.RequestMessage
   207  }
   208  
   209  func (m *AbfPluginGetVersion) Size() (size int) {
   210  	if m == nil {
   211  		return 0
   212  	}
   213  	return size
   214  }
   215  func (m *AbfPluginGetVersion) Marshal(b []byte) ([]byte, error) {
   216  	if b == nil {
   217  		b = make([]byte, m.Size())
   218  	}
   219  	buf := codec.NewBuffer(b)
   220  	return buf.Bytes(), nil
   221  }
   222  func (m *AbfPluginGetVersion) Unmarshal(b []byte) error {
   223  	return nil
   224  }
   225  
   226  // AbfPluginGetVersionReply defines message 'abf_plugin_get_version_reply'.
   227  // InProgress: the message form may change in the future versions
   228  type AbfPluginGetVersionReply struct {
   229  	Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
   230  	Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
   231  }
   232  
   233  func (m *AbfPluginGetVersionReply) Reset()               { *m = AbfPluginGetVersionReply{} }
   234  func (*AbfPluginGetVersionReply) GetMessageName() string { return "abf_plugin_get_version_reply" }
   235  func (*AbfPluginGetVersionReply) GetCrcString() string   { return "9b32cf86" }
   236  func (*AbfPluginGetVersionReply) GetMessageType() api.MessageType {
   237  	return api.ReplyMessage
   238  }
   239  
   240  func (m *AbfPluginGetVersionReply) Size() (size int) {
   241  	if m == nil {
   242  		return 0
   243  	}
   244  	size += 4 // m.Major
   245  	size += 4 // m.Minor
   246  	return size
   247  }
   248  func (m *AbfPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
   249  	if b == nil {
   250  		b = make([]byte, m.Size())
   251  	}
   252  	buf := codec.NewBuffer(b)
   253  	buf.EncodeUint32(m.Major)
   254  	buf.EncodeUint32(m.Minor)
   255  	return buf.Bytes(), nil
   256  }
   257  func (m *AbfPluginGetVersionReply) Unmarshal(b []byte) error {
   258  	buf := codec.NewBuffer(b)
   259  	m.Major = buf.DecodeUint32()
   260  	m.Minor = buf.DecodeUint32()
   261  	return nil
   262  }
   263  
   264  // AbfPolicyAddDel defines message 'abf_policy_add_del'.
   265  // InProgress: the message form may change in the future versions
   266  type AbfPolicyAddDel struct {
   267  	IsAdd  bool      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   268  	Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"`
   269  }
   270  
   271  func (m *AbfPolicyAddDel) Reset()               { *m = AbfPolicyAddDel{} }
   272  func (*AbfPolicyAddDel) GetMessageName() string { return "abf_policy_add_del" }
   273  func (*AbfPolicyAddDel) GetCrcString() string   { return "c6131197" }
   274  func (*AbfPolicyAddDel) GetMessageType() api.MessageType {
   275  	return api.RequestMessage
   276  }
   277  
   278  func (m *AbfPolicyAddDel) Size() (size int) {
   279  	if m == nil {
   280  		return 0
   281  	}
   282  	size += 1 // m.IsAdd
   283  	size += 4 // m.Policy.PolicyID
   284  	size += 4 // m.Policy.ACLIndex
   285  	size += 1 // m.Policy.NPaths
   286  	for j2 := 0; j2 < len(m.Policy.Paths); j2++ {
   287  		var s2 fib_types.FibPath
   288  		_ = s2
   289  		if j2 < len(m.Policy.Paths) {
   290  			s2 = m.Policy.Paths[j2]
   291  		}
   292  		size += 4      // s2.SwIfIndex
   293  		size += 4      // s2.TableID
   294  		size += 4      // s2.RpfID
   295  		size += 1      // s2.Weight
   296  		size += 1      // s2.Preference
   297  		size += 4      // s2.Type
   298  		size += 4      // s2.Flags
   299  		size += 4      // s2.Proto
   300  		size += 1 * 16 // s2.Nh.Address
   301  		size += 4      // s2.Nh.ViaLabel
   302  		size += 4      // s2.Nh.ObjID
   303  		size += 4      // s2.Nh.ClassifyTableIndex
   304  		size += 1      // s2.NLabels
   305  		for j3 := 0; j3 < 16; j3++ {
   306  			size += 1 // s2.LabelStack[j3].IsUniform
   307  			size += 4 // s2.LabelStack[j3].Label
   308  			size += 1 // s2.LabelStack[j3].TTL
   309  			size += 1 // s2.LabelStack[j3].Exp
   310  		}
   311  	}
   312  	return size
   313  }
   314  func (m *AbfPolicyAddDel) Marshal(b []byte) ([]byte, error) {
   315  	if b == nil {
   316  		b = make([]byte, m.Size())
   317  	}
   318  	buf := codec.NewBuffer(b)
   319  	buf.EncodeBool(m.IsAdd)
   320  	buf.EncodeUint32(m.Policy.PolicyID)
   321  	buf.EncodeUint32(m.Policy.ACLIndex)
   322  	buf.EncodeUint8(uint8(len(m.Policy.Paths)))
   323  	for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
   324  		var v1 fib_types.FibPath // Paths
   325  		if j1 < len(m.Policy.Paths) {
   326  			v1 = m.Policy.Paths[j1]
   327  		}
   328  		buf.EncodeUint32(v1.SwIfIndex)
   329  		buf.EncodeUint32(v1.TableID)
   330  		buf.EncodeUint32(v1.RpfID)
   331  		buf.EncodeUint8(v1.Weight)
   332  		buf.EncodeUint8(v1.Preference)
   333  		buf.EncodeUint32(uint32(v1.Type))
   334  		buf.EncodeUint32(uint32(v1.Flags))
   335  		buf.EncodeUint32(uint32(v1.Proto))
   336  		buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
   337  		buf.EncodeUint32(v1.Nh.ViaLabel)
   338  		buf.EncodeUint32(v1.Nh.ObjID)
   339  		buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
   340  		buf.EncodeUint8(v1.NLabels)
   341  		for j2 := 0; j2 < 16; j2++ {
   342  			buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
   343  			buf.EncodeUint32(v1.LabelStack[j2].Label)
   344  			buf.EncodeUint8(v1.LabelStack[j2].TTL)
   345  			buf.EncodeUint8(v1.LabelStack[j2].Exp)
   346  		}
   347  	}
   348  	return buf.Bytes(), nil
   349  }
   350  func (m *AbfPolicyAddDel) Unmarshal(b []byte) error {
   351  	buf := codec.NewBuffer(b)
   352  	m.IsAdd = buf.DecodeBool()
   353  	m.Policy.PolicyID = buf.DecodeUint32()
   354  	m.Policy.ACLIndex = buf.DecodeUint32()
   355  	m.Policy.NPaths = buf.DecodeUint8()
   356  	m.Policy.Paths = make([]fib_types.FibPath, m.Policy.NPaths)
   357  	for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
   358  		m.Policy.Paths[j1].SwIfIndex = buf.DecodeUint32()
   359  		m.Policy.Paths[j1].TableID = buf.DecodeUint32()
   360  		m.Policy.Paths[j1].RpfID = buf.DecodeUint32()
   361  		m.Policy.Paths[j1].Weight = buf.DecodeUint8()
   362  		m.Policy.Paths[j1].Preference = buf.DecodeUint8()
   363  		m.Policy.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
   364  		m.Policy.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
   365  		m.Policy.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
   366  		copy(m.Policy.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
   367  		m.Policy.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
   368  		m.Policy.Paths[j1].Nh.ObjID = buf.DecodeUint32()
   369  		m.Policy.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
   370  		m.Policy.Paths[j1].NLabels = buf.DecodeUint8()
   371  		for j2 := 0; j2 < 16; j2++ {
   372  			m.Policy.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
   373  			m.Policy.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
   374  			m.Policy.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
   375  			m.Policy.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
   376  		}
   377  	}
   378  	return nil
   379  }
   380  
   381  // AbfPolicyAddDelReply defines message 'abf_policy_add_del_reply'.
   382  // InProgress: the message form may change in the future versions
   383  type AbfPolicyAddDelReply struct {
   384  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   385  }
   386  
   387  func (m *AbfPolicyAddDelReply) Reset()               { *m = AbfPolicyAddDelReply{} }
   388  func (*AbfPolicyAddDelReply) GetMessageName() string { return "abf_policy_add_del_reply" }
   389  func (*AbfPolicyAddDelReply) GetCrcString() string   { return "e8d4e804" }
   390  func (*AbfPolicyAddDelReply) GetMessageType() api.MessageType {
   391  	return api.ReplyMessage
   392  }
   393  
   394  func (m *AbfPolicyAddDelReply) Size() (size int) {
   395  	if m == nil {
   396  		return 0
   397  	}
   398  	size += 4 // m.Retval
   399  	return size
   400  }
   401  func (m *AbfPolicyAddDelReply) Marshal(b []byte) ([]byte, error) {
   402  	if b == nil {
   403  		b = make([]byte, m.Size())
   404  	}
   405  	buf := codec.NewBuffer(b)
   406  	buf.EncodeInt32(m.Retval)
   407  	return buf.Bytes(), nil
   408  }
   409  func (m *AbfPolicyAddDelReply) Unmarshal(b []byte) error {
   410  	buf := codec.NewBuffer(b)
   411  	m.Retval = buf.DecodeInt32()
   412  	return nil
   413  }
   414  
   415  // AbfPolicyDetails defines message 'abf_policy_details'.
   416  // InProgress: the message form may change in the future versions
   417  type AbfPolicyDetails struct {
   418  	Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"`
   419  }
   420  
   421  func (m *AbfPolicyDetails) Reset()               { *m = AbfPolicyDetails{} }
   422  func (*AbfPolicyDetails) GetMessageName() string { return "abf_policy_details" }
   423  func (*AbfPolicyDetails) GetCrcString() string   { return "b7487fa4" }
   424  func (*AbfPolicyDetails) GetMessageType() api.MessageType {
   425  	return api.ReplyMessage
   426  }
   427  
   428  func (m *AbfPolicyDetails) Size() (size int) {
   429  	if m == nil {
   430  		return 0
   431  	}
   432  	size += 4 // m.Policy.PolicyID
   433  	size += 4 // m.Policy.ACLIndex
   434  	size += 1 // m.Policy.NPaths
   435  	for j2 := 0; j2 < len(m.Policy.Paths); j2++ {
   436  		var s2 fib_types.FibPath
   437  		_ = s2
   438  		if j2 < len(m.Policy.Paths) {
   439  			s2 = m.Policy.Paths[j2]
   440  		}
   441  		size += 4      // s2.SwIfIndex
   442  		size += 4      // s2.TableID
   443  		size += 4      // s2.RpfID
   444  		size += 1      // s2.Weight
   445  		size += 1      // s2.Preference
   446  		size += 4      // s2.Type
   447  		size += 4      // s2.Flags
   448  		size += 4      // s2.Proto
   449  		size += 1 * 16 // s2.Nh.Address
   450  		size += 4      // s2.Nh.ViaLabel
   451  		size += 4      // s2.Nh.ObjID
   452  		size += 4      // s2.Nh.ClassifyTableIndex
   453  		size += 1      // s2.NLabels
   454  		for j3 := 0; j3 < 16; j3++ {
   455  			size += 1 // s2.LabelStack[j3].IsUniform
   456  			size += 4 // s2.LabelStack[j3].Label
   457  			size += 1 // s2.LabelStack[j3].TTL
   458  			size += 1 // s2.LabelStack[j3].Exp
   459  		}
   460  	}
   461  	return size
   462  }
   463  func (m *AbfPolicyDetails) Marshal(b []byte) ([]byte, error) {
   464  	if b == nil {
   465  		b = make([]byte, m.Size())
   466  	}
   467  	buf := codec.NewBuffer(b)
   468  	buf.EncodeUint32(m.Policy.PolicyID)
   469  	buf.EncodeUint32(m.Policy.ACLIndex)
   470  	buf.EncodeUint8(uint8(len(m.Policy.Paths)))
   471  	for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
   472  		var v1 fib_types.FibPath // Paths
   473  		if j1 < len(m.Policy.Paths) {
   474  			v1 = m.Policy.Paths[j1]
   475  		}
   476  		buf.EncodeUint32(v1.SwIfIndex)
   477  		buf.EncodeUint32(v1.TableID)
   478  		buf.EncodeUint32(v1.RpfID)
   479  		buf.EncodeUint8(v1.Weight)
   480  		buf.EncodeUint8(v1.Preference)
   481  		buf.EncodeUint32(uint32(v1.Type))
   482  		buf.EncodeUint32(uint32(v1.Flags))
   483  		buf.EncodeUint32(uint32(v1.Proto))
   484  		buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
   485  		buf.EncodeUint32(v1.Nh.ViaLabel)
   486  		buf.EncodeUint32(v1.Nh.ObjID)
   487  		buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
   488  		buf.EncodeUint8(v1.NLabels)
   489  		for j2 := 0; j2 < 16; j2++ {
   490  			buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
   491  			buf.EncodeUint32(v1.LabelStack[j2].Label)
   492  			buf.EncodeUint8(v1.LabelStack[j2].TTL)
   493  			buf.EncodeUint8(v1.LabelStack[j2].Exp)
   494  		}
   495  	}
   496  	return buf.Bytes(), nil
   497  }
   498  func (m *AbfPolicyDetails) Unmarshal(b []byte) error {
   499  	buf := codec.NewBuffer(b)
   500  	m.Policy.PolicyID = buf.DecodeUint32()
   501  	m.Policy.ACLIndex = buf.DecodeUint32()
   502  	m.Policy.NPaths = buf.DecodeUint8()
   503  	m.Policy.Paths = make([]fib_types.FibPath, m.Policy.NPaths)
   504  	for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
   505  		m.Policy.Paths[j1].SwIfIndex = buf.DecodeUint32()
   506  		m.Policy.Paths[j1].TableID = buf.DecodeUint32()
   507  		m.Policy.Paths[j1].RpfID = buf.DecodeUint32()
   508  		m.Policy.Paths[j1].Weight = buf.DecodeUint8()
   509  		m.Policy.Paths[j1].Preference = buf.DecodeUint8()
   510  		m.Policy.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
   511  		m.Policy.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
   512  		m.Policy.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
   513  		copy(m.Policy.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
   514  		m.Policy.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
   515  		m.Policy.Paths[j1].Nh.ObjID = buf.DecodeUint32()
   516  		m.Policy.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
   517  		m.Policy.Paths[j1].NLabels = buf.DecodeUint8()
   518  		for j2 := 0; j2 < 16; j2++ {
   519  			m.Policy.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
   520  			m.Policy.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
   521  			m.Policy.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
   522  			m.Policy.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
   523  		}
   524  	}
   525  	return nil
   526  }
   527  
   528  // AbfPolicyDump defines message 'abf_policy_dump'.
   529  // InProgress: the message form may change in the future versions
   530  type AbfPolicyDump struct{}
   531  
   532  func (m *AbfPolicyDump) Reset()               { *m = AbfPolicyDump{} }
   533  func (*AbfPolicyDump) GetMessageName() string { return "abf_policy_dump" }
   534  func (*AbfPolicyDump) GetCrcString() string   { return "51077d14" }
   535  func (*AbfPolicyDump) GetMessageType() api.MessageType {
   536  	return api.RequestMessage
   537  }
   538  
   539  func (m *AbfPolicyDump) Size() (size int) {
   540  	if m == nil {
   541  		return 0
   542  	}
   543  	return size
   544  }
   545  func (m *AbfPolicyDump) Marshal(b []byte) ([]byte, error) {
   546  	if b == nil {
   547  		b = make([]byte, m.Size())
   548  	}
   549  	buf := codec.NewBuffer(b)
   550  	return buf.Bytes(), nil
   551  }
   552  func (m *AbfPolicyDump) Unmarshal(b []byte) error {
   553  	return nil
   554  }
   555  
   556  func init() { file_abf_binapi_init() }
   557  func file_abf_binapi_init() {
   558  	api.RegisterMessage((*AbfItfAttachAddDel)(nil), "abf_itf_attach_add_del_25c8621b")
   559  	api.RegisterMessage((*AbfItfAttachAddDelReply)(nil), "abf_itf_attach_add_del_reply_e8d4e804")
   560  	api.RegisterMessage((*AbfItfAttachDetails)(nil), "abf_itf_attach_details_7819523e")
   561  	api.RegisterMessage((*AbfItfAttachDump)(nil), "abf_itf_attach_dump_51077d14")
   562  	api.RegisterMessage((*AbfPluginGetVersion)(nil), "abf_plugin_get_version_51077d14")
   563  	api.RegisterMessage((*AbfPluginGetVersionReply)(nil), "abf_plugin_get_version_reply_9b32cf86")
   564  	api.RegisterMessage((*AbfPolicyAddDel)(nil), "abf_policy_add_del_c6131197")
   565  	api.RegisterMessage((*AbfPolicyAddDelReply)(nil), "abf_policy_add_del_reply_e8d4e804")
   566  	api.RegisterMessage((*AbfPolicyDetails)(nil), "abf_policy_details_b7487fa4")
   567  	api.RegisterMessage((*AbfPolicyDump)(nil), "abf_policy_dump_51077d14")
   568  }
   569  
   570  // Messages returns list of all messages in this module.
   571  func AllMessages() []api.Message {
   572  	return []api.Message{
   573  		(*AbfItfAttachAddDel)(nil),
   574  		(*AbfItfAttachAddDelReply)(nil),
   575  		(*AbfItfAttachDetails)(nil),
   576  		(*AbfItfAttachDump)(nil),
   577  		(*AbfPluginGetVersion)(nil),
   578  		(*AbfPluginGetVersionReply)(nil),
   579  		(*AbfPolicyAddDel)(nil),
   580  		(*AbfPolicyAddDelReply)(nil),
   581  		(*AbfPolicyDetails)(nil),
   582  		(*AbfPolicyDump)(nil),
   583  	}
   584  }