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

Method marshalData

expr/reject.go:41–46  ·  view source on GitHub ↗
(fam byte)

Source from the content-addressed store, hash-verified

39}
40
41func (e *Reject) marshalData(fam byte) ([]byte, error) {
42 return netlink.MarshalAttributes([]netlink.Attribute{
43 {Type: unix.NFTA_REJECT_TYPE, Data: binaryutil.BigEndian.PutUint32(e.Type)},
44 {Type: unix.NFTA_REJECT_ICMP_CODE, Data: []byte{e.Code}},
45 })
46}
47
48func (e *Reject) unmarshal(fam byte, data []byte) error {
49 ad, err := netlink.NewAttributeDecoder(data)

Callers 1

marshalMethod · 0.95

Calls 1

PutUint32Method · 0.65

Tested by

no test coverage detected