diff options
4 files changed, 154 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/tayga/files/0001-include-sys-uio.patch b/meta-networking/recipes-connectivity/tayga/files/0001-include-sys-uio.patch new file mode 100644 index 0000000000..0c6f1609af --- /dev/null +++ b/meta-networking/recipes-connectivity/tayga/files/0001-include-sys-uio.patch | |||
@@ -0,0 +1,18 @@ | |||
1 | |||
2 | This patch addresses the following clang failure: tayga-0.9.2/nat64.c:119:6: | ||
3 | error: call to undeclared function 'writev'; ISO C99 and later do not support | ||
4 | implicit function declarations [-Wimplicit-function-declaration] | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Pawel Langowski <pawel.langowski@3mdeb.com> | ||
8 | |||
9 | --- tayga.h 2023-09-29 14:38:05.005837695 +0200 | ||
10 | +++ tayga-2.h 2023-09-29 14:37:45.560837257 +0200 | ||
11 | @@ -20,6 +20,7 @@ | ||
12 | #include <sys/stat.h> | ||
13 | #include <sys/ioctl.h> | ||
14 | #include <sys/socket.h> | ||
15 | +#include <sys/uio.h> | ||
16 | #include <netinet/in.h> | ||
17 | #include <arpa/inet.h> | ||
18 | #include <unistd.h> | ||
diff --git a/meta-networking/recipes-connectivity/tayga/files/tayga.conf b/meta-networking/recipes-connectivity/tayga/files/tayga.conf new file mode 100644 index 0000000000..c1b6163a45 --- /dev/null +++ b/meta-networking/recipes-connectivity/tayga/files/tayga.conf | |||
@@ -0,0 +1,103 @@ | |||
1 | # | ||
2 | # Sample configuration file for TAYGA 0.9.2 | ||
3 | # | ||
4 | # Modify this to use your own addresses!! | ||
5 | # | ||
6 | |||
7 | # | ||
8 | # TUN device that TAYGA will use to exchange IPv4 and IPv6 packets with the | ||
9 | # kernel. You may use any name you like, but `nat64' is recommended. | ||
10 | # | ||
11 | # This device may be created before starting the tayga daemon by running | ||
12 | # `tayga --mktun`. This allows routing and firewall rules to be set up prior | ||
13 | # to commencement of packet translation. | ||
14 | # | ||
15 | # Mandatory. | ||
16 | # | ||
17 | tun-device nat64 | ||
18 | |||
19 | # | ||
20 | # TAYGA's IPv4 address. This is NOT your router's IPv4 address! TAYGA | ||
21 | # requires its own address because it acts as an IPv4 and IPv6 router, and | ||
22 | # needs to be able to send ICMP messages. TAYGA will also respond to ICMP | ||
23 | # echo requests (ping) at this address. | ||
24 | # | ||
25 | # This address can safely be located inside the dynamic-pool prefix. | ||
26 | # | ||
27 | # Mandatory. | ||
28 | # | ||
29 | ipv4-addr 192.168.254.1 | ||
30 | |||
31 | # | ||
32 | # TAYGA's IPv6 address. This is NOT your router's IPv6 address! TAYGA | ||
33 | # requires its own address because it acts as an IPv4 and IPv6 router, and | ||
34 | # needs to be able to send ICMP messages. TAYGA will also respond to ICMP | ||
35 | # echo requests (ping6) at this address. | ||
36 | # | ||
37 | # You can leave ipv6-addr unspecified and TAYGA will construct its IPv6 | ||
38 | # address using ipv4-addr and the NAT64 prefix. | ||
39 | # | ||
40 | # Optional if the NAT64 prefix is specified, otherwise mandatory. It is also | ||
41 | # mandatory if the NAT64 prefix is 64:ff9b::/96 and ipv4-addr is a private | ||
42 | # (RFC1918) address. | ||
43 | # | ||
44 | #ipv6-addr 2001:db8:1::2 | ||
45 | ipv6-addr fdaa:bb:1::1 | ||
46 | |||
47 | # | ||
48 | # The NAT64 prefix. The IPv4 address space is mapped into the IPv6 address | ||
49 | # space by prepending this prefix to the IPv4 address. Using a /96 prefix is | ||
50 | # recommended in most situations, but all lengths specified in RFC 6052 are | ||
51 | # supported. | ||
52 | # | ||
53 | # This must be a prefix selected from your organization's IPv6 address space | ||
54 | # or the Well-Known Prefix 64:ff9b::/96. Note that using the Well-Known | ||
55 | # Prefix will prohibit IPv6 hosts from contacting IPv4 hosts that have private | ||
56 | # (RFC1918) addresses, per RFC 6052. | ||
57 | # | ||
58 | # The NAT64 prefix need not be specified if all required address mappings are | ||
59 | # listed in `map' directives. (See below.) | ||
60 | # | ||
61 | # Optional. | ||
62 | # | ||
63 | ##prefix 2001:db8:1:ffff::/96 | ||
64 | prefix 64:ff9b::/96 | ||
65 | |||
66 | # | ||
67 | # Dynamic pool prefix. IPv6 hosts which send traffic through TAYGA (and do | ||
68 | # not correspond to a static map or an IPv4-translatable address in the NAT64 | ||
69 | # prefix) will be assigned an IPv4 address from the dynamic pool. Dynamic | ||
70 | # maps are valid for 124 minutes after the last matching packet is seen. | ||
71 | # | ||
72 | # If no unassigned addresses remain in the dynamic pool (or no dynamic pool is | ||
73 | # configured), packets from unknown IPv6 hosts will be rejected with an ICMP | ||
74 | # unreachable error. | ||
75 | # | ||
76 | # Optional. | ||
77 | # | ||
78 | dynamic-pool 192.168.254.0/24 | ||
79 | |||
80 | # | ||
81 | # Persistent data storage directory. The dynamic.map file, which saves the | ||
82 | # dynamic maps that are created from dynamic-pool, is stored in this | ||
83 | # directory. Omit if you do not need these maps to be persistent between | ||
84 | # instances of TAYGA. | ||
85 | # | ||
86 | # Optional. | ||
87 | # | ||
88 | data-dir /var/spool/tayga | ||
89 | |||
90 | # | ||
91 | # Establishes a single-host map. If an IPv6 host should be consistently | ||
92 | # reachable at a specific IPv4 address, the mapping can be specified in a | ||
93 | # `map' directive. (IPv6 hosts numbered with an IPv4-translatable address do | ||
94 | # not need map directives.) | ||
95 | # | ||
96 | # IPv4 addresses specified in the `map' directive can safely be located inside | ||
97 | # the dynamic-pool prefix. | ||
98 | # | ||
99 | # Optional. | ||
100 | # | ||
101 | #map 192.168.5.42 2001:db8:1:4444::1 | ||
102 | #map 192.168.5.43 2001:db8:1:4444::2 | ||
103 | #map 192.168.255.2 2001:db8:1:569::143 | ||
diff --git a/meta-networking/recipes-connectivity/tayga/files/tayga.service b/meta-networking/recipes-connectivity/tayga/files/tayga.service new file mode 100644 index 0000000000..0bffeb92a5 --- /dev/null +++ b/meta-networking/recipes-connectivity/tayga/files/tayga.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | SourcePath=/usr/sbin/tayga | ||
3 | Description=LSB: userspace NAT64 | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | ExecStart=/usr/sbin/tayga -d --config /etc/tayga.conf | ||
8 | RemainAfterExit=yes | ||
9 | TimeoutStopSec=infinity | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-connectivity/tayga/tayga_0.9.2.bb b/meta-networking/recipes-connectivity/tayga/tayga_0.9.2.bb new file mode 100644 index 0000000000..36d35e6dee --- /dev/null +++ b/meta-networking/recipes-connectivity/tayga/tayga_0.9.2.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | LICENSE = "GPL-2.0-only" | ||
2 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
3 | |||
4 | SRC_URI = " \ | ||
5 | http://www.litech.org/tayga/tayga-${PV}.tar.bz2 \ | ||
6 | file://tayga.conf \ | ||
7 | file://tayga.service \ | ||
8 | file://0001-include-sys-uio.patch;striplevel=0 \ | ||
9 | " | ||
10 | SRC_URI[sha256sum] = "2b1f7927a9d2dcff9095aff3c271924b052ccfd2faca9588b277431a44f0009c" | ||
11 | |||
12 | SYSTEMD_PACKAGES = "${PN}" | ||
13 | SYSTEMD_SERVICE:${PN} = "tayga.service" | ||
14 | |||
15 | do_install:append() { | ||
16 | install -m 0644 ${WORKDIR}/tayga.conf ${D}${sysconfdir}/tayga.conf | ||
17 | install -d ${D}${systemd_unitdir}/system/ | ||
18 | install -m 0644 ${WORKDIR}/tayga.service ${D}${systemd_unitdir}/system/ | ||
19 | } | ||
20 | |||
21 | inherit autotools systemd | ||