+// PolicerBind defines message 'policer_bind'.
+type PolicerBind struct {
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
+ WorkerIndex uint32 `binapi:"u32,name=worker_index" json:"worker_index,omitempty"`
+ BindEnable bool `binapi:"bool,name=bind_enable" json:"bind_enable,omitempty"`
+}
+
+func (m *PolicerBind) Reset() { *m = PolicerBind{} }
+func (*PolicerBind) GetMessageName() string { return "policer_bind" }
+func (*PolicerBind) GetCrcString() string { return "dcf516f9" }
+func (*PolicerBind) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *PolicerBind) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 64 // m.Name
+ size += 4 // m.WorkerIndex
+ size += 1 // m.BindEnable
+ return size
+}
+func (m *PolicerBind) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeString(m.Name, 64)
+ buf.EncodeUint32(m.WorkerIndex)
+ buf.EncodeBool(m.BindEnable)
+ return buf.Bytes(), nil
+}
+func (m *PolicerBind) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Name = buf.DecodeString(64)
+ m.WorkerIndex = buf.DecodeUint32()
+ m.BindEnable = buf.DecodeBool()
+ return nil
+}
+
+// PolicerBindReply defines message 'policer_bind_reply'.
+type PolicerBindReply struct {
+ Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
+}
+
+func (m *PolicerBindReply) Reset() { *m = PolicerBindReply{} }
+func (*PolicerBindReply) GetMessageName() string { return "policer_bind_reply" }
+func (*PolicerBindReply) GetCrcString() string { return "e8d4e804" }
+func (*PolicerBindReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *PolicerBindReply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ return size
+}
+func (m *PolicerBindReply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *PolicerBindReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ return nil
+}
+