NOZZLE_OPEN(3)

✨ NOZZLE_OPEN(3) ✨

okay bestie, welcome to the Kronosnet Programmer's Manual πŸ’– this one's about making a brand new tap device, and it's lowkey iconic, let's go 🫢


πŸŽ€ NAME πŸŽ€

nozzle_open β€” create a new tap device on the system. yes, we're birthing a whole interface, main character energy fr fr πŸ’…


🌸 SYNOPSIS 🌸

#include <libnozzle.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

nozzle_open β€” the moment you call it, it goes and does the thing. here's the tea on every argument, no gatekeeping 🌈

  • devname β€” pointer to the device name, and that buffer's gotta be at least IFNAMSIZ in size. if the dev strlen is 0, the system just picks a name for you automatically, slay. but if you do hand it a string, the system will try to create a device with exactly that name.
NOTE: on FreeBSD the tap device names can only be tapX, where X is a number from 0 to 255. that's a hard limit, bestie, no negotiating πŸ’€ on Linux that limitation does not apply, so you've got way more freedom there.

also the name has to be unique to the system. if an interface with that same name is already configured on the system, you're getting an error back, periodt.

  • devname_size β€” length of the buffer you provided in dev (has to be at least IFNAMSIZ). don't skimp on it πŸ™ˆ
  • updownpath β€” nozzle supports the typical filesystem structure for executing actions for: down.d, post-down.d, pre-up.d, up.d, all in the form of:
updownpath/<action>/<interface_name>

updownpath is basically telling it where to find those directories on the filesystem, and it must be an absolute path. no relative paths, no shortcuts, nope 🧚


⭐ RETURN VALUE ⭐

nozzle_open returns a pointer to a nozzle struct on success, and NULL on error β€” and when that happens, errno is set. so like, always check your return value, bestie, that's the vibe check πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

the whole friend group, go read them too πŸ“šβœ¨


Copyright (C) 2010-2026 Red Hat, Inc. All rights reserved.


and that's the page, bestie!! πŸŽ€ this was kronosnet, dated 2026-07-20, and you just read the whole thing like the icon you are. mwah, go write some slay code πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from