(magic uint32)
| 818 | } |
| 819 | |
| 820 | func parseSetDatatype(magic uint32) (SetDatatype, error) { |
| 821 | types := make([]SetDatatype, 0, 32/SetConcatTypeBits) |
| 822 | for magic != 0 { |
| 823 | t := magic & SetConcatTypeMask |
| 824 | magic = magic >> SetConcatTypeBits |
| 825 | dt, ok := nftDatatypesByMagic[t] |
| 826 | if !ok { |
| 827 | return TypeInvalid, fmt.Errorf("could not determine data type %+v", dt) |
| 828 | } |
| 829 | // Because we start with the last type, we insert the later types at the front. |
| 830 | types = append([]SetDatatype{dt}, types...) |
| 831 | } |
| 832 | |
| 833 | dt, err := ConcatSetType(types...) |
| 834 | if err != nil { |
| 835 | return TypeInvalid, fmt.Errorf("could not create data type: %w", err) |
| 836 | } |
| 837 | return dt, nil |
| 838 | } |
| 839 | |
| 840 | var ( |
| 841 | newElemHeaderType = netlink.HeaderType((unix.NFNL_SUBSYS_NFTABLES << 8) | unix.NFT_MSG_NEWSETELEM) |
searching dependent graphs…