MCPcopy Create free account
hub / github.com/google/nftables / marshalData

Method marshalData

expr/queue.go:57–66  ·  view source on GitHub ↗
(fam byte)

Source from the content-addressed store, hash-verified

55}
56
57func (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
68func (e *Queue) unmarshal(fam byte, data []byte) error {
69 ad, err := netlink.NewAttributeDecoder(data)

Callers 1

marshalMethod · 0.95

Calls 1

PutUint16Method · 0.65

Tested by

no test coverage detected