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

Method marshal

expr/expr.go:447–456  ·  view source on GitHub ↗
(fam byte)

Source from the content-addressed store, hash-verified

445}
446
447func (e *Cmp) marshal(fam byte) ([]byte, error) {
448 exprData, err := e.marshalData(fam)
449 if err != nil {
450 return nil, err
451 }
452 return netlink.MarshalAttributes([]netlink.Attribute{
453 {Type: unix.NFTA_EXPR_NAME, Data: []byte("cmp\x00")},
454 {Type: unix.NLA_F_NESTED | unix.NFTA_EXPR_DATA, Data: exprData},
455 })
456}
457
458func (e *Cmp) marshalData(fam byte) ([]byte, error) {
459 cmpData, err := netlink.MarshalAttributes([]netlink.Attribute{

Callers

nothing calls this directly

Calls 1

marshalDataMethod · 0.95

Tested by

no test coverage detected