package utils

import "github.com/containernetworking/cni/pkg/utils"

Index

Functions

func ValidateContainerID

func ValidateContainerID(containerID string) *types.Error

ValidateContainerID will validate that the supplied containerID is not empty does not contain invalid characters

func ValidateInterfaceName

func ValidateInterfaceName(ifName string) *types.Error

ValidateInterfaceName will validate the interface name based on the four rules below 1. The name must not be empty 2. The name must be less than 16 characters 3. The name must not be "." or ".." 4. The name must not contain / or : or any whitespace characters ref to https://github.com/torvalds/linux/blob/master/net/core/dev.c#L1024

func ValidateNetworkName

func ValidateNetworkName(networkName string) *types.Error

ValidateNetworkName will validate that the supplied networkName does not contain invalid characters

Source Files

utils.go

Version
v1.3.0 (latest)
Published
Apr 7, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
1 week ago

Tools for package owners.