diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2018-09-24 15:11:25 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2018-09-24 15:11:25 +0200 |
commit | 7152c3439f3decbb6366d94464d3c089674c8c30 (patch) | |
tree | 48bfe66e31226d55914868bc0558f479e2a22a36 /src/dumm/iface.h | |
parent | c2ac4e0da62d859085148d8518d558402e1f9a8c (diff) | |
parent | e0e280b7669435b991b7e457abd8aa450930b3e8 (diff) | |
download | vyos-strongswan-7152c3439f3decbb6366d94464d3c089674c8c30.tar.gz vyos-strongswan-7152c3439f3decbb6366d94464d3c089674c8c30.zip |
Update upstream source from tag 'upstream/5.7.0'
Update to upstream version '5.7.0'
with Debian dir b608300a1e1f88db62d14d08a55ca09f3603f054
Diffstat (limited to 'src/dumm/iface.h')
-rw-r--r-- | src/dumm/iface.h | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/src/dumm/iface.h b/src/dumm/iface.h deleted file mode 100644 index e6e8775a0..000000000 --- a/src/dumm/iface.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2007 Martin Willi - * HSR Hochschule fuer Technik Rapperswil - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#ifndef IFACE_H -#define IFACE_H - -#include <library.h> -#include <collections/enumerator.h> -#include <networking/host.h> - -#define TAP_DEVICE "/dev/net/tun" - -typedef struct iface_t iface_t; - -#include "mconsole.h" -#include "bridge.h" -#include "guest.h" - -/** - * Interface in a guest, connected to a tap device on the host. - */ -struct iface_t { - - /** - * Get the interface name in the guest (e.g. eth0). - * - * @return guest interface name - */ - char* (*get_guestif)(iface_t *this); - - /** - * Get the interface name at the host (e.g. tap0). - * - * @return host interface (tap device) name - */ - char* (*get_hostif)(iface_t *this); - - /** - * Add an address to the interface. - * - * @param addr address to add to the interface - * @param bits network prefix length in bits - * @return TRUE if address added - */ - bool (*add_address)(iface_t *this, host_t *addr, int bits); - - /** - * Create an enumerator over all installed addresses. - * - * @return enumerator over host_t* - */ - enumerator_t* (*create_address_enumerator)(iface_t *this); - - /** - * Remove an address from an interface. - * - * @note The network prefix length has to be the same as used in add_address - * - * @param addr address to remove - * @param bits network prefix length in bits - * @return TRUE if address removed - */ - bool (*delete_address)(iface_t *this, host_t *addr, int bits); - - /** - * Set the bridge this interface is attached to. - * - * @param bridge assigned bridge, or NULL for none - */ - void (*set_bridge)(iface_t *this, bridge_t *bridge); - - /** - * Get the bridge this iface is connected, or NULL. - * - * @return connected bridge, or NULL - */ - bridge_t* (*get_bridge)(iface_t *this); - - /** - * Get the guest this iface belongs to. - * - * @return guest of this iface - */ - guest_t* (*get_guest)(iface_t *this); - - /** - * Destroy an interface - */ - void (*destroy) (iface_t *this); -}; - -/** - * Create a new interface for a guest - * - * @param name name of the interface in the guest - * @param guest guest this iface is connecting - * @param mconsole mconsole of guest - * @return interface descriptor, or NULL if failed - */ -iface_t *iface_create(char *name, guest_t *guest, mconsole_t *mconsole); - -#endif /* IFACE_H */ - |