Przeglądaj źródła

[net/siit] Moved from oldpackages and updated for kernels 3.17+

Vladimir Ulrich 9 lat temu
rodzic
commit
2ef99b98ca
4 zmienionych plików z 1537 dodań i 0 usunięć
  1. 42
    0
      net/siit/Makefile
  2. 5
    0
      net/siit/src/Makefile
  3. 1429
    0
      net/siit/src/siit.c
  4. 61
    0
      net/siit/src/siit.h

+ 42
- 0
net/siit/Makefile Wyświetl plik

@@ -0,0 +1,42 @@
1
+#
2
+# Copyright (C) 2006-2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+include $(INCLUDE_DIR)/kernel.mk
10
+
11
+PKG_NAME:=siit
12
+PKG_VERSION:=1.2
13
+PKG_RELEASE:=1
14
+PKG_LICENSE:=GPLv2+
15
+
16
+include $(INCLUDE_DIR)/package.mk
17
+
18
+define KernelPackage/siit
19
+  SUBMENU:=Network Devices
20
+  TITLE:=Stateless IP ICMP Translation Algorithm
21
+  DEPENDS:= @(!(TARGET_ps3||TARGET_pxcab))
22
+  FILES:=$(PKG_BUILD_DIR)/siit.ko
23
+  AUTOLOAD:=$(call AutoLoad,50,siit)
24
+  MAINTAINER=Vladimir Ulrich <admin@evl.su>
25
+endef
26
+
27
+include $(INCLUDE_DIR)/kernel-defaults.mk
28
+
29
+define KernelPackage/siit/description
30
+ Stateless IP ICMP Translation Algorithm
31
+endef
32
+
33
+define Build/Prepare
34
+	mkdir -p $(PKG_BUILD_DIR)
35
+	cp src/Makefile src/siit.h src/siit.c $(PKG_BUILD_DIR)/
36
+endef
37
+
38
+define Build/Compile
39
+	$(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
40
+endef
41
+
42
+$(eval $(call KernelPackage,siit))

+ 5
- 0
net/siit/src/Makefile Wyświetl plik

@@ -0,0 +1,5 @@
1
+obj-m   := siit.o
2
+ifeq ($(MAKING_MODULES),1)
3
+-include $(TOPDIR)/Rules.make
4
+endif
5
+

+ 1429
- 0
net/siit/src/siit.c
Plik diff jest za duży
Wyświetl plik


+ 61
- 0
net/siit/src/siit.h Wyświetl plik

@@ -0,0 +1,61 @@
1
+/*
2
+ * siit.h -- definitions for the SIIT module
3
+ *
4
+ *
5
+ */
6
+
7
+/*
8
+ * Constants
9
+ */
10
+
11
+/* SIIT_ETH control the name of SIIT interface:
12
+ * 0 - interface name is siit0,
13
+ * 1 - interface name is ethX.
14
+ */
15
+#define SIIT_ETH 0
16
+
17
+#define BUFF_SIZE 4096
18
+#define FRAG_BUFF_SIZE 1232     /* IPv6 max fragment size without IPv6 header 
19
+                                 * to fragmanet IPv4 if result IPv6 packet will be > 1280
20
+                                 */
21
+
22
+#define TRANSLATED_PREFIX 0x0000ffff /* third byte in IPv4-translated addr prefix */
23
+#define MAPPED_PREFIX 0x0000ffff     /* third byte in IPv4-mapped addr prefix */
24
+
25
+#define IP4_IP6_HDR_DIFF 20     /* diffirence between IPv4 and IPv6 headers */
26
+#define IP6_FRAGMENT_SIZE 8     /* size of Fragment Header */
27
+
28
+/* IPv6 header fields masks */
29
+#define IP6F_OFF_MASK       0xfff8  /* mask out offset from frag_off */
30
+#define IP6F_RESERVED_MASK  0x0006  /* reserved bits in frag_off */
31
+#define IP6F_MORE_FRAG      0x0001  /* more-fragments flag */
32
+
33
+
34
+
35
+/*
36
+ * Macros to help debugging
37
+ */
38
+
39
+#undef PDEBUG             /* undef it, just in case */
40
+#ifdef SIIT_DEBUG
41
+#  ifdef __KERNEL__
42
+     /* This one if debugging is on, and kernel space */
43
+#    define PDEBUG(fmt, args...) printk(KERN_DEBUG "siit: " fmt, ## args)
44
+#  else
45
+     /* This one for user space */
46
+#    define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
47
+#  endif
48
+#else
49
+#  define PDEBUG(fmt, args...) /* not debugging: nothing */
50
+#endif
51
+
52
+#undef PDEBUGG
53
+#define PDEBUGG(fmt, args...)
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+