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

Method marshalData

expr/byteorder.go:51–59  ·  view source on GitHub ↗
(fam byte)

Source from the content-addressed store, hash-verified

49}
50
51func (e *Byteorder) marshalData(fam byte) ([]byte, error) {
52 return netlink.MarshalAttributes([]netlink.Attribute{
53 {Type: unix.NFTA_BYTEORDER_SREG, Data: binaryutil.BigEndian.PutUint32(e.SourceRegister)},
54 {Type: unix.NFTA_BYTEORDER_DREG, Data: binaryutil.BigEndian.PutUint32(e.DestRegister)},
55 {Type: unix.NFTA_BYTEORDER_OP, Data: binaryutil.BigEndian.PutUint32(uint32(e.Op))},
56 {Type: unix.NFTA_BYTEORDER_LEN, Data: binaryutil.BigEndian.PutUint32(e.Len)},
57 {Type: unix.NFTA_BYTEORDER_SIZE, Data: binaryutil.BigEndian.PutUint32(e.Size)},
58 })
59}
60
61func (e *Byteorder) unmarshal(fam byte, data []byte) error {
62 return fmt.Errorf("not yet implemented")

Callers 1

marshalMethod · 0.95

Calls 1

PutUint32Method · 0.65

Tested by

no test coverage detected