Loading...
Searching...
No Matches
netdev_tap.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for
6 * more details.
7 */
8
20#ifndef NETDEV_TAP_H
21#define NETDEV_TAP_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <stdint.h>
28#include <stdbool.h>
29#include "net/netdev.h"
30
31#include "net/ethernet/hdr.h"
32
33#include "net/if.h"
34
46
50typedef struct {
51 char **tap_name;
53 bool wired;
56
65void netdev_tap_setup(netdev_tap_t *dev, const netdev_tap_params_t *params, int index);
66
67#ifdef __cplusplus
68}
69#endif
71#endif /* NETDEV_TAP_H */
Definitions low-level network driver interface.
#define ETHERNET_ADDR_LEN
Length of an Ethernet address.
Definition hdr.h:32
Ethernet header definitions.
void netdev_tap_setup(netdev_tap_t *dev, const netdev_tap_params_t *params, int index)
Setup netdev_tap_t structure.
struct netdev_tap netdev_tap_t
tap interface state
tap interface initialization parameters
Definition netdev_tap.h:50
char ** tap_name
Name of the host system's tap interface to bind to.
Definition netdev_tap.h:51
bool wired
Interface should behave like a wired interface.
Definition netdev_tap.h:53
tap interface state
Definition netdev_tap.h:38
bool promiscuous
Flag for promiscuous mode.
Definition netdev_tap.h:43
int tap_fd
host file descriptor for the TAP
Definition netdev_tap.h:41
bool wired
Flag for wired mode.
Definition netdev_tap.h:44
netdev_t netdev
netdev internal member
Definition netdev_tap.h:39
char tap_name[IFNAMSIZ]
host dev file name
Definition netdev_tap.h:40
uint8_t addr[ETHERNET_ADDR_LEN]
The MAC address of the TAP.
Definition netdev_tap.h:42
Structure to hold driver state.
Definition netdev.h:362