Documentation ¶
Overview ¶
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.
Index ¶
- Constants
- func AllocateIP(ctx context.Context, ipnet *net.IPNet, iface *net.Interface, ...) (net.IP, error)
- func BigIntToIP(v *big.Int) net.IP
- func BridgeIPs(bridge *netlink.Bridge) ([]string, error)
- func IPToBigInt(ip net.IP) *big.Int
- func IncreaseIP(ip net.IP) net.IP
- func IsUnicastIP(ip net.IP, mask net.IPMask) bool
- func NewNetworkServiceV1alpha1(ctx context.Context, opts ...any) (networkv1alpha1.NetworkService, error)
Constants ¶
View Source
const (
// DefaultMTU is the default MTU for new bridge interfaces.
DefaultMTU = 1500
)
Variables ¶
This section is empty.
Functions ¶
func AllocateIP ¶
func AllocateIP(ctx context.Context, ipnet *net.IPNet, iface *net.Interface, bridge *netlink.Bridge) (net.IP, error)
For a given IP network, bridge (and its interface), allocate a free IP address.
func BigIntToIP ¶
BigIntToIP converts 128 bit integer into a 4 bytes IP address.
func IPToBigInt ¶
IpToBigInt converts a 4 bytes IP into a 128 bit integer.
func IsUnicastIP ¶
IsUnicastIP returns true if the provided IP address and network mask is a unicast address.
func NewNetworkServiceV1alpha1 ¶
func NewNetworkServiceV1alpha1(ctx context.Context, opts ...any) (networkv1alpha1.NetworkService, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.