nozzle_open - Man Page

create a new tap device on the system.

Synopsis

#include <libnozzle.h>

nozzle_t nozzle_open(
    char         *devname,
    size_t        devname_size,
    const char   *updownpath
);

Description

nozzle_open

devname - pointer to device name of at least size IFNAMSIZ. if the dev strlen is 0, then the system will assign a name automatically. if a string is specified, the system will try to create a device with the specified name. NOTE: on FreeBSD the tap device names can only be tapX where X is a number from 0 to 255. On Linux such limitation does not apply. The name must be unique to the system. If an interface with the same name is already configured on the system, an error will be returned.

devname_size - length of the buffer provided in dev (has to be at least IFNAMSIZ).

updownpath - nozzle supports the typical filesystem structure to execute actions for: down.d post-down.d pre-up.d up.d in the form of: updownpath/<action>/<interface_name> updownpath specifies where to find those directories on the filesystem and it must be an absolute path.

Return Value

nozzle_open returns a pointer to a nozzle struct on success NULL on error and errno is set.

See Also

nozzle_close(3), nozzle_set_mtu(3), nozzle_get_fd(3), nozzle_get_mtu(3), nozzle_reset_mtu(3), nozzle_set_up(3), nozzle_get_ips(3), nozzle_set_down(3), nozzle_reset_mac(3), nozzle_get_handle_by_name(3), nozzle_run_updown(3), nozzle_del_ip(3), nozzle_get_mac(3), nozzle_set_mac(3), nozzle_get_name_by_handle(3), nozzle_add_ip(3)

Referenced By

nozzle_add_ip(3), nozzle_close(3), nozzle_del_ip(3), nozzle_get_fd(3), nozzle_get_handle_by_name(3), nozzle_get_ips(3), nozzle_get_mac(3), nozzle_get_mtu(3), nozzle_get_name_by_handle(3), nozzle_reset_mac(3), nozzle_reset_mtu(3), nozzle_run_updown(3), nozzle_set_down(3), nozzle_set_mac(3), nozzle_set_mtu(3), nozzle_set_up(3).

2024-12-02 Kronosnet Programmer's Manual