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