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

Method unmarshal

expr/socket.go:74–92  ·  view source on GitHub ↗
(fam byte, data []byte)

Source from the content-addressed store, hash-verified

72}
73
74func (e *Socket) unmarshal(fam byte, data []byte) error {
75 ad, err := netlink.NewAttributeDecoder(data)
76 if err != nil {
77 return err
78 }
79
80 ad.ByteOrder = binary.BigEndian
81 for ad.Next() {
82 switch ad.Type() {
83 case NFTA_SOCKET_DREG:
84 e.Register = ad.Uint32()
85 case NFTA_SOCKET_KEY:
86 e.Key = SocketKey(ad.Uint32())
87 case NFTA_SOCKET_LEVEL:
88 e.Level = ad.Uint32()
89 }
90 }
91 return ad.Err()
92}

Callers 1

TestSocketFunction · 0.95

Calls 2

SocketKeyTypeAlias · 0.85
Uint32Method · 0.65

Tested by 1

TestSocketFunction · 0.76