github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/policer/policer.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.10.0-dev
     4  //  VPP:              23.10-rc0~170-g6f1548434
     5  // source: core/policer.api.json
     6  
     7  // Package policer contains generated bindings for API file policer.api.
     8  //
     9  // Contents:
    10  // - 25 messages
    11  package policer
    12  
    13  import (
    14  	interface_types "github.com/networkservicemesh/govpp/binapi/interface_types"
    15  	policer_types "github.com/networkservicemesh/govpp/binapi/policer_types"
    16  	api "go.fd.io/govpp/api"
    17  	codec "go.fd.io/govpp/codec"
    18  )
    19  
    20  // This is a compile-time assertion to ensure that this generated file
    21  // is compatible with the GoVPP api package it is being compiled against.
    22  // A compilation error at this line likely means your copy of the
    23  // GoVPP api package needs to be updated.
    24  const _ = api.GoVppAPIPackageIsVersion2
    25  
    26  const (
    27  	APIFile    = "policer"
    28  	APIVersion = "3.0.0"
    29  	VersionCrc = 0x341163a6
    30  )
    31  
    32  // PolicerAdd defines message 'policer_add'.
    33  type PolicerAdd struct {
    34  	Name  string                      `binapi:"string[64],name=name" json:"name,omitempty"`
    35  	Infos policer_types.PolicerConfig `binapi:"policer_config,name=infos" json:"infos,omitempty"`
    36  }
    37  
    38  func (m *PolicerAdd) Reset()               { *m = PolicerAdd{} }
    39  func (*PolicerAdd) GetMessageName() string { return "policer_add" }
    40  func (*PolicerAdd) GetCrcString() string   { return "4d949e35" }
    41  func (*PolicerAdd) GetMessageType() api.MessageType {
    42  	return api.RequestMessage
    43  }
    44  
    45  func (m *PolicerAdd) Size() (size int) {
    46  	if m == nil {
    47  		return 0
    48  	}
    49  	size += 64 // m.Name
    50  	size += 4  // m.Infos.Cir
    51  	size += 4  // m.Infos.Eir
    52  	size += 8  // m.Infos.Cb
    53  	size += 8  // m.Infos.Eb
    54  	size += 1  // m.Infos.RateType
    55  	size += 1  // m.Infos.RoundType
    56  	size += 1  // m.Infos.Type
    57  	size += 1  // m.Infos.ColorAware
    58  	size += 1  // m.Infos.ConformAction.Type
    59  	size += 1  // m.Infos.ConformAction.Dscp
    60  	size += 1  // m.Infos.ExceedAction.Type
    61  	size += 1  // m.Infos.ExceedAction.Dscp
    62  	size += 1  // m.Infos.ViolateAction.Type
    63  	size += 1  // m.Infos.ViolateAction.Dscp
    64  	return size
    65  }
    66  func (m *PolicerAdd) Marshal(b []byte) ([]byte, error) {
    67  	if b == nil {
    68  		b = make([]byte, m.Size())
    69  	}
    70  	buf := codec.NewBuffer(b)
    71  	buf.EncodeString(m.Name, 64)
    72  	buf.EncodeUint32(m.Infos.Cir)
    73  	buf.EncodeUint32(m.Infos.Eir)
    74  	buf.EncodeUint64(m.Infos.Cb)
    75  	buf.EncodeUint64(m.Infos.Eb)
    76  	buf.EncodeUint8(uint8(m.Infos.RateType))
    77  	buf.EncodeUint8(uint8(m.Infos.RoundType))
    78  	buf.EncodeUint8(uint8(m.Infos.Type))
    79  	buf.EncodeBool(m.Infos.ColorAware)
    80  	buf.EncodeUint8(uint8(m.Infos.ConformAction.Type))
    81  	buf.EncodeUint8(m.Infos.ConformAction.Dscp)
    82  	buf.EncodeUint8(uint8(m.Infos.ExceedAction.Type))
    83  	buf.EncodeUint8(m.Infos.ExceedAction.Dscp)
    84  	buf.EncodeUint8(uint8(m.Infos.ViolateAction.Type))
    85  	buf.EncodeUint8(m.Infos.ViolateAction.Dscp)
    86  	return buf.Bytes(), nil
    87  }
    88  func (m *PolicerAdd) Unmarshal(b []byte) error {
    89  	buf := codec.NewBuffer(b)
    90  	m.Name = buf.DecodeString(64)
    91  	m.Infos.Cir = buf.DecodeUint32()
    92  	m.Infos.Eir = buf.DecodeUint32()
    93  	m.Infos.Cb = buf.DecodeUint64()
    94  	m.Infos.Eb = buf.DecodeUint64()
    95  	m.Infos.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
    96  	m.Infos.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
    97  	m.Infos.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
    98  	m.Infos.ColorAware = buf.DecodeBool()
    99  	m.Infos.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   100  	m.Infos.ConformAction.Dscp = buf.DecodeUint8()
   101  	m.Infos.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   102  	m.Infos.ExceedAction.Dscp = buf.DecodeUint8()
   103  	m.Infos.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   104  	m.Infos.ViolateAction.Dscp = buf.DecodeUint8()
   105  	return nil
   106  }
   107  
   108  // Add/del policer
   109  //   - is_add - add policer if non-zero, else delete
   110  //   - name - policer name
   111  //   - cir - CIR
   112  //   - eir - EIR
   113  //   - cb - Committed Burst
   114  //   - eb - Excess or Peak Burst
   115  //   - rate_type - rate type
   116  //   - round_type - rounding type
   117  //   - type - policer algorithm
   118  //   - color_aware - 0=color-blind, 1=color-aware
   119  //   - conform_action - conform action
   120  //   - exceed_action - exceed action type
   121  //   - violate_action - violate action type
   122  //
   123  // PolicerAddDel defines message 'policer_add_del'.
   124  type PolicerAddDel struct {
   125  	IsAdd         bool                             `binapi:"bool,name=is_add" json:"is_add,omitempty"`
   126  	Name          string                           `binapi:"string[64],name=name" json:"name,omitempty"`
   127  	Cir           uint32                           `binapi:"u32,name=cir" json:"cir,omitempty"`
   128  	Eir           uint32                           `binapi:"u32,name=eir" json:"eir,omitempty"`
   129  	Cb            uint64                           `binapi:"u64,name=cb" json:"cb,omitempty"`
   130  	Eb            uint64                           `binapi:"u64,name=eb" json:"eb,omitempty"`
   131  	RateType      policer_types.Sse2QosRateType    `binapi:"sse2_qos_rate_type,name=rate_type" json:"rate_type,omitempty"`
   132  	RoundType     policer_types.Sse2QosRoundType   `binapi:"sse2_qos_round_type,name=round_type" json:"round_type,omitempty"`
   133  	Type          policer_types.Sse2QosPolicerType `binapi:"sse2_qos_policer_type,name=type" json:"type,omitempty"`
   134  	ColorAware    bool                             `binapi:"bool,name=color_aware" json:"color_aware,omitempty"`
   135  	ConformAction policer_types.Sse2QosAction      `binapi:"sse2_qos_action,name=conform_action" json:"conform_action,omitempty"`
   136  	ExceedAction  policer_types.Sse2QosAction      `binapi:"sse2_qos_action,name=exceed_action" json:"exceed_action,omitempty"`
   137  	ViolateAction policer_types.Sse2QosAction      `binapi:"sse2_qos_action,name=violate_action" json:"violate_action,omitempty"`
   138  }
   139  
   140  func (m *PolicerAddDel) Reset()               { *m = PolicerAddDel{} }
   141  func (*PolicerAddDel) GetMessageName() string { return "policer_add_del" }
   142  func (*PolicerAddDel) GetCrcString() string   { return "2b31dd38" }
   143  func (*PolicerAddDel) GetMessageType() api.MessageType {
   144  	return api.RequestMessage
   145  }
   146  
   147  func (m *PolicerAddDel) Size() (size int) {
   148  	if m == nil {
   149  		return 0
   150  	}
   151  	size += 1  // m.IsAdd
   152  	size += 64 // m.Name
   153  	size += 4  // m.Cir
   154  	size += 4  // m.Eir
   155  	size += 8  // m.Cb
   156  	size += 8  // m.Eb
   157  	size += 1  // m.RateType
   158  	size += 1  // m.RoundType
   159  	size += 1  // m.Type
   160  	size += 1  // m.ColorAware
   161  	size += 1  // m.ConformAction.Type
   162  	size += 1  // m.ConformAction.Dscp
   163  	size += 1  // m.ExceedAction.Type
   164  	size += 1  // m.ExceedAction.Dscp
   165  	size += 1  // m.ViolateAction.Type
   166  	size += 1  // m.ViolateAction.Dscp
   167  	return size
   168  }
   169  func (m *PolicerAddDel) Marshal(b []byte) ([]byte, error) {
   170  	if b == nil {
   171  		b = make([]byte, m.Size())
   172  	}
   173  	buf := codec.NewBuffer(b)
   174  	buf.EncodeBool(m.IsAdd)
   175  	buf.EncodeString(m.Name, 64)
   176  	buf.EncodeUint32(m.Cir)
   177  	buf.EncodeUint32(m.Eir)
   178  	buf.EncodeUint64(m.Cb)
   179  	buf.EncodeUint64(m.Eb)
   180  	buf.EncodeUint8(uint8(m.RateType))
   181  	buf.EncodeUint8(uint8(m.RoundType))
   182  	buf.EncodeUint8(uint8(m.Type))
   183  	buf.EncodeBool(m.ColorAware)
   184  	buf.EncodeUint8(uint8(m.ConformAction.Type))
   185  	buf.EncodeUint8(m.ConformAction.Dscp)
   186  	buf.EncodeUint8(uint8(m.ExceedAction.Type))
   187  	buf.EncodeUint8(m.ExceedAction.Dscp)
   188  	buf.EncodeUint8(uint8(m.ViolateAction.Type))
   189  	buf.EncodeUint8(m.ViolateAction.Dscp)
   190  	return buf.Bytes(), nil
   191  }
   192  func (m *PolicerAddDel) Unmarshal(b []byte) error {
   193  	buf := codec.NewBuffer(b)
   194  	m.IsAdd = buf.DecodeBool()
   195  	m.Name = buf.DecodeString(64)
   196  	m.Cir = buf.DecodeUint32()
   197  	m.Eir = buf.DecodeUint32()
   198  	m.Cb = buf.DecodeUint64()
   199  	m.Eb = buf.DecodeUint64()
   200  	m.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
   201  	m.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
   202  	m.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
   203  	m.ColorAware = buf.DecodeBool()
   204  	m.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   205  	m.ConformAction.Dscp = buf.DecodeUint8()
   206  	m.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   207  	m.ExceedAction.Dscp = buf.DecodeUint8()
   208  	m.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   209  	m.ViolateAction.Dscp = buf.DecodeUint8()
   210  	return nil
   211  }
   212  
   213  // Add/del policer response
   214  //   - retval - return value for request
   215  //   - policer_index - for add, returned index of the new policer
   216  //
   217  // PolicerAddDelReply defines message 'policer_add_del_reply'.
   218  type PolicerAddDelReply struct {
   219  	Retval       int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   220  	PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   221  }
   222  
   223  func (m *PolicerAddDelReply) Reset()               { *m = PolicerAddDelReply{} }
   224  func (*PolicerAddDelReply) GetMessageName() string { return "policer_add_del_reply" }
   225  func (*PolicerAddDelReply) GetCrcString() string   { return "a177cef2" }
   226  func (*PolicerAddDelReply) GetMessageType() api.MessageType {
   227  	return api.ReplyMessage
   228  }
   229  
   230  func (m *PolicerAddDelReply) Size() (size int) {
   231  	if m == nil {
   232  		return 0
   233  	}
   234  	size += 4 // m.Retval
   235  	size += 4 // m.PolicerIndex
   236  	return size
   237  }
   238  func (m *PolicerAddDelReply) Marshal(b []byte) ([]byte, error) {
   239  	if b == nil {
   240  		b = make([]byte, m.Size())
   241  	}
   242  	buf := codec.NewBuffer(b)
   243  	buf.EncodeInt32(m.Retval)
   244  	buf.EncodeUint32(m.PolicerIndex)
   245  	return buf.Bytes(), nil
   246  }
   247  func (m *PolicerAddDelReply) Unmarshal(b []byte) error {
   248  	buf := codec.NewBuffer(b)
   249  	m.Retval = buf.DecodeInt32()
   250  	m.PolicerIndex = buf.DecodeUint32()
   251  	return nil
   252  }
   253  
   254  // PolicerAddReply defines message 'policer_add_reply'.
   255  type PolicerAddReply struct {
   256  	Retval       int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
   257  	PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   258  }
   259  
   260  func (m *PolicerAddReply) Reset()               { *m = PolicerAddReply{} }
   261  func (*PolicerAddReply) GetMessageName() string { return "policer_add_reply" }
   262  func (*PolicerAddReply) GetCrcString() string   { return "a177cef2" }
   263  func (*PolicerAddReply) GetMessageType() api.MessageType {
   264  	return api.ReplyMessage
   265  }
   266  
   267  func (m *PolicerAddReply) Size() (size int) {
   268  	if m == nil {
   269  		return 0
   270  	}
   271  	size += 4 // m.Retval
   272  	size += 4 // m.PolicerIndex
   273  	return size
   274  }
   275  func (m *PolicerAddReply) Marshal(b []byte) ([]byte, error) {
   276  	if b == nil {
   277  		b = make([]byte, m.Size())
   278  	}
   279  	buf := codec.NewBuffer(b)
   280  	buf.EncodeInt32(m.Retval)
   281  	buf.EncodeUint32(m.PolicerIndex)
   282  	return buf.Bytes(), nil
   283  }
   284  func (m *PolicerAddReply) Unmarshal(b []byte) error {
   285  	buf := codec.NewBuffer(b)
   286  	m.Retval = buf.DecodeInt32()
   287  	m.PolicerIndex = buf.DecodeUint32()
   288  	return nil
   289  }
   290  
   291  // policer bind: Associate/disassociate a policer with a worker thread.
   292  //   - name - policer name to bind
   293  //   - worker_index - the worker thread to bind to
   294  //   - bind_enable - Associate/disassociate
   295  //
   296  // PolicerBind defines message 'policer_bind'.
   297  type PolicerBind struct {
   298  	Name        string `binapi:"string[64],name=name" json:"name,omitempty"`
   299  	WorkerIndex uint32 `binapi:"u32,name=worker_index" json:"worker_index,omitempty"`
   300  	BindEnable  bool   `binapi:"bool,name=bind_enable" json:"bind_enable,omitempty"`
   301  }
   302  
   303  func (m *PolicerBind) Reset()               { *m = PolicerBind{} }
   304  func (*PolicerBind) GetMessageName() string { return "policer_bind" }
   305  func (*PolicerBind) GetCrcString() string   { return "dcf516f9" }
   306  func (*PolicerBind) GetMessageType() api.MessageType {
   307  	return api.RequestMessage
   308  }
   309  
   310  func (m *PolicerBind) Size() (size int) {
   311  	if m == nil {
   312  		return 0
   313  	}
   314  	size += 64 // m.Name
   315  	size += 4  // m.WorkerIndex
   316  	size += 1  // m.BindEnable
   317  	return size
   318  }
   319  func (m *PolicerBind) Marshal(b []byte) ([]byte, error) {
   320  	if b == nil {
   321  		b = make([]byte, m.Size())
   322  	}
   323  	buf := codec.NewBuffer(b)
   324  	buf.EncodeString(m.Name, 64)
   325  	buf.EncodeUint32(m.WorkerIndex)
   326  	buf.EncodeBool(m.BindEnable)
   327  	return buf.Bytes(), nil
   328  }
   329  func (m *PolicerBind) Unmarshal(b []byte) error {
   330  	buf := codec.NewBuffer(b)
   331  	m.Name = buf.DecodeString(64)
   332  	m.WorkerIndex = buf.DecodeUint32()
   333  	m.BindEnable = buf.DecodeBool()
   334  	return nil
   335  }
   336  
   337  // PolicerBindReply defines message 'policer_bind_reply'.
   338  type PolicerBindReply struct {
   339  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   340  }
   341  
   342  func (m *PolicerBindReply) Reset()               { *m = PolicerBindReply{} }
   343  func (*PolicerBindReply) GetMessageName() string { return "policer_bind_reply" }
   344  func (*PolicerBindReply) GetCrcString() string   { return "e8d4e804" }
   345  func (*PolicerBindReply) GetMessageType() api.MessageType {
   346  	return api.ReplyMessage
   347  }
   348  
   349  func (m *PolicerBindReply) Size() (size int) {
   350  	if m == nil {
   351  		return 0
   352  	}
   353  	size += 4 // m.Retval
   354  	return size
   355  }
   356  func (m *PolicerBindReply) Marshal(b []byte) ([]byte, error) {
   357  	if b == nil {
   358  		b = make([]byte, m.Size())
   359  	}
   360  	buf := codec.NewBuffer(b)
   361  	buf.EncodeInt32(m.Retval)
   362  	return buf.Bytes(), nil
   363  }
   364  func (m *PolicerBindReply) Unmarshal(b []byte) error {
   365  	buf := codec.NewBuffer(b)
   366  	m.Retval = buf.DecodeInt32()
   367  	return nil
   368  }
   369  
   370  // PolicerBindV2 defines message 'policer_bind_v2'.
   371  type PolicerBindV2 struct {
   372  	PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   373  	WorkerIndex  uint32 `binapi:"u32,name=worker_index" json:"worker_index,omitempty"`
   374  	BindEnable   bool   `binapi:"bool,name=bind_enable" json:"bind_enable,omitempty"`
   375  }
   376  
   377  func (m *PolicerBindV2) Reset()               { *m = PolicerBindV2{} }
   378  func (*PolicerBindV2) GetMessageName() string { return "policer_bind_v2" }
   379  func (*PolicerBindV2) GetCrcString() string   { return "f87bd3c0" }
   380  func (*PolicerBindV2) GetMessageType() api.MessageType {
   381  	return api.RequestMessage
   382  }
   383  
   384  func (m *PolicerBindV2) Size() (size int) {
   385  	if m == nil {
   386  		return 0
   387  	}
   388  	size += 4 // m.PolicerIndex
   389  	size += 4 // m.WorkerIndex
   390  	size += 1 // m.BindEnable
   391  	return size
   392  }
   393  func (m *PolicerBindV2) Marshal(b []byte) ([]byte, error) {
   394  	if b == nil {
   395  		b = make([]byte, m.Size())
   396  	}
   397  	buf := codec.NewBuffer(b)
   398  	buf.EncodeUint32(m.PolicerIndex)
   399  	buf.EncodeUint32(m.WorkerIndex)
   400  	buf.EncodeBool(m.BindEnable)
   401  	return buf.Bytes(), nil
   402  }
   403  func (m *PolicerBindV2) Unmarshal(b []byte) error {
   404  	buf := codec.NewBuffer(b)
   405  	m.PolicerIndex = buf.DecodeUint32()
   406  	m.WorkerIndex = buf.DecodeUint32()
   407  	m.BindEnable = buf.DecodeBool()
   408  	return nil
   409  }
   410  
   411  // PolicerBindV2Reply defines message 'policer_bind_v2_reply'.
   412  type PolicerBindV2Reply struct {
   413  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   414  }
   415  
   416  func (m *PolicerBindV2Reply) Reset()               { *m = PolicerBindV2Reply{} }
   417  func (*PolicerBindV2Reply) GetMessageName() string { return "policer_bind_v2_reply" }
   418  func (*PolicerBindV2Reply) GetCrcString() string   { return "e8d4e804" }
   419  func (*PolicerBindV2Reply) GetMessageType() api.MessageType {
   420  	return api.ReplyMessage
   421  }
   422  
   423  func (m *PolicerBindV2Reply) Size() (size int) {
   424  	if m == nil {
   425  		return 0
   426  	}
   427  	size += 4 // m.Retval
   428  	return size
   429  }
   430  func (m *PolicerBindV2Reply) Marshal(b []byte) ([]byte, error) {
   431  	if b == nil {
   432  		b = make([]byte, m.Size())
   433  	}
   434  	buf := codec.NewBuffer(b)
   435  	buf.EncodeInt32(m.Retval)
   436  	return buf.Bytes(), nil
   437  }
   438  func (m *PolicerBindV2Reply) Unmarshal(b []byte) error {
   439  	buf := codec.NewBuffer(b)
   440  	m.Retval = buf.DecodeInt32()
   441  	return nil
   442  }
   443  
   444  // PolicerDel defines message 'policer_del'.
   445  type PolicerDel struct {
   446  	PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   447  }
   448  
   449  func (m *PolicerDel) Reset()               { *m = PolicerDel{} }
   450  func (*PolicerDel) GetMessageName() string { return "policer_del" }
   451  func (*PolicerDel) GetCrcString() string   { return "7ff7912e" }
   452  func (*PolicerDel) GetMessageType() api.MessageType {
   453  	return api.RequestMessage
   454  }
   455  
   456  func (m *PolicerDel) Size() (size int) {
   457  	if m == nil {
   458  		return 0
   459  	}
   460  	size += 4 // m.PolicerIndex
   461  	return size
   462  }
   463  func (m *PolicerDel) 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.PolicerIndex)
   469  	return buf.Bytes(), nil
   470  }
   471  func (m *PolicerDel) Unmarshal(b []byte) error {
   472  	buf := codec.NewBuffer(b)
   473  	m.PolicerIndex = buf.DecodeUint32()
   474  	return nil
   475  }
   476  
   477  // PolicerDelReply defines message 'policer_del_reply'.
   478  type PolicerDelReply struct {
   479  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   480  }
   481  
   482  func (m *PolicerDelReply) Reset()               { *m = PolicerDelReply{} }
   483  func (*PolicerDelReply) GetMessageName() string { return "policer_del_reply" }
   484  func (*PolicerDelReply) GetCrcString() string   { return "e8d4e804" }
   485  func (*PolicerDelReply) GetMessageType() api.MessageType {
   486  	return api.ReplyMessage
   487  }
   488  
   489  func (m *PolicerDelReply) Size() (size int) {
   490  	if m == nil {
   491  		return 0
   492  	}
   493  	size += 4 // m.Retval
   494  	return size
   495  }
   496  func (m *PolicerDelReply) Marshal(b []byte) ([]byte, error) {
   497  	if b == nil {
   498  		b = make([]byte, m.Size())
   499  	}
   500  	buf := codec.NewBuffer(b)
   501  	buf.EncodeInt32(m.Retval)
   502  	return buf.Bytes(), nil
   503  }
   504  func (m *PolicerDelReply) Unmarshal(b []byte) error {
   505  	buf := codec.NewBuffer(b)
   506  	m.Retval = buf.DecodeInt32()
   507  	return nil
   508  }
   509  
   510  // Policer operational state response.
   511  //   - name - policer name
   512  //   - cir - CIR
   513  //   - eir - EIR
   514  //   - cb - Committed Burst
   515  //   - eb - Excess or Peak Burst
   516  //   - rate_type - rate type
   517  //   - round_type - rounding type
   518  //   - type - policer algorithm
   519  //   - conform_action - conform action
   520  //   - exceed_action - exceed action
   521  //   - violate_action - violate action
   522  //   - single_rate - 1 = single rate policer, 0 = two rate policer
   523  //   - color_aware - for hierarchical policing
   524  //   - scale - power-of-2 shift amount for lower rates
   525  //   - cir_tokens_per_period - number of tokens for each period
   526  //   - pir_tokens_per_period - number of tokens for each period for 2-rate policer
   527  //   - current_limit - current limit
   528  //   - current_bucket - current bucket
   529  //   - extended_limit - extended limit
   530  //   - extended_bucket - extended bucket
   531  //   - last_update_time - last update time
   532  //
   533  // PolicerDetails defines message 'policer_details'.
   534  type PolicerDetails struct {
   535  	Name               string                           `binapi:"string[64],name=name" json:"name,omitempty"`
   536  	Cir                uint32                           `binapi:"u32,name=cir" json:"cir,omitempty"`
   537  	Eir                uint32                           `binapi:"u32,name=eir" json:"eir,omitempty"`
   538  	Cb                 uint64                           `binapi:"u64,name=cb" json:"cb,omitempty"`
   539  	Eb                 uint64                           `binapi:"u64,name=eb" json:"eb,omitempty"`
   540  	RateType           policer_types.Sse2QosRateType    `binapi:"sse2_qos_rate_type,name=rate_type" json:"rate_type,omitempty"`
   541  	RoundType          policer_types.Sse2QosRoundType   `binapi:"sse2_qos_round_type,name=round_type" json:"round_type,omitempty"`
   542  	Type               policer_types.Sse2QosPolicerType `binapi:"sse2_qos_policer_type,name=type" json:"type,omitempty"`
   543  	ConformAction      policer_types.Sse2QosAction      `binapi:"sse2_qos_action,name=conform_action" json:"conform_action,omitempty"`
   544  	ExceedAction       policer_types.Sse2QosAction      `binapi:"sse2_qos_action,name=exceed_action" json:"exceed_action,omitempty"`
   545  	ViolateAction      policer_types.Sse2QosAction      `binapi:"sse2_qos_action,name=violate_action" json:"violate_action,omitempty"`
   546  	SingleRate         bool                             `binapi:"bool,name=single_rate" json:"single_rate,omitempty"`
   547  	ColorAware         bool                             `binapi:"bool,name=color_aware" json:"color_aware,omitempty"`
   548  	Scale              uint32                           `binapi:"u32,name=scale" json:"scale,omitempty"`
   549  	CirTokensPerPeriod uint32                           `binapi:"u32,name=cir_tokens_per_period" json:"cir_tokens_per_period,omitempty"`
   550  	PirTokensPerPeriod uint32                           `binapi:"u32,name=pir_tokens_per_period" json:"pir_tokens_per_period,omitempty"`
   551  	CurrentLimit       uint32                           `binapi:"u32,name=current_limit" json:"current_limit,omitempty"`
   552  	CurrentBucket      uint32                           `binapi:"u32,name=current_bucket" json:"current_bucket,omitempty"`
   553  	ExtendedLimit      uint32                           `binapi:"u32,name=extended_limit" json:"extended_limit,omitempty"`
   554  	ExtendedBucket     uint32                           `binapi:"u32,name=extended_bucket" json:"extended_bucket,omitempty"`
   555  	LastUpdateTime     uint64                           `binapi:"u64,name=last_update_time" json:"last_update_time,omitempty"`
   556  }
   557  
   558  func (m *PolicerDetails) Reset()               { *m = PolicerDetails{} }
   559  func (*PolicerDetails) GetMessageName() string { return "policer_details" }
   560  func (*PolicerDetails) GetCrcString() string   { return "72d0e248" }
   561  func (*PolicerDetails) GetMessageType() api.MessageType {
   562  	return api.ReplyMessage
   563  }
   564  
   565  func (m *PolicerDetails) Size() (size int) {
   566  	if m == nil {
   567  		return 0
   568  	}
   569  	size += 64 // m.Name
   570  	size += 4  // m.Cir
   571  	size += 4  // m.Eir
   572  	size += 8  // m.Cb
   573  	size += 8  // m.Eb
   574  	size += 1  // m.RateType
   575  	size += 1  // m.RoundType
   576  	size += 1  // m.Type
   577  	size += 1  // m.ConformAction.Type
   578  	size += 1  // m.ConformAction.Dscp
   579  	size += 1  // m.ExceedAction.Type
   580  	size += 1  // m.ExceedAction.Dscp
   581  	size += 1  // m.ViolateAction.Type
   582  	size += 1  // m.ViolateAction.Dscp
   583  	size += 1  // m.SingleRate
   584  	size += 1  // m.ColorAware
   585  	size += 4  // m.Scale
   586  	size += 4  // m.CirTokensPerPeriod
   587  	size += 4  // m.PirTokensPerPeriod
   588  	size += 4  // m.CurrentLimit
   589  	size += 4  // m.CurrentBucket
   590  	size += 4  // m.ExtendedLimit
   591  	size += 4  // m.ExtendedBucket
   592  	size += 8  // m.LastUpdateTime
   593  	return size
   594  }
   595  func (m *PolicerDetails) Marshal(b []byte) ([]byte, error) {
   596  	if b == nil {
   597  		b = make([]byte, m.Size())
   598  	}
   599  	buf := codec.NewBuffer(b)
   600  	buf.EncodeString(m.Name, 64)
   601  	buf.EncodeUint32(m.Cir)
   602  	buf.EncodeUint32(m.Eir)
   603  	buf.EncodeUint64(m.Cb)
   604  	buf.EncodeUint64(m.Eb)
   605  	buf.EncodeUint8(uint8(m.RateType))
   606  	buf.EncodeUint8(uint8(m.RoundType))
   607  	buf.EncodeUint8(uint8(m.Type))
   608  	buf.EncodeUint8(uint8(m.ConformAction.Type))
   609  	buf.EncodeUint8(m.ConformAction.Dscp)
   610  	buf.EncodeUint8(uint8(m.ExceedAction.Type))
   611  	buf.EncodeUint8(m.ExceedAction.Dscp)
   612  	buf.EncodeUint8(uint8(m.ViolateAction.Type))
   613  	buf.EncodeUint8(m.ViolateAction.Dscp)
   614  	buf.EncodeBool(m.SingleRate)
   615  	buf.EncodeBool(m.ColorAware)
   616  	buf.EncodeUint32(m.Scale)
   617  	buf.EncodeUint32(m.CirTokensPerPeriod)
   618  	buf.EncodeUint32(m.PirTokensPerPeriod)
   619  	buf.EncodeUint32(m.CurrentLimit)
   620  	buf.EncodeUint32(m.CurrentBucket)
   621  	buf.EncodeUint32(m.ExtendedLimit)
   622  	buf.EncodeUint32(m.ExtendedBucket)
   623  	buf.EncodeUint64(m.LastUpdateTime)
   624  	return buf.Bytes(), nil
   625  }
   626  func (m *PolicerDetails) Unmarshal(b []byte) error {
   627  	buf := codec.NewBuffer(b)
   628  	m.Name = buf.DecodeString(64)
   629  	m.Cir = buf.DecodeUint32()
   630  	m.Eir = buf.DecodeUint32()
   631  	m.Cb = buf.DecodeUint64()
   632  	m.Eb = buf.DecodeUint64()
   633  	m.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
   634  	m.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
   635  	m.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
   636  	m.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   637  	m.ConformAction.Dscp = buf.DecodeUint8()
   638  	m.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   639  	m.ExceedAction.Dscp = buf.DecodeUint8()
   640  	m.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
   641  	m.ViolateAction.Dscp = buf.DecodeUint8()
   642  	m.SingleRate = buf.DecodeBool()
   643  	m.ColorAware = buf.DecodeBool()
   644  	m.Scale = buf.DecodeUint32()
   645  	m.CirTokensPerPeriod = buf.DecodeUint32()
   646  	m.PirTokensPerPeriod = buf.DecodeUint32()
   647  	m.CurrentLimit = buf.DecodeUint32()
   648  	m.CurrentBucket = buf.DecodeUint32()
   649  	m.ExtendedLimit = buf.DecodeUint32()
   650  	m.ExtendedBucket = buf.DecodeUint32()
   651  	m.LastUpdateTime = buf.DecodeUint64()
   652  	return nil
   653  }
   654  
   655  // Get list of policers
   656  //   - match_name_valid - if 0 request all policers otherwise use match_name
   657  //   - match_name - policer name
   658  //
   659  // PolicerDump defines message 'policer_dump'.
   660  type PolicerDump struct {
   661  	MatchNameValid bool   `binapi:"bool,name=match_name_valid" json:"match_name_valid,omitempty"`
   662  	MatchName      string `binapi:"string[64],name=match_name" json:"match_name,omitempty"`
   663  }
   664  
   665  func (m *PolicerDump) Reset()               { *m = PolicerDump{} }
   666  func (*PolicerDump) GetMessageName() string { return "policer_dump" }
   667  func (*PolicerDump) GetCrcString() string   { return "35f1ae0f" }
   668  func (*PolicerDump) GetMessageType() api.MessageType {
   669  	return api.RequestMessage
   670  }
   671  
   672  func (m *PolicerDump) Size() (size int) {
   673  	if m == nil {
   674  		return 0
   675  	}
   676  	size += 1  // m.MatchNameValid
   677  	size += 64 // m.MatchName
   678  	return size
   679  }
   680  func (m *PolicerDump) Marshal(b []byte) ([]byte, error) {
   681  	if b == nil {
   682  		b = make([]byte, m.Size())
   683  	}
   684  	buf := codec.NewBuffer(b)
   685  	buf.EncodeBool(m.MatchNameValid)
   686  	buf.EncodeString(m.MatchName, 64)
   687  	return buf.Bytes(), nil
   688  }
   689  func (m *PolicerDump) Unmarshal(b []byte) error {
   690  	buf := codec.NewBuffer(b)
   691  	m.MatchNameValid = buf.DecodeBool()
   692  	m.MatchName = buf.DecodeString(64)
   693  	return nil
   694  }
   695  
   696  // Get list of policers
   697  //   - policer_index - index of policer in the pool, ~0 to request all
   698  //
   699  // PolicerDumpV2 defines message 'policer_dump_v2'.
   700  type PolicerDumpV2 struct {
   701  	PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   702  }
   703  
   704  func (m *PolicerDumpV2) Reset()               { *m = PolicerDumpV2{} }
   705  func (*PolicerDumpV2) GetMessageName() string { return "policer_dump_v2" }
   706  func (*PolicerDumpV2) GetCrcString() string   { return "7ff7912e" }
   707  func (*PolicerDumpV2) GetMessageType() api.MessageType {
   708  	return api.RequestMessage
   709  }
   710  
   711  func (m *PolicerDumpV2) Size() (size int) {
   712  	if m == nil {
   713  		return 0
   714  	}
   715  	size += 4 // m.PolicerIndex
   716  	return size
   717  }
   718  func (m *PolicerDumpV2) Marshal(b []byte) ([]byte, error) {
   719  	if b == nil {
   720  		b = make([]byte, m.Size())
   721  	}
   722  	buf := codec.NewBuffer(b)
   723  	buf.EncodeUint32(m.PolicerIndex)
   724  	return buf.Bytes(), nil
   725  }
   726  func (m *PolicerDumpV2) Unmarshal(b []byte) error {
   727  	buf := codec.NewBuffer(b)
   728  	m.PolicerIndex = buf.DecodeUint32()
   729  	return nil
   730  }
   731  
   732  // policer input: Apply policer as an input feature.
   733  //   - name - policer name
   734  //   - sw_if_index - interface to apply the policer
   735  //   - apply - Apply/remove
   736  //
   737  // PolicerInput defines message 'policer_input'.
   738  type PolicerInput struct {
   739  	Name      string                         `binapi:"string[64],name=name" json:"name,omitempty"`
   740  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   741  	Apply     bool                           `binapi:"bool,name=apply" json:"apply,omitempty"`
   742  }
   743  
   744  func (m *PolicerInput) Reset()               { *m = PolicerInput{} }
   745  func (*PolicerInput) GetMessageName() string { return "policer_input" }
   746  func (*PolicerInput) GetCrcString() string   { return "233f0ef5" }
   747  func (*PolicerInput) GetMessageType() api.MessageType {
   748  	return api.RequestMessage
   749  }
   750  
   751  func (m *PolicerInput) Size() (size int) {
   752  	if m == nil {
   753  		return 0
   754  	}
   755  	size += 64 // m.Name
   756  	size += 4  // m.SwIfIndex
   757  	size += 1  // m.Apply
   758  	return size
   759  }
   760  func (m *PolicerInput) Marshal(b []byte) ([]byte, error) {
   761  	if b == nil {
   762  		b = make([]byte, m.Size())
   763  	}
   764  	buf := codec.NewBuffer(b)
   765  	buf.EncodeString(m.Name, 64)
   766  	buf.EncodeUint32(uint32(m.SwIfIndex))
   767  	buf.EncodeBool(m.Apply)
   768  	return buf.Bytes(), nil
   769  }
   770  func (m *PolicerInput) Unmarshal(b []byte) error {
   771  	buf := codec.NewBuffer(b)
   772  	m.Name = buf.DecodeString(64)
   773  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   774  	m.Apply = buf.DecodeBool()
   775  	return nil
   776  }
   777  
   778  // PolicerInputReply defines message 'policer_input_reply'.
   779  type PolicerInputReply struct {
   780  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   781  }
   782  
   783  func (m *PolicerInputReply) Reset()               { *m = PolicerInputReply{} }
   784  func (*PolicerInputReply) GetMessageName() string { return "policer_input_reply" }
   785  func (*PolicerInputReply) GetCrcString() string   { return "e8d4e804" }
   786  func (*PolicerInputReply) GetMessageType() api.MessageType {
   787  	return api.ReplyMessage
   788  }
   789  
   790  func (m *PolicerInputReply) Size() (size int) {
   791  	if m == nil {
   792  		return 0
   793  	}
   794  	size += 4 // m.Retval
   795  	return size
   796  }
   797  func (m *PolicerInputReply) Marshal(b []byte) ([]byte, error) {
   798  	if b == nil {
   799  		b = make([]byte, m.Size())
   800  	}
   801  	buf := codec.NewBuffer(b)
   802  	buf.EncodeInt32(m.Retval)
   803  	return buf.Bytes(), nil
   804  }
   805  func (m *PolicerInputReply) Unmarshal(b []byte) error {
   806  	buf := codec.NewBuffer(b)
   807  	m.Retval = buf.DecodeInt32()
   808  	return nil
   809  }
   810  
   811  // PolicerInputV2 defines message 'policer_input_v2'.
   812  type PolicerInputV2 struct {
   813  	PolicerIndex uint32                         `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   814  	SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   815  	Apply        bool                           `binapi:"bool,name=apply" json:"apply,omitempty"`
   816  }
   817  
   818  func (m *PolicerInputV2) Reset()               { *m = PolicerInputV2{} }
   819  func (*PolicerInputV2) GetMessageName() string { return "policer_input_v2" }
   820  func (*PolicerInputV2) GetCrcString() string   { return "8388eb84" }
   821  func (*PolicerInputV2) GetMessageType() api.MessageType {
   822  	return api.RequestMessage
   823  }
   824  
   825  func (m *PolicerInputV2) Size() (size int) {
   826  	if m == nil {
   827  		return 0
   828  	}
   829  	size += 4 // m.PolicerIndex
   830  	size += 4 // m.SwIfIndex
   831  	size += 1 // m.Apply
   832  	return size
   833  }
   834  func (m *PolicerInputV2) Marshal(b []byte) ([]byte, error) {
   835  	if b == nil {
   836  		b = make([]byte, m.Size())
   837  	}
   838  	buf := codec.NewBuffer(b)
   839  	buf.EncodeUint32(m.PolicerIndex)
   840  	buf.EncodeUint32(uint32(m.SwIfIndex))
   841  	buf.EncodeBool(m.Apply)
   842  	return buf.Bytes(), nil
   843  }
   844  func (m *PolicerInputV2) Unmarshal(b []byte) error {
   845  	buf := codec.NewBuffer(b)
   846  	m.PolicerIndex = buf.DecodeUint32()
   847  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   848  	m.Apply = buf.DecodeBool()
   849  	return nil
   850  }
   851  
   852  // PolicerInputV2Reply defines message 'policer_input_v2_reply'.
   853  type PolicerInputV2Reply struct {
   854  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   855  }
   856  
   857  func (m *PolicerInputV2Reply) Reset()               { *m = PolicerInputV2Reply{} }
   858  func (*PolicerInputV2Reply) GetMessageName() string { return "policer_input_v2_reply" }
   859  func (*PolicerInputV2Reply) GetCrcString() string   { return "e8d4e804" }
   860  func (*PolicerInputV2Reply) GetMessageType() api.MessageType {
   861  	return api.ReplyMessage
   862  }
   863  
   864  func (m *PolicerInputV2Reply) Size() (size int) {
   865  	if m == nil {
   866  		return 0
   867  	}
   868  	size += 4 // m.Retval
   869  	return size
   870  }
   871  func (m *PolicerInputV2Reply) Marshal(b []byte) ([]byte, error) {
   872  	if b == nil {
   873  		b = make([]byte, m.Size())
   874  	}
   875  	buf := codec.NewBuffer(b)
   876  	buf.EncodeInt32(m.Retval)
   877  	return buf.Bytes(), nil
   878  }
   879  func (m *PolicerInputV2Reply) Unmarshal(b []byte) error {
   880  	buf := codec.NewBuffer(b)
   881  	m.Retval = buf.DecodeInt32()
   882  	return nil
   883  }
   884  
   885  // policer output: Apply policer as an output feature.
   886  //   - name - policer name
   887  //   - sw_if_index - interface to apply the policer
   888  //   - apply - Apply/remove
   889  //
   890  // PolicerOutput defines message 'policer_output'.
   891  type PolicerOutput struct {
   892  	Name      string                         `binapi:"string[64],name=name" json:"name,omitempty"`
   893  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   894  	Apply     bool                           `binapi:"bool,name=apply" json:"apply,omitempty"`
   895  }
   896  
   897  func (m *PolicerOutput) Reset()               { *m = PolicerOutput{} }
   898  func (*PolicerOutput) GetMessageName() string { return "policer_output" }
   899  func (*PolicerOutput) GetCrcString() string   { return "233f0ef5" }
   900  func (*PolicerOutput) GetMessageType() api.MessageType {
   901  	return api.RequestMessage
   902  }
   903  
   904  func (m *PolicerOutput) Size() (size int) {
   905  	if m == nil {
   906  		return 0
   907  	}
   908  	size += 64 // m.Name
   909  	size += 4  // m.SwIfIndex
   910  	size += 1  // m.Apply
   911  	return size
   912  }
   913  func (m *PolicerOutput) Marshal(b []byte) ([]byte, error) {
   914  	if b == nil {
   915  		b = make([]byte, m.Size())
   916  	}
   917  	buf := codec.NewBuffer(b)
   918  	buf.EncodeString(m.Name, 64)
   919  	buf.EncodeUint32(uint32(m.SwIfIndex))
   920  	buf.EncodeBool(m.Apply)
   921  	return buf.Bytes(), nil
   922  }
   923  func (m *PolicerOutput) Unmarshal(b []byte) error {
   924  	buf := codec.NewBuffer(b)
   925  	m.Name = buf.DecodeString(64)
   926  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   927  	m.Apply = buf.DecodeBool()
   928  	return nil
   929  }
   930  
   931  // PolicerOutputReply defines message 'policer_output_reply'.
   932  type PolicerOutputReply struct {
   933  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   934  }
   935  
   936  func (m *PolicerOutputReply) Reset()               { *m = PolicerOutputReply{} }
   937  func (*PolicerOutputReply) GetMessageName() string { return "policer_output_reply" }
   938  func (*PolicerOutputReply) GetCrcString() string   { return "e8d4e804" }
   939  func (*PolicerOutputReply) GetMessageType() api.MessageType {
   940  	return api.ReplyMessage
   941  }
   942  
   943  func (m *PolicerOutputReply) Size() (size int) {
   944  	if m == nil {
   945  		return 0
   946  	}
   947  	size += 4 // m.Retval
   948  	return size
   949  }
   950  func (m *PolicerOutputReply) Marshal(b []byte) ([]byte, error) {
   951  	if b == nil {
   952  		b = make([]byte, m.Size())
   953  	}
   954  	buf := codec.NewBuffer(b)
   955  	buf.EncodeInt32(m.Retval)
   956  	return buf.Bytes(), nil
   957  }
   958  func (m *PolicerOutputReply) Unmarshal(b []byte) error {
   959  	buf := codec.NewBuffer(b)
   960  	m.Retval = buf.DecodeInt32()
   961  	return nil
   962  }
   963  
   964  // PolicerOutputV2 defines message 'policer_output_v2'.
   965  type PolicerOutputV2 struct {
   966  	PolicerIndex uint32                         `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
   967  	SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   968  	Apply        bool                           `binapi:"bool,name=apply" json:"apply,omitempty"`
   969  }
   970  
   971  func (m *PolicerOutputV2) Reset()               { *m = PolicerOutputV2{} }
   972  func (*PolicerOutputV2) GetMessageName() string { return "policer_output_v2" }
   973  func (*PolicerOutputV2) GetCrcString() string   { return "8388eb84" }
   974  func (*PolicerOutputV2) GetMessageType() api.MessageType {
   975  	return api.RequestMessage
   976  }
   977  
   978  func (m *PolicerOutputV2) Size() (size int) {
   979  	if m == nil {
   980  		return 0
   981  	}
   982  	size += 4 // m.PolicerIndex
   983  	size += 4 // m.SwIfIndex
   984  	size += 1 // m.Apply
   985  	return size
   986  }
   987  func (m *PolicerOutputV2) Marshal(b []byte) ([]byte, error) {
   988  	if b == nil {
   989  		b = make([]byte, m.Size())
   990  	}
   991  	buf := codec.NewBuffer(b)
   992  	buf.EncodeUint32(m.PolicerIndex)
   993  	buf.EncodeUint32(uint32(m.SwIfIndex))
   994  	buf.EncodeBool(m.Apply)
   995  	return buf.Bytes(), nil
   996  }
   997  func (m *PolicerOutputV2) Unmarshal(b []byte) error {
   998  	buf := codec.NewBuffer(b)
   999  	m.PolicerIndex = buf.DecodeUint32()
  1000  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
  1001  	m.Apply = buf.DecodeBool()
  1002  	return nil
  1003  }
  1004  
  1005  // PolicerOutputV2Reply defines message 'policer_output_v2_reply'.
  1006  type PolicerOutputV2Reply struct {
  1007  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1008  }
  1009  
  1010  func (m *PolicerOutputV2Reply) Reset()               { *m = PolicerOutputV2Reply{} }
  1011  func (*PolicerOutputV2Reply) GetMessageName() string { return "policer_output_v2_reply" }
  1012  func (*PolicerOutputV2Reply) GetCrcString() string   { return "e8d4e804" }
  1013  func (*PolicerOutputV2Reply) GetMessageType() api.MessageType {
  1014  	return api.ReplyMessage
  1015  }
  1016  
  1017  func (m *PolicerOutputV2Reply) Size() (size int) {
  1018  	if m == nil {
  1019  		return 0
  1020  	}
  1021  	size += 4 // m.Retval
  1022  	return size
  1023  }
  1024  func (m *PolicerOutputV2Reply) Marshal(b []byte) ([]byte, error) {
  1025  	if b == nil {
  1026  		b = make([]byte, m.Size())
  1027  	}
  1028  	buf := codec.NewBuffer(b)
  1029  	buf.EncodeInt32(m.Retval)
  1030  	return buf.Bytes(), nil
  1031  }
  1032  func (m *PolicerOutputV2Reply) Unmarshal(b []byte) error {
  1033  	buf := codec.NewBuffer(b)
  1034  	m.Retval = buf.DecodeInt32()
  1035  	return nil
  1036  }
  1037  
  1038  // PolicerReset defines message 'policer_reset'.
  1039  type PolicerReset struct {
  1040  	PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
  1041  }
  1042  
  1043  func (m *PolicerReset) Reset()               { *m = PolicerReset{} }
  1044  func (*PolicerReset) GetMessageName() string { return "policer_reset" }
  1045  func (*PolicerReset) GetCrcString() string   { return "7ff7912e" }
  1046  func (*PolicerReset) GetMessageType() api.MessageType {
  1047  	return api.RequestMessage
  1048  }
  1049  
  1050  func (m *PolicerReset) Size() (size int) {
  1051  	if m == nil {
  1052  		return 0
  1053  	}
  1054  	size += 4 // m.PolicerIndex
  1055  	return size
  1056  }
  1057  func (m *PolicerReset) Marshal(b []byte) ([]byte, error) {
  1058  	if b == nil {
  1059  		b = make([]byte, m.Size())
  1060  	}
  1061  	buf := codec.NewBuffer(b)
  1062  	buf.EncodeUint32(m.PolicerIndex)
  1063  	return buf.Bytes(), nil
  1064  }
  1065  func (m *PolicerReset) Unmarshal(b []byte) error {
  1066  	buf := codec.NewBuffer(b)
  1067  	m.PolicerIndex = buf.DecodeUint32()
  1068  	return nil
  1069  }
  1070  
  1071  // PolicerResetReply defines message 'policer_reset_reply'.
  1072  type PolicerResetReply struct {
  1073  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1074  }
  1075  
  1076  func (m *PolicerResetReply) Reset()               { *m = PolicerResetReply{} }
  1077  func (*PolicerResetReply) GetMessageName() string { return "policer_reset_reply" }
  1078  func (*PolicerResetReply) GetCrcString() string   { return "e8d4e804" }
  1079  func (*PolicerResetReply) GetMessageType() api.MessageType {
  1080  	return api.ReplyMessage
  1081  }
  1082  
  1083  func (m *PolicerResetReply) Size() (size int) {
  1084  	if m == nil {
  1085  		return 0
  1086  	}
  1087  	size += 4 // m.Retval
  1088  	return size
  1089  }
  1090  func (m *PolicerResetReply) Marshal(b []byte) ([]byte, error) {
  1091  	if b == nil {
  1092  		b = make([]byte, m.Size())
  1093  	}
  1094  	buf := codec.NewBuffer(b)
  1095  	buf.EncodeInt32(m.Retval)
  1096  	return buf.Bytes(), nil
  1097  }
  1098  func (m *PolicerResetReply) Unmarshal(b []byte) error {
  1099  	buf := codec.NewBuffer(b)
  1100  	m.Retval = buf.DecodeInt32()
  1101  	return nil
  1102  }
  1103  
  1104  // PolicerUpdate defines message 'policer_update'.
  1105  type PolicerUpdate struct {
  1106  	PolicerIndex uint32                      `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
  1107  	Infos        policer_types.PolicerConfig `binapi:"policer_config,name=infos" json:"infos,omitempty"`
  1108  }
  1109  
  1110  func (m *PolicerUpdate) Reset()               { *m = PolicerUpdate{} }
  1111  func (*PolicerUpdate) GetMessageName() string { return "policer_update" }
  1112  func (*PolicerUpdate) GetCrcString() string   { return "fd039ef0" }
  1113  func (*PolicerUpdate) GetMessageType() api.MessageType {
  1114  	return api.RequestMessage
  1115  }
  1116  
  1117  func (m *PolicerUpdate) Size() (size int) {
  1118  	if m == nil {
  1119  		return 0
  1120  	}
  1121  	size += 4 // m.PolicerIndex
  1122  	size += 4 // m.Infos.Cir
  1123  	size += 4 // m.Infos.Eir
  1124  	size += 8 // m.Infos.Cb
  1125  	size += 8 // m.Infos.Eb
  1126  	size += 1 // m.Infos.RateType
  1127  	size += 1 // m.Infos.RoundType
  1128  	size += 1 // m.Infos.Type
  1129  	size += 1 // m.Infos.ColorAware
  1130  	size += 1 // m.Infos.ConformAction.Type
  1131  	size += 1 // m.Infos.ConformAction.Dscp
  1132  	size += 1 // m.Infos.ExceedAction.Type
  1133  	size += 1 // m.Infos.ExceedAction.Dscp
  1134  	size += 1 // m.Infos.ViolateAction.Type
  1135  	size += 1 // m.Infos.ViolateAction.Dscp
  1136  	return size
  1137  }
  1138  func (m *PolicerUpdate) Marshal(b []byte) ([]byte, error) {
  1139  	if b == nil {
  1140  		b = make([]byte, m.Size())
  1141  	}
  1142  	buf := codec.NewBuffer(b)
  1143  	buf.EncodeUint32(m.PolicerIndex)
  1144  	buf.EncodeUint32(m.Infos.Cir)
  1145  	buf.EncodeUint32(m.Infos.Eir)
  1146  	buf.EncodeUint64(m.Infos.Cb)
  1147  	buf.EncodeUint64(m.Infos.Eb)
  1148  	buf.EncodeUint8(uint8(m.Infos.RateType))
  1149  	buf.EncodeUint8(uint8(m.Infos.RoundType))
  1150  	buf.EncodeUint8(uint8(m.Infos.Type))
  1151  	buf.EncodeBool(m.Infos.ColorAware)
  1152  	buf.EncodeUint8(uint8(m.Infos.ConformAction.Type))
  1153  	buf.EncodeUint8(m.Infos.ConformAction.Dscp)
  1154  	buf.EncodeUint8(uint8(m.Infos.ExceedAction.Type))
  1155  	buf.EncodeUint8(m.Infos.ExceedAction.Dscp)
  1156  	buf.EncodeUint8(uint8(m.Infos.ViolateAction.Type))
  1157  	buf.EncodeUint8(m.Infos.ViolateAction.Dscp)
  1158  	return buf.Bytes(), nil
  1159  }
  1160  func (m *PolicerUpdate) Unmarshal(b []byte) error {
  1161  	buf := codec.NewBuffer(b)
  1162  	m.PolicerIndex = buf.DecodeUint32()
  1163  	m.Infos.Cir = buf.DecodeUint32()
  1164  	m.Infos.Eir = buf.DecodeUint32()
  1165  	m.Infos.Cb = buf.DecodeUint64()
  1166  	m.Infos.Eb = buf.DecodeUint64()
  1167  	m.Infos.RateType = policer_types.Sse2QosRateType(buf.DecodeUint8())
  1168  	m.Infos.RoundType = policer_types.Sse2QosRoundType(buf.DecodeUint8())
  1169  	m.Infos.Type = policer_types.Sse2QosPolicerType(buf.DecodeUint8())
  1170  	m.Infos.ColorAware = buf.DecodeBool()
  1171  	m.Infos.ConformAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
  1172  	m.Infos.ConformAction.Dscp = buf.DecodeUint8()
  1173  	m.Infos.ExceedAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
  1174  	m.Infos.ExceedAction.Dscp = buf.DecodeUint8()
  1175  	m.Infos.ViolateAction.Type = policer_types.Sse2QosActionType(buf.DecodeUint8())
  1176  	m.Infos.ViolateAction.Dscp = buf.DecodeUint8()
  1177  	return nil
  1178  }
  1179  
  1180  // PolicerUpdateReply defines message 'policer_update_reply'.
  1181  type PolicerUpdateReply struct {
  1182  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
  1183  }
  1184  
  1185  func (m *PolicerUpdateReply) Reset()               { *m = PolicerUpdateReply{} }
  1186  func (*PolicerUpdateReply) GetMessageName() string { return "policer_update_reply" }
  1187  func (*PolicerUpdateReply) GetCrcString() string   { return "e8d4e804" }
  1188  func (*PolicerUpdateReply) GetMessageType() api.MessageType {
  1189  	return api.ReplyMessage
  1190  }
  1191  
  1192  func (m *PolicerUpdateReply) Size() (size int) {
  1193  	if m == nil {
  1194  		return 0
  1195  	}
  1196  	size += 4 // m.Retval
  1197  	return size
  1198  }
  1199  func (m *PolicerUpdateReply) Marshal(b []byte) ([]byte, error) {
  1200  	if b == nil {
  1201  		b = make([]byte, m.Size())
  1202  	}
  1203  	buf := codec.NewBuffer(b)
  1204  	buf.EncodeInt32(m.Retval)
  1205  	return buf.Bytes(), nil
  1206  }
  1207  func (m *PolicerUpdateReply) Unmarshal(b []byte) error {
  1208  	buf := codec.NewBuffer(b)
  1209  	m.Retval = buf.DecodeInt32()
  1210  	return nil
  1211  }
  1212  
  1213  func init() { file_policer_binapi_init() }
  1214  func file_policer_binapi_init() {
  1215  	api.RegisterMessage((*PolicerAdd)(nil), "policer_add_4d949e35")
  1216  	api.RegisterMessage((*PolicerAddDel)(nil), "policer_add_del_2b31dd38")
  1217  	api.RegisterMessage((*PolicerAddDelReply)(nil), "policer_add_del_reply_a177cef2")
  1218  	api.RegisterMessage((*PolicerAddReply)(nil), "policer_add_reply_a177cef2")
  1219  	api.RegisterMessage((*PolicerBind)(nil), "policer_bind_dcf516f9")
  1220  	api.RegisterMessage((*PolicerBindReply)(nil), "policer_bind_reply_e8d4e804")
  1221  	api.RegisterMessage((*PolicerBindV2)(nil), "policer_bind_v2_f87bd3c0")
  1222  	api.RegisterMessage((*PolicerBindV2Reply)(nil), "policer_bind_v2_reply_e8d4e804")
  1223  	api.RegisterMessage((*PolicerDel)(nil), "policer_del_7ff7912e")
  1224  	api.RegisterMessage((*PolicerDelReply)(nil), "policer_del_reply_e8d4e804")
  1225  	api.RegisterMessage((*PolicerDetails)(nil), "policer_details_72d0e248")
  1226  	api.RegisterMessage((*PolicerDump)(nil), "policer_dump_35f1ae0f")
  1227  	api.RegisterMessage((*PolicerDumpV2)(nil), "policer_dump_v2_7ff7912e")
  1228  	api.RegisterMessage((*PolicerInput)(nil), "policer_input_233f0ef5")
  1229  	api.RegisterMessage((*PolicerInputReply)(nil), "policer_input_reply_e8d4e804")
  1230  	api.RegisterMessage((*PolicerInputV2)(nil), "policer_input_v2_8388eb84")
  1231  	api.RegisterMessage((*PolicerInputV2Reply)(nil), "policer_input_v2_reply_e8d4e804")
  1232  	api.RegisterMessage((*PolicerOutput)(nil), "policer_output_233f0ef5")
  1233  	api.RegisterMessage((*PolicerOutputReply)(nil), "policer_output_reply_e8d4e804")
  1234  	api.RegisterMessage((*PolicerOutputV2)(nil), "policer_output_v2_8388eb84")
  1235  	api.RegisterMessage((*PolicerOutputV2Reply)(nil), "policer_output_v2_reply_e8d4e804")
  1236  	api.RegisterMessage((*PolicerReset)(nil), "policer_reset_7ff7912e")
  1237  	api.RegisterMessage((*PolicerResetReply)(nil), "policer_reset_reply_e8d4e804")
  1238  	api.RegisterMessage((*PolicerUpdate)(nil), "policer_update_fd039ef0")
  1239  	api.RegisterMessage((*PolicerUpdateReply)(nil), "policer_update_reply_e8d4e804")
  1240  }
  1241  
  1242  // Messages returns list of all messages in this module.
  1243  func AllMessages() []api.Message {
  1244  	return []api.Message{
  1245  		(*PolicerAdd)(nil),
  1246  		(*PolicerAddDel)(nil),
  1247  		(*PolicerAddDelReply)(nil),
  1248  		(*PolicerAddReply)(nil),
  1249  		(*PolicerBind)(nil),
  1250  		(*PolicerBindReply)(nil),
  1251  		(*PolicerBindV2)(nil),
  1252  		(*PolicerBindV2Reply)(nil),
  1253  		(*PolicerDel)(nil),
  1254  		(*PolicerDelReply)(nil),
  1255  		(*PolicerDetails)(nil),
  1256  		(*PolicerDump)(nil),
  1257  		(*PolicerDumpV2)(nil),
  1258  		(*PolicerInput)(nil),
  1259  		(*PolicerInputReply)(nil),
  1260  		(*PolicerInputV2)(nil),
  1261  		(*PolicerInputV2Reply)(nil),
  1262  		(*PolicerOutput)(nil),
  1263  		(*PolicerOutputReply)(nil),
  1264  		(*PolicerOutputV2)(nil),
  1265  		(*PolicerOutputV2Reply)(nil),
  1266  		(*PolicerReset)(nil),
  1267  		(*PolicerResetReply)(nil),
  1268  		(*PolicerUpdate)(nil),
  1269  		(*PolicerUpdateReply)(nil),
  1270  	}
  1271  }