github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/rootlessport/rootlessport_linux.go (about)

     1  //go:build linux
     2  // +build linux
     3  
     4  // Package rootlessport provides reexec for RootlessKit-based port forwarder.
     5  //
     6  // init() contains reexec.Register() for ReexecKey .
     7  //
     8  // The reexec requires Config to be provided via stdin.
     9  //
    10  // The reexec writes human-readable error message on stdout on error.
    11  //
    12  // Debug log is printed on stderr.
    13  package rootlessport
    14  
    15  import (
    16  	"github.com/containers/common/libnetwork/types"
    17  )
    18  
    19  const (
    20  	// BinaryName is the binary name for the parent process.
    21  	BinaryName = "rootlessport"
    22  )
    23  
    24  // Config needs to be provided to the process via stdin as a JSON string.
    25  // stdin needs to be closed after the message has been written.
    26  type Config struct {
    27  	Mappings    []types.PortMapping
    28  	NetNSPath   string
    29  	ExitFD      int
    30  	ReadyFD     int
    31  	TmpDir      string
    32  	ChildIP     string
    33  	ContainerID string
    34  	RootlessCNI bool
    35  }