-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for TUN-based Channels (kqueue/epoll) #12960
base: 4.1
Are you sure you want to change the base?
Commits on Nov 2, 2022
-
Add Support for TUN-based Channels (kqueue/epoll)
Motivation: I want to develop a mesh VPN. Since I love netty, I would love to use it for this project. Therefore I need a TUN-based Channel implementation. Modifications: - Added native methods to io.netty.channel.kqueue.BsdSocket and io.netty.channel.epoll.LinuxSocket, allowing the creation of TUN devices and setting/getting the network interface MTU on macOS and Linux. - Implemented io.netty.channel.kqueue.KQueueTunChannel and io.netty.channel.epoll.EpollTunChannel, allowing the creation of TUN-based channels using epoll and kqueue. - Defined and implemented io.netty.channel.socket.TunChannelConfig, allowing setting/getting the network interface MTU. - Modified io.netty.channel.unix.Socket to avoid Socket#isIPv6(fd) call that is not supported on TUN sockets. - Modified io.netty.channel.epoll.AbstractEpollChannel allowing to set AbstractEpollChannel#local in EpollTunChannel#doBind as io.netty.channel.kqueue.Native#epollCtlAdd must be called after TUN device has been bound. - Renamed io.netty.channel.kqueue.AbstractKQueueDatagramChannel to io.netty.channel.kqueue.AbstractKQueueMessageChannel because KQueueTunChannel needs to implement this class but is not datagram related. As this rename may break the API, I re-added AbstractKQueueDatagramChannel for legacy reasons. - Added io.netty.channel.socket.Tun4Packet and io.netty.channel.socket.Tun6Packet to help work with IPv4 and IPv6 packets. - Added io.netty.example.tun.TunPingDevice example creating a TUN device that will reply to IPMC/IPv6-ICMP echo ping requests. - Added io.netty.example.tun.TunEchoDevice example that echoes all received IP packets (e.g., suitable for performance tests). - Added native dependencies to example/pom.xml (might require changes to your release workflow). - Modified run-example.sh to activate platform-dependent native transport maven profile. Result: Support for TUN-based Channels on kqueue- and epoll-enabled platforms. Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 3264f9a - Browse repository at this point
Copy the full SHA 3264f9aView commit details
Commits on Nov 8, 2022
-
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for e0e9f63 - Browse repository at this point
Copy the full SHA e0e9f63View commit details -
Change return type of TunPacket#version to InternetProtocolFamily
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for c3f3230 - Browse repository at this point
Copy the full SHA c3f3230View commit details -
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 90388e0 - Browse repository at this point
Copy the full SHA 90388e0View commit details -
Fix bug with tun device name off by 1 on macOS
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 525fd88 - Browse repository at this point
Copy the full SHA 525fd88View commit details -
Add javadoc to TunAddress describing implications of null value
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for c4987b6 - Browse repository at this point
Copy the full SHA c4987b6View commit details
Commits on Nov 11, 2022
-
Add support for IFF_MULTI_QUEUE
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 94022b7 - Browse repository at this point
Copy the full SHA 94022b7View commit details
Commits on Nov 21, 2022
-
Check if IFF_MULTI_QUEUE is supported
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 31a553e - Browse repository at this point
Copy the full SHA 31a553eView commit details -
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 10129c2 - Browse repository at this point
Copy the full SHA 10129c2View commit details -
Fix bug with macOS choosing the tun device name
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 9f60b89 - Browse repository at this point
Copy the full SHA 9f60b89View commit details
Commits on Nov 23, 2022
-
Add tests for EpollTunChannel and KqueueTunChannel (and helper classes)
Co-authored-by: Kevin Röbert <dev@roebert.eu>
Configuration menu - View commit details
-
Copy full SHA for 21ccd38 - Browse repository at this point
Copy the full SHA 21ccd38View commit details