| 55 | } |
| 56 | |
| 57 | func (e *Queue) marshalData(fam byte) ([]byte, error) { |
| 58 | if e.Total == 0 { |
| 59 | e.Total = 1 // The total default value is 1 |
| 60 | } |
| 61 | return netlink.MarshalAttributes([]netlink.Attribute{ |
| 62 | {Type: unix.NFTA_QUEUE_NUM, Data: binaryutil.BigEndian.PutUint16(e.Num)}, |
| 63 | {Type: unix.NFTA_QUEUE_TOTAL, Data: binaryutil.BigEndian.PutUint16(e.Total)}, |
| 64 | {Type: unix.NFTA_QUEUE_FLAGS, Data: binaryutil.BigEndian.PutUint16(uint16(e.Flag))}, |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | func (e *Queue) unmarshal(fam byte, data []byte) error { |
| 69 | ad, err := netlink.NewAttributeDecoder(data) |