func NewDriver(logWriter io.Writer, stateDir string) (port.ParentDriver, error) {
	socketPath := filepath.Join(stateDir, ".bp.sock")
	childReadyPipePath := filepath.Join(stateDir, ".bp-ready.pipe")
	if err := os.RemoveAll(childReadyPipePath); err != nil {
		return nil, fmt.Errorf("cannot remove %s: %w", childReadyPipePath, err)
	}
	if err := syscall.Mkfifo(childReadyPipePath, 0600); err != nil {
		return nil, fmt.Errorf("cannot mkfifo %s: %w", childReadyPipePath, err)
	}
	d := driver{
		logWriter:          logWriter,
		socketPath:         socketPath,
		childReadyPipePath: childReadyPipePath,
		ports:              make(map[int]*port.Status, 0),
		stoppers:           make(map[int]func(context.Context) error, 0),
		nextID:             1,
	}
	return &d, nil
}
NewDriver for builtin driver.
package parent
import (
	"context"
	"errors"
	"fmt"
	"io"
	"net"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	"sync"
	"syscall"
	"time"
	"github.com/rootless-containers/rootlesskit/pkg/api"
	"github.com/rootless-containers/rootlesskit/pkg/port"
	"github.com/rootless-containers/rootlesskit/pkg/port/builtin/msg"
	"github.com/rootless-containers/rootlesskit/pkg/port/builtin/opaque"
	"github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/tcp"
	"github.com/rootless-containers/rootlesskit/pkg/port/builtin/parent/udp"
	"github.com/rootless-containers/rootlesskit/pkg/port/portutil"
)