---
name: "lc_tuntap_create"
section: "3"
platform: "linux"
package: "liblibrecast-dev"
version: "0.9.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/lc_tuntap_create"
---

# lc\_tuntap\_create(3)

create TUN/TAP devices

## NAME

lc\_tuntap\_create - create TUN/TAP devices

## LIBRARY

Librecast library (*liblibrecast*, *-llibrecast*)

## SYNOPSIS

```
#include <librecast/if.h>
```

**int lc\_tuntap\_create(char \****ifname***, int** *flags***);**

Compile and link with *-llibrecast*.

The *flags* argument may contain the following flags.  One of IFF\_TUN or IFF\_TAP is required.

- **IFF\_TUN**

  create TUN device (no Ethernet headers)

- **IFF\_TAP**

  create TAP device

- **IFF\_NO\_PI**

  Do not provide packet information.

- **IFF\_MULTI\_QUEUE**

  Create a queue of multiqueue device.

## DESCRIPTION

**lc\_tuntap\_create**() creates a new TUN/TAP device

## RETURN VALUE

**lc\_socket\_new**() On  success, a file descriptor for the new socket is returned.  On error, -1 is returned, and errno is set appropriately.
