Skip to contentSkip to conversation

TUNNEL: Split common functions to export them.

PATCH Applied [email protected] 1 participant 1 message Nov 24, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/7 TUNNEL: Split common functions to export them.

From: Masahide NAKAMURA <[email protected]>

Split common functions like ioctl to export them.
This is a preparation to support to configure IPv6-over-IPv6 tunnel. This patch also includes minor improvemen:
o to stop to include unused headers
o to change function static if it is not needed to be exported

---
 ip/Makefile   |    2 -
 ip/iptunnel.c |  167 +++++++++++----------------------------------------------
 ip/tunnel.c   |  166 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ip/tunnel.h   |   35 ++++++++++++
 4 files changed, 233 insertions(+), 137 deletions(-)
ip/Makefile +1 -1
index 3383c72..7d4b56f 100644
@@ -1,5 +1,5 @@
 IPOBJ=ip.o ipaddress.o iproute.o iprule.o \
-    rtm_map.o iptunnel.o ipneigh.o ipntable.o iplink.o \
+    rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
     ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \
     ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o
 
ip/iptunnel.c +31 -136

266 lines not on this page · raw message

ip/tunnel.c new file +166 -0

166 lines not on this page · raw message

ip/tunnel.h new file +35 -0
new file mode 100644
index 0000000..72512e8
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C)2006 USAGI/WIDE Project
+ * 
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/*
+ * Author:
+ *	Masahide NAKAMURA @USAGI
+ */
+#ifndef __TUNNEL_H__
+#define __TUNNEL_H__ 1
+
+#include <linux/types.h>
+
+const char *tnl_strproto(__u8 proto);
+int tnl_ioctl_get_ifindex(const char *dev);
+int tnl_ioctl_get_iftype(const char *dev);
+char * tnl_ioctl_get_ifname(int idx);
+int tnl_get_ioctl(const char *basedev, void *p);
+int tnl_add_ioctl(int cmd, const char *basedev, const char *name, void *p);
+int tnl_del_ioctl(const char *basedev, const char *name, void *p);
+
+#endif
Signature · 1 line
1.4.2