Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
415 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Routines for handling tun device settings | ||
* | ||
* Copyright (C) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. | ||
* | ||
* 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. | ||
* | ||
* 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. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, see <http://www.gnu.org/licenses/> or write | ||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301 USA. | ||
* | ||
* Authors: | ||
* Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de> | ||
* Marius Tomaschewski <mt@suse.de> | ||
* | ||
*/ | ||
|
||
#ifndef __WICKED_TUN_H__ | ||
#define __WICKED_TUN_H__ | ||
|
||
#include <wicked/types.h> | ||
|
||
struct ni_tun { | ||
ni_bool_t persistent; /* Always TRUE */ | ||
uid_t owner; | ||
gid_t group; | ||
}; | ||
|
||
extern ni_tun_t * ni_tun_new(void); | ||
extern void ni_tun_free(ni_tun_t *); | ||
extern const char * ni_tun_validate(const ni_tun_t *); | ||
|
||
extern int ni_tun_parse_sysfs_attrs(const char *, ni_tun_t *); | ||
#endif /* __WICKED_MACVLAN_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<interface> | ||
<name>tun0</name> | ||
|
||
<tun> | ||
<persistent>true</persistent> | ||
<owner>0</owner> | ||
<group>0</group> | ||
</tun> | ||
</interface> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!-- | ||
-- tun service definition | ||
--> | ||
<service name="tun" interface="org.opensuse.Network.TUN" | ||
object-class="netif-virtual-tunnel"> | ||
<description> | ||
This link-layer service is provided by all TUN devices. Since there isn't a lot | ||
to tune about a TUN once it has been created, this DBus interface doesn't offer | ||
an own changeDevice() method (yet). | ||
|
||
TUN devices can be created through the org.opensuse.Network.TUN.Factory | ||
factory interface. | ||
</description> | ||
|
||
<!-- This are the properties used to configure the tun --> | ||
<define name="configuration" class="dict"> | ||
<device type="string"> | ||
<meta:netif-reference shared="true"/> | ||
<meta:require check="netif-child-state" op="newDevice" min-state="device-exists" /> | ||
<meta:require check="netif-child-state" op="linkUp" min-state="device-up" /> | ||
<meta:require check="netif-child-state" op="login" min-state="link-authenticated" /> | ||
</device> | ||
|
||
<persistent type="boolean"/> | ||
<owner type="uint32"/> | ||
<group type="uint32"/> | ||
</define> | ||
|
||
<!-- The same properties are returned in interface state reports --> | ||
<define name="properties" type="tun:configuration"/> | ||
|
||
<method name="deleteDevice"> | ||
<!-- no arguments, no return code --> | ||
</method> | ||
</service> | ||
|
||
<service name="tun-factory" interface="org.opensuse.Network.TUN.Factory" | ||
object-class="netif-list"> | ||
<method name="newDevice"> | ||
<arguments> | ||
<name type="string"/> | ||
<config type="tun:configuration"> | ||
<meta:mapping document-node="/tun"/> | ||
</config> | ||
</arguments> | ||
<return> | ||
<!-- this is really an object handle --> | ||
<string/> | ||
</return> | ||
</method> | ||
</service> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,7 @@ libwicked_la_SOURCES = \ | |
sysconfig.c \ | ||
sysfs.c \ | ||
timer.c \ | ||
tun.c \ | ||
update.c \ | ||
util.c \ | ||
vlan.c \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.