Skip to content

Supports map of maps#298

Open
masibw wants to merge 1 commit intoiovisor:masterfrom
masibw:support_map_of_maps
Open

Supports map of maps#298
masibw wants to merge 1 commit intoiovisor:masterfrom
masibw:support_map_of_maps

Conversation

@masibw
Copy link
Copy Markdown

@masibw masibw commented Jun 22, 2021

Hi team, this PR solve #297.

We have to use the table's file descriptor when using BPF_HASH_OF_MAPS or BPF_ARRAY_OF_MAPS. But now gobpf doesn't have the method. And also we have to pass the unsafe.Pointer of the file descriptor. So, I made the SetMap method.

This is a example.

	parentTable := bpf.NewTable(m.TableId("parent_list"), m)
    	innerTable := bpf.NewTable(m.TableId("inner_list"), m)
        fd := innerTable.Fd()
         if err := parentTable.SetMap(unsafe.Pointer(parentKey), fd); err != nil {
	 	fmt.Fprintf(os.Stderr, "Failed to add data to parent_list: %s\n", err)
	 	os.Exit(1)
	 }

Please review this, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant