## NMSettingTun

NMSettingTun — Describes connection properties for TUN/TAP interfaces

## Functions

NMSetting * | nm_setting_tun_new ()
NMSettingTunMode | nm_setting_tun_get_mode ()
const char * | nm_setting_tun_get_owner ()
const char * | nm_setting_tun_get_group ()
gboolean | nm_setting_tun_get_pi ()
gboolean | nm_setting_tun_get_vnet_hdr ()
gboolean | nm_setting_tun_get_multi_queue ()

## Properties

gchar * | group | Read / Write
guint | mode | Read / Write / Construct
gboolean | multi-queue | Read / Write
gchar * | owner | Read / Write
gboolean | pi | Read / Write
gboolean | vnet-hdr | Read / Write

## Types and Values

#define | NM_SETTING_TUN_SETTING_NAME
#define | NM_SETTING_TUN_MODE
#define | NM_SETTING_TUN_OWNER
#define | NM_SETTING_TUN_GROUP
#define | NM_SETTING_TUN_PI
#define | NM_SETTING_TUN_VNET_HDR
#define | NM_SETTING_TUN_MULTI_QUEUE
enum | NMSettingTunMode
| NMSettingTun

## Object Hierarchy

        GEnum
        ╰── NMSettingTunMode
        GObject
        ╰── NMSetting
            ╰── NMSettingTun

## Description

The NMSettingTun object is a NMSetting subclass that describes properties necessary for connection to TUN/TAP interfaces.

## Functions

### nm_setting_tun_new ()

    NMSetting *
    nm_setting_tun_new (void);

Creates a new NMSettingTun object with default values.

#### Returns

the new empty NMSettingTun object.

[transfer full]

Since: 1.2

### nm_setting_tun_get_mode ()

    NMSettingTunMode
    nm_setting_tun_get_mode (NMSettingTun *setting);

#### Parameters

setting | the NMSettingTun |

#### Returns

the “mode” property of the setting

Since: 1.2

### nm_setting_tun_get_owner ()

    const char *
    nm_setting_tun_get_owner (NMSettingTun *setting);

#### Parameters

setting | the NMSettingTun |

#### Returns

the “owner” property of the setting

Since: 1.2

### nm_setting_tun_get_group ()

    const char *
    nm_setting_tun_get_group (NMSettingTun *setting);

#### Parameters

setting | the NMSettingTun |

#### Returns

the “group” property of the setting

Since: 1.2

### nm_setting_tun_get_pi ()

    gboolean
    nm_setting_tun_get_pi (NMSettingTun *setting);

#### Parameters

setting | the NMSettingTun |

#### Returns

the “pi” property of the setting

Since: 1.2

### nm_setting_tun_get_vnet_hdr ()

    gboolean
    nm_setting_tun_get_vnet_hdr (NMSettingTun *setting);

#### Parameters

setting | the NMSettingTun |

#### Returns

the “vnet_hdr” property of the setting

Since: 1.2

### nm_setting_tun_get_multi_queue ()

    gboolean
    nm_setting_tun_get_multi_queue (NMSettingTun *setting);

#### Parameters

setting | the NMSettingTun |

#### Returns

the “multi-queue” property of the setting

Since: 1.2

## Types and Values

### NM_SETTING_TUN_SETTING_NAME

    #define NM_SETTING_TUN_SETTING_NAME         "tun"

### NM_SETTING_TUN_MODE

    #define NM_SETTING_TUN_MODE                 "mode"

### NM_SETTING_TUN_OWNER

    #define NM_SETTING_TUN_OWNER                "owner"

### NM_SETTING_TUN_GROUP

    #define NM_SETTING_TUN_GROUP                "group"

### NM_SETTING_TUN_PI

    #define NM_SETTING_TUN_PI                   "pi"

### NM_SETTING_TUN_VNET_HDR

    #define NM_SETTING_TUN_VNET_HDR             "vnet-hdr"

### NM_SETTING_TUN_MULTI_QUEUE

    #define NM_SETTING_TUN_MULTI_QUEUE          "multi-queue"

### enum NMSettingTunMode

NMSettingTunMode values indicate the device type (TUN/TAP)

#### Members

NM_SETTING_TUN_MODE_UNKNOWN | an unknown device type |
NM_SETTING_TUN_MODE_TUN | a TUN device |
NM_SETTING_TUN_MODE_TAP | a TAP device |

### NMSettingTun

    typedef struct _NMSettingTun NMSettingTun;

## Property Details

### The `“group”` property

      “group”                    gchar *

The group ID which will own the device. If set to `NULL` everyone will be able to use the device.

Flags: Read / Write

Default value: NULL

Since: 1.2

### The `“mode”` property

      “mode”                     guint

The operating mode of the virtual device. Allowed values are `NM_SETTING_TUN_MODE_TUN` to create a layer 3 device and `NM_SETTING_TUN_MODE_TAP` to create an Ethernet-like layer 2 one.

Flags: Read / Write / Construct

Default value: 1

Since: 1.2

### The `“multi-queue”` property

      “multi-queue”              gboolean

If the property is set to `TRUE`, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving. Otherwise, the interface will only support a single queue.

Flags: Read / Write

Default value: FALSE

Since: 1.2

### The `“owner”` property

      “owner”                    gchar *

The user ID which will own the device. If set to `NULL` everyone will be able to use the device.

Flags: Read / Write

Default value: NULL

Since: 1.2

### The `“pi”` property

      “pi”                       gboolean

If `TRUE` the interface will prepend a 4 byte header describing the physical interface to the packets.

Flags: Read / Write

Default value: FALSE

Since: 1.2

### The `“vnet-hdr”` property

      “vnet-hdr”                 gboolean

If `TRUE` the IFF_VNET_HDR the tunnel packets will include a virtio network header.

Flags: Read / Write

Default value: FALSE

Since: 1.2