example

package
v0.0.0-...-c27c9a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 1

Documentation

Overview

Package example defines two seccomp programs ("example_program1" and "example_program2") to be embedded in the `usage` package in this directory.

Index

Constants

View Source
const (
	FD1 = "fd1"
	FD2 = "fd2"
)

Variable names used in the precompiled programs. In this example, we have two file descriptors, which fit in 32 bits. If you need a 64-bit variable, simply declare two 32-bit variables and concatenate them to a single 64-bit number in the function that generates the `ProgramDesc`.

View Source
const (
	// Program1Name is the name of the first example program.
	// It allows reading from `FD1` and `FD2`, but writing only to `FD1`.
	Program1Name = "example_program1"

	// Program2Name is the name of the second example program.
	// It allows reading from `FD1` and `FD2`, but writing only to `FD2`.
	Program2Name = "example_program2"
)

Name of the example programs.

Variables

This section is empty.

Functions

func PrecompiledPrograms

func PrecompiledPrograms() ([]precompiledseccomp.Program, error)

PrecompiledPrograms defines the seccomp-bpf programs to precompile. This function is called by the generated `go_binary` rule.

func Program1

Program1 returns a program that allows reading from FDs `FD1` and `FD2`, but writing only to FD `FD1`.

func Program2

Program2 returns a program that allows reading from FDs `FD1` and `FD2`, but writing only to FD `FD2`.

Types

This section is empty.

Directories

Path Synopsis
Package usage shows how to use precompiled seccomp-bpf programs.
Package usage shows how to use precompiled seccomp-bpf programs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL