File: unknown.go

package info (click to toggle)
golang-github-google-nftables 0.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 756 kB
  • sloc: makefile: 8
file content (17 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package xt

// Unknown represents the bytes Info payload for unknown Info types where no
// dedicated match/target info type has (yet) been defined.
type Unknown []byte

func (x *Unknown) marshal(fam TableFamily, rev uint32) ([]byte, error) {
	// In case of unknown payload we assume its creator knows what she/he does
	// and thus we don't do any alignment padding. Just take the payload "as
	// is".
	return *x, nil
}

func (x *Unknown) unmarshal(fam TableFamily, rev uint32, data []byte) error {
	*x = data
	return nil
}