]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/functions/functions.ip-tunnel
Add generic IP tunnel zone hook
[people/stevee/network.git] / src / functions / functions.ip-tunnel
index 69377aea1d801891976596c8488cc6000ceb8eee..302a11c3bd8e3bda7f4a2706ef7905912ee143cc 100644 (file)
 
 IP_TUNNEL_MODES="gre sit vti"
 
+ip_tunnel_protocol_to_name() {
+       local protocol="${1}"
+
+       case "${protocol}" in
+               gre)
+                       print "Generic Routing Encapsulation"
+                       ;;
+               sit)
+                       print "Simple Internet Transition"
+                       ;;
+               vti)
+                       print "Virtual Tunnel Interface"
+                       ;;
+               *)
+                       print "${protocol}"
+                       ;;
+       esac
+}
+
 # This function converts our modes into the type
 # the iproute2 tool uses
 ip_tunnel_convert_mode_to_iproute2_mode() {